difftreelog
Add decimal constants
in: master
2 files changed
tests/src/xcm/xcmQuartz.test.tsdiffbeforeafterboth37const RELAY_DECIMALS = 12;37const RELAY_DECIMALS = 12;38const STATEMINE_DECIMALS = 12;38const STATEMINE_DECIMALS = 12;39const KARURA_DECIMALS = 12;39const KARURA_DECIMALS = 12;40const SHIDEN_DECIMALS = 18n;41const QTZ_DECIMALS = 18n;404241const TRANSFER_AMOUNT = 2000000000000000000000000n;43const TRANSFER_AMOUNT = 2000000000000000000000000n;4244986 let sender: IKeyringPair;988 let sender: IKeyringPair;987989988 // Quartz -> Shiden990 // Quartz -> Shiden989 const shidenInitialBalance = 1n * (10n ** 18n); // 1 SHD, existencial deposit required in order to perform XCM call991 const shidenInitialBalance = 1n * SHIDEN_DECIMALS; // 1 SHD, existential deposit required to actually create the account on Shiden990 const unitsPerSecond = 228_000_000_000n; // This is Phala's value. What will be ours?992 const unitsPerSecond = 228_000_000_000n; // This is Phala's value. What will be ours?991 const qtzToShidenTransferred = 10n * (10n ** 18n); // 10 QTZ993 const qtzToShidenTransferred = 10n * QTZ_DECIMALS; // 10 QTZ992 const qtzToShidenArrived = 9_999_999_999_088_000_000n; // 9.999 ... QTZ, Shiden takes a commision in foreign tokens994 const qtzToShidenArrived = 9_999_999_999_088_000_000n; // 9.999 ... QTZ, Shiden takes a commision in foreign tokens993 const senderIinitialBalanceQTZ = 100n * (10n ** 18n); // How many QTZ sender has initially995 const senderIinitialBalanceQTZ = 100n * QTZ_DECIMALS; // How many QTZ sender has initially994 const senderBalanceAfterXCM = 89_941967662676666465n; // 89.94... QTZ after XCM call996 const senderBalanceAfterXCM = 89_941967662676666465n; // 89.94... QTZ after XCM call995997996 // Shiden -> Quartz998 // Shiden -> Quartz997 const qtzFromShidenTransfered = 5n * (10n ** 18n); // 5 QTZ999 const qtzFromShidenTransfered = 5n * QTZ_DECIMALS; // 5 QTZ998 const qtzOnShidenLeft = qtzToShidenArrived - qtzFromShidenTransfered; // 4.999_999_999_088_000_000n QTZ1000 const qtzOnShidenLeft = qtzToShidenArrived - qtzFromShidenTransfered; // 4.999_999_999_088_000_000n QTZ99910011000 before(async () => {1002 before(async () => {tests/src/xcm/xcmUnique.test.tsdiffbeforeafterboth37const RELAY_DECIMALS = 12;37const RELAY_DECIMALS = 12;38const STATEMINT_DECIMALS = 12;38const STATEMINT_DECIMALS = 12;39const ACALA_DECIMALS = 12;39const ACALA_DECIMALS = 12;40const ASTAR_DECIMALS = 18n;41const UNQ_DECIMALS = 18n;404241const TRANSFER_AMOUNT = 2000000000000000000000000n;43const TRANSFER_AMOUNT = 2000000000000000000000000n;4244988 let randomAccount: IKeyringPair;990 let randomAccount: IKeyringPair;989991990 // Unique -> Astar992 // Unique -> Astar991 const astarInitialBalance = 1n * (10n ** 18n); // 1 ASTR. Existencial deposit required in order to perform XCM call993 const astarInitialBalance = 1n * ASTAR_DECIMALS; // 1 ASTR, existential deposit required to actually create the account on Shiden.992 const unitsPerSecond = 228_000_000_000n; // This is Phala's value. What will be ours?994 const unitsPerSecond = 228_000_000_000n; // This is Phala's value. What will be ours?993 const unqToAstarTransferred = 10n * (10n ** 18n); // 10 UNQ995 const unqToAstarTransferred = 10n * UNQ_DECIMALS; // 10 UNQ994 const unqToAstarArrived = 9_999_999_999_088_000_000n; // 9.999 ... UNQ, Shiden takes a commision in foreign tokens996 const unqToAstarArrived = 9_999_999_999_088_000_000n; // 9.999 ... UNQ, Shiden takes a commision in foreign tokens995 const senderIinitialBalanceUNQ = 100n * (10n ** 18n); // How many UNQ sender has initially997 const senderIinitialBalanceUNQ = 100n * UNQ_DECIMALS; // How many UNQ sender has initially996 const senderBalanceAfterXCM = 89_941967662676666465n; // 89.94... UNQ after XCM call998 const senderBalanceAfterXCM = 89_941967662676666465n; // 89.94... UNQ after XCM call997999998 // Astar -> Unique1000 // Astar -> Unique999 const unqFromAstarTransfered = 5n * (10n ** 18n); // 5 UNQ1001 const unqFromAstarTransfered = 5n * UNQ_DECIMALS; // 5 UNQ1000 const unqOnAstarLeft = unqToAstarArrived - unqFromAstarTransfered; // 4.999_999_999_088_000_000n UNQ1002 const unqOnAstarLeft = unqToAstarArrived - unqFromAstarTransfered; // 4.999_999_999_088_000_000n UNQ100110031002 before(async () => {1004 before(async () => {