From d6ab0fe6df09ac42234c8c6c48cd8530514a5be3 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Tue, 22 Nov 2022 07:55:10 +0000 Subject: [PATCH] Add comments to explain numbers --- --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -24,8 +24,8 @@ let nominal: bigint; let palletAddress: string; let accounts: IKeyringPair[]; -const LOCKING_PERIOD = 8n; // 20 blocks of relay -const UNLOCKING_PERIOD = 4n; // 10 blocks of parachain +const LOCKING_PERIOD = 8n; // 8 blocks of relay +const UNLOCKING_PERIOD = 4n; // 4 blocks of parachain describe('App promotion', () => { before(async function () { @@ -652,6 +652,7 @@ function calculateIncome(base: bigint, iter = 0, calcPeriod: bigint = UNLOCKING_PERIOD): bigint { const DAY = 7200n; const ACCURACY = 1_000_000_000n; + // 5n / 10_000n = 0.05% p/day const income = base + base * (ACCURACY * (calcPeriod * 5n) / (10_000n * DAY)) / ACCURACY ; if (iter > 1) { -- gitstuff