git.delta.rocks / unique-network / refs/commits / 6396c5b10d34

difftreelog

Test logs

Dev2022-09-06parent: #6ddeec3.patch.diff
in: master

1 file changed

modifiedtests/src/xcm/xcmOpal.test.tsdiffbeforeafterboth
3535
36const RELAY_PORT = '9844';36const RELAY_PORT = '9844';
37const UNIQUE_PORT = '9944';37const UNIQUE_PORT = '9944';
38const STATEMINE_PORT = '9948';38const STATEMINE_PORT = '9946';
39const STATEMINE_PALLET_INSTANCE = 50;39const STATEMINE_PALLET_INSTANCE = 50;
40const ASSET_ID = 100;40const ASSET_ID = 100;
41const ASSET_METADATA_DECIMALS = 18;41const ASSET_METADATA_DECIMALS = 18;
6161
62 let balanceBobBefore: bigint;62 let balanceBobBefore: bigint;
63 let balanceBobAfter: bigint;63 let balanceBobAfter: bigint;
64 let balanceBobFinal: bigint;
65
66 let balanceBobRelayTokenBefore: bigint;
67 let balanceBobRelayTokenAfter: bigint;
68
6469
65 before(async () => {70 before(async () => {
380 provider: new WsProvider('ws://127.0.0.1:' + RELAY_PORT),385 provider: new WsProvider('ws://127.0.0.1:' + RELAY_PORT),
381 };386 };
387
388 const TRANSFER_AMOUNT_RELAY = 50_000_000_000_000_000n;
382389
383 await usingApi(async (api) => {390 await usingApi(async (api) => {
384 [balanceBobBefore] = await getBalance(api, [alice.address]);391 [balanceBobBefore] = await getBalance(api, [bob.address]);
392 balanceBobRelayTokenBefore = BigInt(((await api.query.tokens.accounts(bob.addressRaw, {NativeAssetId: 'Parent'})).toJSON() as any).free);
393
385 }, uniqueApiOptions);394 }, uniqueApiOptions);
386395
417 },426 },
418 },427 },
419 fun: {428 fun: {
420 Fungible: 50_000_000_000_000_000n,429 Fungible: TRANSFER_AMOUNT_RELAY,
421 },430 },
422 },431 },
423 ],432 ],
439 await usingApi(async (api) => {448 await usingApi(async (api) => {
440 await waitNewBlocks(api, 3);449 await waitNewBlocks(api, 3);
441450
442 [balanceBobAfter] = await getBalance(api, [alice.address]);451 [balanceBobAfter] = await getBalance(api, [bob.address]);
452 balanceBobRelayTokenAfter = BigInt(((await api.query.tokens.accounts(bob.addressRaw, {NativeAssetId: 'Parent'})).toJSON() as any).free);
453 const wndFee = balanceBobRelayTokenAfter - TRANSFER_AMOUNT_RELAY - balanceBobRelayTokenBefore;
454 console.log('Relay (Westend) to Opal transaction fees: %s OPL', balanceBobAfter - balanceBobBefore);
455 console.log('Relay (Westend) to Opal transaction fees: %s WND', wndFee);
443 expect(balanceBobBefore == balanceBobAfter).to.be.true;456 expect(balanceBobBefore == balanceBobAfter).to.be.true;
444 console.log('Relay (Westend) to Opal transaction fees: %s OPL', balanceBobAfter - balanceBobBefore);457 expect(balanceBobRelayTokenBefore < balanceBobRelayTokenAfter).to.be.true;
445
446 }, uniqueApiOptions2);458 }, uniqueApiOptions2);
447459
487 const result = getGenericResult(events);498 const result = getGenericResult(events);
488 expect(result.success).to.be.true;499 expect(result.success).to.be.true;
500
501 [balanceBobFinal] = await getBalance(api, [bob.address]);
502 console.log('Relay (Westend) to Opal transaction fees: %s OPL', balanceBobAfter - balanceBobFinal);
503
489 }, uniqueApiOptions);504 }, uniqueApiOptions);
490 });505 });