From 8c01ec5ca96a2210780e7a04e1a1e749715f8a48 Mon Sep 17 00:00:00 2001 From: Tarek Mohamed Abdalla Date: Thu, 14 Nov 2024 13:33:54 +0200 Subject: [PATCH] fix: fix calculation --- ...test-parameters-runtime-FeesTreasuryProportion.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/suites/dev/moonbase/test-parameters/test-parameters-runtime-FeesTreasuryProportion.ts b/test/suites/dev/moonbase/test-parameters/test-parameters-runtime-FeesTreasuryProportion.ts index 560038b68f..1e147b82c8 100644 --- a/test/suites/dev/moonbase/test-parameters/test-parameters-runtime-FeesTreasuryProportion.ts +++ b/test/suites/dev/moonbase/test-parameters/test-parameters-runtime-FeesTreasuryProportion.ts @@ -75,15 +75,17 @@ describeSuite({ const burnPercentage = burnProportion.value().toNumber() / 1e7; const calcTreasuryIncrease = (feeWithTip: bigint): bigint => { + // In rust code fees.ration(treasury_part, burn_part) + // treasury increase is being calculated this way + const issuanceDecrease = calcIssuanceDecrease(feeWithTip); + return feeWithTip - issuanceDecrease; + }; + const calcIssuanceDecrease = (feeWithTip: bigint): bigint => { const feeWithTipBN = new BN(feeWithTip.toString()); - const proportion: BN = t.proportion.value(); + const proportion: BN = burnProportion.value(); const val = feeWithTipBN.mul(proportion).div(new BN(1e9)); return BigInt(val.toString()); }; - const calcIssuanceDecrease = (feeWithTip: bigint): bigint => { - const treasuryIncrease = calcTreasuryIncrease(feeWithTip); - return feeWithTip - treasuryIncrease; - }; for (const txnType of TransactionTypes) { it({