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.tsdiffbeforeafterboth--- a/tests/src/xcm/xcmUnique.test.ts
+++ b/tests/src/xcm/xcmUnique.test.ts
@@ -37,6 +37,8 @@
const RELAY_DECIMALS = 12;
const STATEMINT_DECIMALS = 12;
const ACALA_DECIMALS = 12;
+const ASTAR_DECIMALS = 18n;
+const UNQ_DECIMALS = 18n;
const TRANSFER_AMOUNT = 2000000000000000000000000n;
@@ -988,15 +990,15 @@
let randomAccount: IKeyringPair;
// Unique -> Astar
- const astarInitialBalance = 1n * (10n ** 18n); // 1 ASTR. Existencial deposit required in order to perform XCM call
+ const astarInitialBalance = 1n * ASTAR_DECIMALS; // 1 ASTR, existential deposit required to actually create the account on Shiden.
const unitsPerSecond = 228_000_000_000n; // This is Phala's value. What will be ours?
- const unqToAstarTransferred = 10n * (10n ** 18n); // 10 UNQ
+ const unqToAstarTransferred = 10n * UNQ_DECIMALS; // 10 UNQ
const unqToAstarArrived = 9_999_999_999_088_000_000n; // 9.999 ... UNQ, Shiden takes a commision in foreign tokens
- const senderIinitialBalanceUNQ = 100n * (10n ** 18n); // How many UNQ sender has initially
+ const senderIinitialBalanceUNQ = 100n * UNQ_DECIMALS; // How many UNQ sender has initially
const senderBalanceAfterXCM = 89_941967662676666465n; // 89.94... UNQ after XCM call
// Astar -> Unique
- const unqFromAstarTransfered = 5n * (10n ** 18n); // 5 UNQ
+ const unqFromAstarTransfered = 5n * UNQ_DECIMALS; // 5 UNQ
const unqOnAstarLeft = unqToAstarArrived - unqFromAstarTransfered; // 4.999_999_999_088_000_000n UNQ
before(async () => {