difftreelog
Transaction commisions displayed
in: master
1 file changed
tests/src/xcm/xcmOpal.test.tsdiffbeforeafterboth48// 10,000.00 (ten thousands) USDT48// 10,000.00 (ten thousands) USDT49const ASSET_AMOUNT = 1_000_000_000_000_000_000_000n; 49const ASSET_AMOUNT = 1_000_000_000_000_000_000_000n; 505051describe('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 616162 let balanceBobBefore: bigint;62 let balanceBobBefore: bigint;63 let balanceBobAfter: bigint;63 let balanceBobAfter: bigint;64 let balanceBobFinal: bigint;656466 before(async () => {65 before(async () => {67 await usingApi(async (api, privateKeyWrapper) => {66 await usingApi(async (api, privateKeyWrapper) => {204 203 205 });204 });206205207 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]);278277279 // common good parachain take commission in it native token278 // common good parachain take commission in it native token279 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;281281282 }, statemineApiOptions);282 }, statemineApiOptions);292292293 // commission has not paid in USDT token293 // commission has not paid in USDT token294 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 token296 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);298299299 }, uniqueApiOptions);300 }, uniqueApiOptions);300 301 440441441 [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);445443 }, uniqueApiOptions2);446 }, uniqueApiOptions2);444447