git.delta.rocks / unique-network / refs/commits / 28d7737590e5

difftreelog

Transaction commisions displayed

Dev2022-09-06parent: #0d218a2.patch.diff
in: master

1 file changed

modifiedtests/src/xcm/xcmOpal.test.tsdiffbeforeafterboth
48// 10,000.00 (ten thousands) USDT48// 10,000.00 (ten thousands) USDT
49const ASSET_AMOUNT = 1_000_000_000_000_000_000_000n; 49const ASSET_AMOUNT = 1_000_000_000_000_000_000_000n;
5050
51describe('Integration test: Exchanging USDT with Statemine', () => {51describe('Integration test: Exchanging USDT with Westmint', () => {
52 let alice: IKeyringPair;52 let alice: IKeyringPair;
53 let bob: IKeyringPair;53 let bob: IKeyringPair;
54 54
6161
62 let balanceBobBefore: bigint;62 let balanceBobBefore: bigint;
63 let balanceBobAfter: bigint;63 let balanceBobAfter: bigint;
64 let balanceBobFinal: bigint;
6564
66 before(async () => {65 before(async () => {
67 await usingApi(async (api, privateKeyWrapper) => {66 await usingApi(async (api, privateKeyWrapper) => {
204 203
205 });204 });
206205
207 it('Should connect and send USDT from Statemine to Unique', async () => {206 it('Should connect and send USDT from Westmint to Opal', async () => {
208 207
209 const statemineApiOptions: ApiOptions = {208 const statemineApiOptions: ApiOptions = {
210 provider: new WsProvider('ws://127.0.0.1:' + STATEMINE_PORT),209 provider: new WsProvider('ws://127.0.0.1:' + STATEMINE_PORT),
277 [balanceStmnAfter] = await getBalance(api, [alice.address]);276 [balanceStmnAfter] = await getBalance(api, [alice.address]);
278277
279 // common good parachain take commission in it native token278 // common good parachain take commission in it native token
279 console.log('Opal to Westmint transaction fees on Westmint: %s WND', balanceStmnBefore - balanceStmnAfter);
280 expect(balanceStmnBefore > balanceStmnAfter).to.be.true;280 expect(balanceStmnBefore > balanceStmnAfter).to.be.true;
281281
282 }, statemineApiOptions);282 }, statemineApiOptions);
292292
293 // commission has not paid in USDT token293 // commission has not paid in USDT token
294 expect(free == TRANSFER_AMOUNT).to.be.true;294 expect(free == TRANSFER_AMOUNT).to.be.true;
295 console.log('Opal to Westmint transaction fees on Opal: %s USDT', TRANSFER_AMOUNT - free);
295 // ... and parachain native token296 // ... and parachain native token
296 expect(balanceOpalAfter == balanceOpalBefore).to.be.true;297 expect(balanceOpalAfter == balanceOpalBefore).to.be.true;
297298 console.log('Opal to Westmint transaction fees on Opal: %s WND', balanceOpalAfter - balanceOpalBefore);
298299
299 }, uniqueApiOptions);300 }, uniqueApiOptions);
300 301
440441
441 [balanceBobAfter] = await getBalance(api, [alice.address]);442 [balanceBobAfter] = await getBalance(api, [alice.address]);
442 expect(balanceBobBefore == balanceBobAfter).to.be.true;443 expect(balanceBobBefore == balanceBobAfter).to.be.true;
444 console.log('Relay (Westend) to Opal transaction fees: %s OPL', balanceBobAfter - balanceBobBefore);
445
443 }, uniqueApiOptions2);446 }, uniqueApiOptions2);
444447