Skip to content

Commit

Permalink
fixes | working now
Browse files Browse the repository at this point in the history
  • Loading branch information
Szegoo committed May 7, 2024
1 parent 84fcc33 commit 007062b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 45 deletions.
36 changes: 1 addition & 35 deletions e2e_tests/fee-payment/custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,45 +26,11 @@ async function run(nodeName: string, networkInfo: any, _jsArgs: any) {
const setXcmVersion = rococoApi.tx.xcmPallet.forceDefaultXcmVersion([3]);
await submitExtrinsic(alice, rococoApi.tx.sudo.sudo(setXcmVersion), {});

await setupRelayAsset(regionXApi, alice);
await setupRelayAsset(regionXApi, alice, 10n**12n);

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, {});

// Try to pay for fees with relay chain asset.
const remarkCall = regionXApi.tx.system.remark("0x44");
await submitExtrinsic(alice, remarkCall, { assetId: RELAY_ASSET_ID });
Expand Down
16 changes: 7 additions & 9 deletions e2e_tests/xc-transfer/asset-transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,15 @@ async function run(nodeName: string, networkInfo: any, _jsArgs: any) {
const setXcmVersion = rococoApi.tx.xcmPallet.forceDefaultXcmVersion([3]);
await submitExtrinsic(alice, rococoApi.tx.sudo.sudo(setXcmVersion), {});

const BALANCE = 10n ** 9n;

await setupRelayAsset(regionXApi, alice, BALANCE);
await setupRelayAsset(regionXApi, alice);

const receiverKeypair = new Keyring();
receiverKeypair.addFromAddress(alice.address);

const showBalanceOnRegionX = async () => {
const { free } = (
await regionXApi.query.tokens.accounts(alice.address, RELAY_ASSET_ID)
).toJSON() as any;
).toHuman() as any;

console.log(`RegionX: ${free}`);
};
Expand Down Expand Up @@ -67,7 +65,7 @@ async function run(nodeName: string, networkInfo: any, _jsArgs: any) {
Concrete: { parents: 0, interior: "Here" },
},
fun: {
Fungible: BALANCE,
Fungible: 3n * 10n ** 12n,
},
},
],
Expand All @@ -77,7 +75,7 @@ async function run(nodeName: string, networkInfo: any, _jsArgs: any) {
);
await submitExtrinsic(alice, rococoReserveTransfer, {});

await sleep(15 * 1000);
await sleep(5 * 1000);

await showBalanceOnRegionX();
await showBalanceOnRococo();
Expand All @@ -86,7 +84,7 @@ async function run(nodeName: string, networkInfo: any, _jsArgs: any) {
{ V3: { parents: 1, interior: "Here" } }, //dest
{
V3: {
parents: 1,
parents: 0,
interior: {
X1: {
AccountId32: {
Expand All @@ -104,7 +102,7 @@ async function run(nodeName: string, networkInfo: any, _jsArgs: any) {
Concrete: { parents: 1, interior: "Here" },
},
fun: {
Fungible: BALANCE,
Fungible: 10n ** 12n,
},
},
],
Expand All @@ -115,7 +113,7 @@ async function run(nodeName: string, networkInfo: any, _jsArgs: any) {

await submitExtrinsic(alice, regionXReserveTransfer, {});

await sleep(30 * 1000);
await sleep(5 * 1000);

await showBalanceOnRegionX();
await showBalanceOnRococo();
Expand Down
4 changes: 3 additions & 1 deletion zombienet_tests/0006-xc-transfer.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ command = "polkadot"

[[relaychain.nodes]]
name = "rococo-validator01"
args = [ "--log=xcm=trace" ]
validator = true

[[relaychain.nodes]]
name = "rococo-validator02"
args = [ "--log=xcm=trace" ]
validator = true

[[parachains]]
Expand All @@ -20,4 +22,4 @@ addToGenesis = false
[parachains.collator]
name = "regionx-collator01"
command = "regionx-node"
args = [ "-lruntime=debug,parachain=trace" ]
args = [ "--log=xcm=trace" ]

0 comments on commit 007062b

Please sign in to comment.