-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
const { ApiPromise, WsProvider, Keyring } = require("@polkadot/api"); | ||
const { submitExtrinsic, setupRelayAsset } = require("./common"); | ||
|
||
async function run(nodeName, networkInfo, _jsArgs) { | ||
const { wsUri: regionXUri } = networkInfo.nodesByName[nodeName]; | ||
const { wsUri: rococoUri } = networkInfo.nodesByName["rococo-validator01"]; | ||
const { wsUri: coretimeUri } = networkInfo.nodesByName["coretime-collator01"]; | ||
|
||
const rococoApi = await ApiPromise.create({ | ||
provider: new WsProvider(rococoUri), | ||
}); | ||
const regionXApi = await ApiPromise.create({provider: new WsProvider(regionXUri)}); | ||
|
||
// account to submit tx | ||
const keyring = new zombie.Keyring({ type: "sr25519" }); | ||
const alice = keyring.addFromUri("//Alice"); | ||
|
||
const setRelayXcmVersion = rococoApi.tx.xcmPallet.forceDefaultXcmVersion([3]); | ||
await submitExtrinsic(alice, rococoApi.tx.sudo.sudo(setRelayXcmVersion), {}); | ||
const setCoretimeXcmVersion = coretimeUri.tx.xcmPallet.forceDefaultXcmVersion([3]); | ||
await submitExtrinsic(alice, coretimeUri.tx.sudo.sudo(setCoretimeXcmVersion), {}); | ||
|
||
await setupRelayAsset(regionXApi, alice); | ||
|
||
const receiverKeypair = new Keyring(); | ||
receiverKeypair.addFromAddress(alice.address); | ||
|
||
const feeAssetItem = 0; | ||
const weightLimit = "Unlimited"; | ||
const reserveTransfer = rococoApi.tx.xcmPallet.limitedReserveTransferAssets( | ||
{ V3: { parents: 0, interior: { X1: { Parachain: 2000 } } } }, //dest | ||
{ | ||
V3: { | ||
parents: 0, | ||
interior: { | ||
X1: { | ||
AccountId32: { | ||
chain: "Any", | ||
id: receiverKeypair.pairs[0].publicKey, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, //beneficiary | ||
{ | ||
V3: [ | ||
{ | ||
id: { | ||
Concrete: { parents: 0, interior: "Here" }, | ||
}, | ||
fun: { | ||
Fungible: 10n ** 9n, | ||
}, | ||
}, | ||
], | ||
}, //asset | ||
feeAssetItem, | ||
weightLimit, | ||
); | ||
await submitExtrinsic(alice, reserveTransfer, {}); | ||
} | ||
|
||
module.exports = { run }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[settings] | ||
timeout = 1000 | ||
|
||
[relaychain] | ||
chain = "rococo-local" | ||
command = "polkadot" | ||
|
||
[[relaychain.nodes]] | ||
name = "rococo-validator01" | ||
validator = true | ||
|
||
[[relaychain.nodes]] | ||
name = "rococo-validator02" | ||
validator = true | ||
|
||
[[parachains]] | ||
id = 1005 | ||
chain = "coretime-rococo-local" | ||
addToGenesis = true | ||
|
||
[parachains.collator] | ||
name = "coretime-collator01" | ||
command = "polkadot-parachain" | ||
args = [ "-lruntime=debug,parachain=trace" ] | ||
|
||
[[parachains]] | ||
id = 2000 | ||
addToGenesis = false | ||
|
||
[parachains.collator] | ||
name = "regionx-collator01" | ||
command = "regionx-node" | ||
args = [ "-lruntime=debug,parachain=trace" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Description: Native currency fee payment | ||
Network: ./0006-region-transfer.toml | ||
Creds: config | ||
|
||
rococo-validator01: is up | ||
rococo-validator02: is up | ||
|
||
rococo-validator01: parachain 2000 is registered within 225 seconds | ||
|
||
regionx-collator01: js-script ../e2e_tests/region-transfer.js return is 0 within 400 seconds |