git.delta.rocks / unique-network / refs/commits / a865df5a2540

difftreelog

fix parse bitint to decimals

Daniel Shiposha2022-09-06parent: #1a6fe8b.patch.diff
in: master

4 files changed

modifiedtests/src/util/helpers.tsdiffbeforeafterboth
103 return api.registry.createType('AccountId', '0x' + number.toString(16).padStart(64, '0')).toJSON();103 return api.registry.createType('AccountId', '0x' + number.toString(16).padStart(64, '0')).toJSON();
104}104}
105
106export function bigIntToDecimals(number: bigint, decimals = 18): string {
107 let numberStr = number.toString();
108 console.log('[0] str = ', numberStr);
109
110 // Get rid of `n` at the end
111 numberStr = numberStr.substring(0, numberStr.length - 1);
112 console.log('[1] str = ', numberStr);
113
114 const dotPos = numberStr.length - decimals;
115 if (dotPos <= 0) {
116 return '0.' + numberStr;
117 } else {
118 const intPart = numberStr.substring(0, dotPos);
119 const fractPart = numberStr.substring(dotPos);
120 return intPart + '.' + fractPart;
121 }
122}
105123
106export function normalizeAccountId(input: string | AccountId | CrossAccountId | IKeyringPair): CrossAccountId {124export function normalizeAccountId(input: string | AccountId | CrossAccountId | IKeyringPair): CrossAccountId {
107 if (typeof input === 'string') {125 if (typeof input === 'string') {
modifiedtests/src/xcm/xcmOpal.test.tsdiffbeforeafterboth
21import {ApiOptions} from '@polkadot/api/types';21import {ApiOptions} from '@polkadot/api/types';
22import {IKeyringPair} from '@polkadot/types/types';22import {IKeyringPair} from '@polkadot/types/types';
23import usingApi, {submitTransactionAsync} from './../substrate/substrate-api';23import usingApi, {submitTransactionAsync} from './../substrate/substrate-api';
24import {getGenericResult, paraSiblingSovereignAccount} from './../util/helpers';24import {bigIntToDecimals, getGenericResult, paraSiblingSovereignAccount} from './../util/helpers';
25import waitNewBlocks from './../substrate/wait-new-blocks';25import waitNewBlocks from './../substrate/wait-new-blocks';
26import {normalizeAccountId} from './../util/helpers';26import {normalizeAccountId} from './../util/helpers';
27import getBalance from './../substrate/get-balance';27import getBalance from './../substrate/get-balance';
43const ASSET_METADATA_DESCRIPTION = 'USDT';43const ASSET_METADATA_DESCRIPTION = 'USDT';
44const ASSET_METADATA_MINIMAL_BALANCE = 1;44const ASSET_METADATA_MINIMAL_BALANCE = 1;
45
46const WESTMINT_DECIMALS = 12;
4547
46const TRANSFER_AMOUNT = 1_000_000_000_000_000_000n;48const TRANSFER_AMOUNT = 1_000_000_000_000_000_000n;
4749
283 // common good parachain take commission in it native token285 // common good parachain take commission in it native token
284 console.log('Opal to Westmint transaction fees on Westmint: %s WND', balanceStmnBefore - balanceStmnAfter);286 console.log(
287 'Opal to Westmint transaction fees on Westmint: %s WND',
288 bigIntToDecimals(balanceStmnBefore - balanceStmnAfter, WESTMINT_DECIMALS),
289 );
285 expect(balanceStmnBefore > balanceStmnAfter).to.be.true;290 expect(balanceStmnBefore > balanceStmnAfter).to.be.true;
286291
299 expect(free == TRANSFER_AMOUNT).to.be.true;304 expect(free == TRANSFER_AMOUNT).to.be.true;
300 console.log('Opal to Westmint transaction fees on Opal: %s USDT', TRANSFER_AMOUNT - free);305 console.log(
306 'Opal to Westmint transaction fees on Opal: %s USDT',
307 bigIntToDecimals(TRANSFER_AMOUNT - free),
308 );
301 // ... and parachain native token309 // ... and parachain native token
302 expect(balanceOpalAfter == balanceOpalBefore).to.be.true;310 expect(balanceOpalAfter == balanceOpalBefore).to.be.true;
303 console.log('Opal to Westmint transaction fees on Opal: %s WND', balanceOpalAfter - balanceOpalBefore);311 console.log(
312 'Opal to Westmint transaction fees on Opal: %s WND',
313 bigIntToDecimals(balanceOpalAfter - balanceOpalBefore, WESTMINT_DECIMALS),
314 );
304315
305 }, uniqueApiOptions);316 }, uniqueApiOptions);
453 const wndFee = balanceBobRelayTokenAfter - TRANSFER_AMOUNT_RELAY - balanceBobRelayTokenBefore; 464 const wndFee = balanceBobRelayTokenAfter - TRANSFER_AMOUNT_RELAY - balanceBobRelayTokenBefore;
454 console.log('Relay (Westend) to Opal transaction fees: %s OPL', balanceBobAfter - balanceBobBefore);465 console.log(
466 'Relay (Westend) to Opal transaction fees: %s OPL',
467 bigIntToDecimals(balanceBobAfter - balanceBobBefore),
468 );
455 console.log('Relay (Westend) to Opal transaction fees: %s WND', wndFee);469 console.log(
470 'Relay (Westend) to Opal transaction fees: %s WND',
471 bigIntToDecimals(wndFee, WESTMINT_DECIMALS),
472 );
456 expect(balanceBobBefore == balanceBobAfter).to.be.true;473 expect(balanceBobBefore == balanceBobAfter).to.be.true;
457 expect(balanceBobRelayTokenBefore < balanceBobRelayTokenAfter).to.be.true;474 expect(balanceBobRelayTokenBefore < balanceBobRelayTokenAfter).to.be.true;
modifiedtests/src/xcm/xcmQuartz.test.tsdiffbeforeafterboth
21import {ApiOptions} from '@polkadot/api/types';21import {ApiOptions} from '@polkadot/api/types';
22import {IKeyringPair} from '@polkadot/types/types';22import {IKeyringPair} from '@polkadot/types/types';
23import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';23import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
24import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm} from '../util/helpers';24import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm, bigIntToDecimals} from '../util/helpers';
25import {MultiLocation} from '@polkadot/types/interfaces';25import {MultiLocation} from '@polkadot/types/interfaces';
26import {blake2AsHex} from '@polkadot/util-crypto';26import {blake2AsHex} from '@polkadot/util-crypto';
27import waitNewBlocks from '../substrate/wait-new-blocks';27import waitNewBlocks from '../substrate/wait-new-blocks';
37const KARURA_PORT = 9946;37const KARURA_PORT = 9946;
38const MOONRIVER_PORT = 9947;38const MOONRIVER_PORT = 9947;
3939
40const KARURA_DECIMALS = 12;
41
40const TRANSFER_AMOUNT = 2000000000000000000000000n;42const TRANSFER_AMOUNT = 2000000000000000000000000n;
4143
42function parachainApiOptions(port: number): ApiOptions {44function parachainApiOptions(port: number): ApiOptions {
182 [balanceQuartzTokenMiddle] = await getBalance(api, [randomAccount.address]);184 [balanceQuartzTokenMiddle] = await getBalance(api, [randomAccount.address]);
183 185
184 const qtzFees = balanceQuartzTokenInit - balanceQuartzTokenMiddle - TRANSFER_AMOUNT;186 const qtzFees = balanceQuartzTokenInit - balanceQuartzTokenMiddle - TRANSFER_AMOUNT;
185 console.log('[Quartz -> Karura] transaction fees on Quartz: %s QTZ', qtzFees);187 console.log('[Quartz -> Karura] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees));
186 expect(qtzFees > 0n).to.be.true;188 expect(qtzFees > 0n).to.be.true;
187 });189 });
188 190
198 const karFees = balanceKaruraTokenInit - balanceKaruraTokenMiddle;200 const karFees = balanceKaruraTokenInit - balanceKaruraTokenMiddle;
199 const qtzIncomeTransfer = balanceQuartzForeignTokenMiddle - balanceQuartzForeignTokenInit;201 const qtzIncomeTransfer = balanceQuartzForeignTokenMiddle - balanceQuartzForeignTokenInit;
200202
201 console.log('[Quartz -> Karura] transaction fees on Karura: %s KAR', karFees);203 console.log('
204 [Quartz -> Karura] transaction fees on Karura: %s KAR',
205 bigIntToDecimals(karFees, KARURA_DECIMALS),
206 );
202 console.log('[Quartz -> Karura] income %s QTZ', qtzIncomeTransfer);207 console.log('[Quartz -> Karura] income %s QTZ', bigIntToDecimals(qtzIncomeTransfer));
203 expect(karFees == 0n).to.be.true;208 expect(karFees == 0n).to.be.true;
204 expect(qtzIncomeTransfer == TRANSFER_AMOUNT).to.be.true;209 expect(qtzIncomeTransfer == TRANSFER_AMOUNT).to.be.true;
205 },210 },
249 const karFees = balanceKaruraTokenMiddle - balanceKaruraTokenFinal;254 const karFees = balanceKaruraTokenMiddle - balanceKaruraTokenFinal;
250 const qtzOutcomeTransfer = balanceQuartzForeignTokenMiddle - balanceQuartzForeignTokenFinal;255 const qtzOutcomeTransfer = balanceQuartzForeignTokenMiddle - balanceQuartzForeignTokenFinal;
251256
252 console.log('[Karura -> Quartz] transaction fees on Karura: %s KAR', karFees);257 console.log(
258 '[Karura -> Quartz] transaction fees on Karura: %s KAR',
259 bigIntToDecimals(karFees, KARURA_DECIMALS),
260 );
253 console.log('[Karura -> Quartz] outcome %s QTZ', qtzOutcomeTransfer);261 console.log('[Karura -> Quartz] outcome %s QTZ', bigIntToDecimals(qtzOutcomeTransfer));
254262
255 expect(karFees > 0).to.be.true;263 expect(karFees > 0).to.be.true;
256 expect(qtzOutcomeTransfer == TRANSFER_AMOUNT).to.be.true;264 expect(qtzOutcomeTransfer == TRANSFER_AMOUNT).to.be.true;
266 const actuallyDelivered = balanceQuartzTokenFinal - balanceQuartzTokenMiddle;274 const actuallyDelivered = balanceQuartzTokenFinal - balanceQuartzTokenMiddle;
267 expect(actuallyDelivered > 0).to.be.true;275 expect(actuallyDelivered > 0).to.be.true;
268276
269 console.log('[Karura -> Quartz] actually delivered %s QTZ', actuallyDelivered);277 console.log('[Karura -> Quartz] actually delivered %s QTZ', bigIntToDecimals(actuallyDelivered));
270 278
271 const qtzFees = TRANSFER_AMOUNT - actuallyDelivered;279 const qtzFees = TRANSFER_AMOUNT - actuallyDelivered;
272 console.log('[Karura -> Quartz] transaction fees on Quartz: %s QTZ', qtzFees);280 console.log('[Karura -> Quartz] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees));
273 expect(qtzFees == 0n).to.be.true;281 expect(qtzFees == 0n).to.be.true;
274 });282 });
275 });283 });
581 expect(balanceQuartzTokenMiddle < balanceQuartzTokenInit).to.be.true;589 expect(balanceQuartzTokenMiddle < balanceQuartzTokenInit).to.be.true;
582590
583 const transactionFees = balanceQuartzTokenInit - balanceQuartzTokenMiddle - TRANSFER_AMOUNT;591 const transactionFees = balanceQuartzTokenInit - balanceQuartzTokenMiddle - TRANSFER_AMOUNT;
584 console.log('[Quartz -> Moonriver] transaction fees on Quartz: %s QTZ', transactionFees);592 console.log('[Quartz -> Moonriver] transaction fees on Quartz: %s QTZ', bigIntToDecimals(transactionFees));
585 expect(transactionFees > 0).to.be.true;593 expect(transactionFees > 0).to.be.true;
586 });594 });
587595
592 [balanceMovrTokenMiddle] = await getBalance(api, [randomAccountMoonriver.address]);600 [balanceMovrTokenMiddle] = await getBalance(api, [randomAccountMoonriver.address]);
593601
594 const movrFees = balanceMovrTokenInit - balanceMovrTokenMiddle;602 const movrFees = balanceMovrTokenInit - balanceMovrTokenMiddle;
595 console.log('[Quartz -> Moonriver] transaction fees on Moonriver: %s MOVR', movrFees);603 console.log('[Quartz -> Moonriver] transaction fees on Moonriver: %s MOVR',bigIntToDecimals(movrFees));
596 expect(movrFees == 0n).to.be.true;604 expect(movrFees == 0n).to.be.true;
597605
598 const qtzRandomAccountAsset = (606 const qtzRandomAccountAsset = (
601609
602 balanceForeignQtzTokenMiddle = BigInt(qtzRandomAccountAsset['balance']);610 balanceForeignQtzTokenMiddle = BigInt(qtzRandomAccountAsset['balance']);
603 const qtzIncomeTransfer = balanceForeignQtzTokenMiddle - balanceForeignQtzTokenInit;611 const qtzIncomeTransfer = balanceForeignQtzTokenMiddle - balanceForeignQtzTokenInit;
604 console.log('[Quartz -> Moonriver] income %s QTZ', qtzIncomeTransfer);612 console.log('[Quartz -> Moonriver] income %s QTZ', bigIntToDecimals(qtzIncomeTransfer));
605 expect(qtzIncomeTransfer == TRANSFER_AMOUNT).to.be.true;613 expect(qtzIncomeTransfer == TRANSFER_AMOUNT).to.be.true;
606 },614 },
607 moonriverOptions(),615 moonriverOptions(),
647 [balanceMovrTokenFinal] = await getBalance(api, [randomAccountMoonriver.address]);655 [balanceMovrTokenFinal] = await getBalance(api, [randomAccountMoonriver.address]);
648656
649 const movrFees = balanceMovrTokenMiddle - balanceMovrTokenFinal;657 const movrFees = balanceMovrTokenMiddle - balanceMovrTokenFinal;
650 console.log('[Moonriver -> Quartz] transaction fees on Moonriver: %s MOVR', movrFees);658 console.log('[Moonriver -> Quartz] transaction fees on Moonriver: %s MOVR', bigIntToDecimals(movrFees));
651 expect(movrFees > 0).to.be.true;659 expect(movrFees > 0).to.be.true;
652660
653 const qtzRandomAccountAsset = (661 const qtzRandomAccountAsset = (
659 balanceForeignQtzTokenFinal = 0n;667 balanceForeignQtzTokenFinal = 0n;
660668
661 const qtzOutcomeTransfer = balanceForeignQtzTokenMiddle - balanceForeignQtzTokenFinal;669 const qtzOutcomeTransfer = balanceForeignQtzTokenMiddle - balanceForeignQtzTokenFinal;
662 console.log('[Quartz -> Moonriver] outcome %s QTZ', qtzOutcomeTransfer);670 console.log('[Quartz -> Moonriver] outcome %s QTZ', bigIntToDecimals(qtzOutcomeTransfer));
663 expect(qtzOutcomeTransfer == TRANSFER_AMOUNT).to.be.true;671 expect(qtzOutcomeTransfer == TRANSFER_AMOUNT).to.be.true;
664 },672 },
665 moonriverOptions(),673 moonriverOptions(),
672 const actuallyDelivered = balanceQuartzTokenFinal - balanceQuartzTokenMiddle;680 const actuallyDelivered = balanceQuartzTokenFinal - balanceQuartzTokenMiddle;
673 expect(actuallyDelivered > 0).to.be.true;681 expect(actuallyDelivered > 0).to.be.true;
674682
675 console.log('[Moonriver -> Quartz] actually delivered %s QTZ', actuallyDelivered);683 console.log('[Moonriver -> Quartz] actually delivered %s QTZ', bigIntToDecimals(actuallyDelivered));
676684
677 const qtzFees = TRANSFER_AMOUNT - actuallyDelivered;685 const qtzFees = TRANSFER_AMOUNT - actuallyDelivered;
678 console.log('[Moonriver -> Quartz] transaction fees on Quartz: %s QTZ', qtzFees);686 console.log('[Moonriver -> Quartz] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees));
679 expect(qtzFees == 0n).to.be.true;687 expect(qtzFees == 0n).to.be.true;
680 });688 });
681 });689 });
modifiedtests/src/xcm/xcmUnique.test.tsdiffbeforeafterboth
21import {ApiOptions} from '@polkadot/api/types';21import {ApiOptions} from '@polkadot/api/types';
22import {IKeyringPair} from '@polkadot/types/types';22import {IKeyringPair} from '@polkadot/types/types';
23import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';23import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
24import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm} from '../util/helpers';24import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm, bigIntToDecimals} from '../util/helpers';
25import {MultiLocation} from '@polkadot/types/interfaces';25import {MultiLocation} from '@polkadot/types/interfaces';
26import {blake2AsHex} from '@polkadot/util-crypto';26import {blake2AsHex} from '@polkadot/util-crypto';
27import waitNewBlocks from '../substrate/wait-new-blocks';27import waitNewBlocks from '../substrate/wait-new-blocks';
37const ACALA_PORT = 9946;37const ACALA_PORT = 9946;
38const MOONBEAM_PORT = 9947;38const MOONBEAM_PORT = 9947;
39
40const ACALA_DECIMALS = 12;
3941
40const TRANSFER_AMOUNT = 2000000000000000000000000n;42const TRANSFER_AMOUNT = 2000000000000000000000000n;
4143
182 [balanceUniqueTokenMiddle] = await getBalance(api, [randomAccount.address]);184 [balanceUniqueTokenMiddle] = await getBalance(api, [randomAccount.address]);
183 185
184 const unqFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle - TRANSFER_AMOUNT;186 const unqFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle - TRANSFER_AMOUNT;
185 console.log('[Unique -> Acala] transaction fees on Unique: %s UNQ', unqFees);187 console.log('[Unique -> Acala] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees));
186 expect(unqFees > 0n).to.be.true;188 expect(unqFees > 0n).to.be.true;
187 });189 });
188 190
200202
201 console.log('[Unique -> Acala] transaction fees on Acala: %s ACA', acaFees);203 console.log(
204 '[Unique -> Acala] transaction fees on Acala: %s ACA',
205 bigIntToDecimals(acaFees, ACALA_DECIMALS),
206 );
202 console.log('[Unique -> Acala] income %s UNQ', unqIncomeTransfer);207 console.log('[Unique -> Acala] income %s UNQ', bigIntToDecimals(unqIncomeTransfer));
203 expect(acaFees == 0n).to.be.true;208 expect(acaFees == 0n).to.be.true;
204 expect(unqIncomeTransfer == TRANSFER_AMOUNT).to.be.true;209 expect(unqIncomeTransfer == TRANSFER_AMOUNT).to.be.true;
205 },210 },
251256
252 console.log('[Acala -> Unique] transaction fees on Acala: %s ACA', acaFees);257 console.log(
258 '[Acala -> Unique] transaction fees on Acala: %s ACA',
259 bigIntToDecimals(acaFees, ACALA_DECIMALS),
260 );
253 console.log('[Acala -> Unique] outcome %s UNQ', unqOutcomeTransfer);261 console.log('[Acala -> Unique] outcome %s UNQ', bigIntToDecimals(unqOutcomeTransfer));
254262
255 expect(acaFees > 0).to.be.true;263 expect(acaFees > 0).to.be.true;
256 expect(unqOutcomeTransfer == TRANSFER_AMOUNT).to.be.true;264 expect(unqOutcomeTransfer == TRANSFER_AMOUNT).to.be.true;
266 const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenMiddle;274 const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenMiddle;
267 expect(actuallyDelivered > 0).to.be.true;275 expect(actuallyDelivered > 0).to.be.true;
268276
269 console.log('[Acala -> Unique] actually delivered %s UNQ', actuallyDelivered);277 console.log('[Acala -> Unique] actually delivered %s UNQ', bigIntToDecimals(actuallyDelivered));
270 278
271 const unqFees = TRANSFER_AMOUNT - actuallyDelivered;279 const unqFees = TRANSFER_AMOUNT - actuallyDelivered;
272 console.log('[Acala -> Unique] transaction fees on Unique: %s UNQ', unqFees);280 console.log('[Acala -> Unique] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees));
273 expect(unqFees == 0n).to.be.true;281 expect(unqFees == 0n).to.be.true;
274 });282 });
275 });283 });
581 expect(balanceUniqueTokenMiddle < balanceUniqueTokenInit).to.be.true;589 expect(balanceUniqueTokenMiddle < balanceUniqueTokenInit).to.be.true;
582590
583 const transactionFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle - TRANSFER_AMOUNT;591 const transactionFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle - TRANSFER_AMOUNT;
584 console.log('[Unique -> Moonbeam] transaction fees on Unique: %s UNQ', transactionFees);592 console.log('[Unique -> Moonbeam] transaction fees on Unique: %s UNQ', bigIntToDecimals(transactionFees));
585 expect(transactionFees > 0).to.be.true;593 expect(transactionFees > 0).to.be.true;
586 });594 });
587595
592 [balanceGlmrTokenMiddle] = await getBalance(api, [randomAccountMoonbeam.address]);600 [balanceGlmrTokenMiddle] = await getBalance(api, [randomAccountMoonbeam.address]);
593601
594 const glmrFees = balanceGlmrTokenInit - balanceGlmrTokenMiddle;602 const glmrFees = balanceGlmrTokenInit - balanceGlmrTokenMiddle;
595 console.log('[Unique -> Moonbeam] transaction fees on Moonbeam: %s GLMR', glmrFees);603 console.log('[Unique -> Moonbeam] transaction fees on Moonbeam: %s GLMR', bigIntToDecimals(glmrFees));
596 expect(glmrFees == 0n).to.be.true;604 expect(glmrFees == 0n).to.be.true;
597605
598 const unqRandomAccountAsset = (606 const unqRandomAccountAsset = (
601609
602 balanceForeignUnqTokenMiddle = BigInt(unqRandomAccountAsset['balance']);610 balanceForeignUnqTokenMiddle = BigInt(unqRandomAccountAsset['balance']);
603 const unqIncomeTransfer = balanceForeignUnqTokenMiddle - balanceForeignUnqTokenInit;611 const unqIncomeTransfer = balanceForeignUnqTokenMiddle - balanceForeignUnqTokenInit;
604 console.log('[Unique -> Moonbeam] income %s UNQ', unqIncomeTransfer);612 console.log('[Unique -> Moonbeam] income %s UNQ', bigIntToDecimals(unqIncomeTransfer));
605 expect(unqIncomeTransfer == TRANSFER_AMOUNT).to.be.true;613 expect(unqIncomeTransfer == TRANSFER_AMOUNT).to.be.true;
606 },614 },
607 moonbeamOptions(),615 moonbeamOptions(),
647 [balanceGlmrTokenFinal] = await getBalance(api, [randomAccountMoonbeam.address]);655 [balanceGlmrTokenFinal] = await getBalance(api, [randomAccountMoonbeam.address]);
648656
649 const glmrFees = balanceGlmrTokenMiddle - balanceGlmrTokenFinal;657 const glmrFees = balanceGlmrTokenMiddle - balanceGlmrTokenFinal;
650 console.log('[Moonbeam -> Unique] transaction fees on Moonbeam: %s GLMR', glmrFees);658 console.log('[Moonbeam -> Unique] transaction fees on Moonbeam: %s GLMR', bigIntToDecimals(glmrFees));
651 expect(glmrFees > 0).to.be.true;659 expect(glmrFees > 0).to.be.true;
652660
653 const unqRandomAccountAsset = (661 const unqRandomAccountAsset = (
659 balanceForeignUnqTokenFinal = 0n;667 balanceForeignUnqTokenFinal = 0n;
660668
661 const unqOutcomeTransfer = balanceForeignUnqTokenMiddle - balanceForeignUnqTokenFinal;669 const unqOutcomeTransfer = balanceForeignUnqTokenMiddle - balanceForeignUnqTokenFinal;
662 console.log('[Unique -> Moonbeam] outcome %s UNQ', unqOutcomeTransfer);670 console.log('[Unique -> Moonbeam] outcome %s UNQ', bigIntToDecimals(unqOutcomeTransfer));
663 expect(unqOutcomeTransfer == TRANSFER_AMOUNT).to.be.true;671 expect(unqOutcomeTransfer == TRANSFER_AMOUNT).to.be.true;
664 },672 },
665 moonbeamOptions(),673 moonbeamOptions(),
672 const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenMiddle;680 const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenMiddle;
673 expect(actuallyDelivered > 0).to.be.true;681 expect(actuallyDelivered > 0).to.be.true;
674682
675 console.log('[Moonbeam -> Unique] actually delivered %s UNQ', actuallyDelivered);683 console.log('[Moonbeam -> Unique] actually delivered %s UNQ', bigIntToDecimals(actuallyDelivered));
676684
677 const unqFees = TRANSFER_AMOUNT - actuallyDelivered;685 const unqFees = TRANSFER_AMOUNT - actuallyDelivered;
678 console.log('[Moonbeam -> Unique] transaction fees on Unique: %s UNQ', unqFees);686 console.log('[Moonbeam -> Unique] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees));
679 expect(unqFees == 0n).to.be.true;687 expect(unqFees == 0n).to.be.true;
680 });688 });
681 });689 });