difftreelog
test adjust inflation to purposefully broken state
in: master
1 file changed
js-packages/tests/inflation.seqtest.tsdiffbeforeafterboth58 expect(Math.abs(Number(expectedInflation))).to.be.lessThanOrEqual(tolerance);58 expect(Math.abs(Number(expectedInflation))).to.be.lessThanOrEqual(tolerance);59 });59 });606061 // (1) - inflation is broken on purpose, see relevant changes in pallet_inflation config61 itSub('Inflation happens after inflation block interval', async ({helper}) => {62 itSub('Inflation happens after inflation block interval', async ({helper}) => {62 const api = helper.getApi();63 const api = helper.getApi();63 const blockInterval = await api.consts.inflation.inflationBlockInterval.toNumber();64 const blockInterval = api.consts.inflation.inflationBlockInterval.toNumber();646565 const relayBlock = (await api.query.parachainSystem.lastRelayChainBlockNumber()).toNumber();66 const relayBlock = 0; //(1) (await api.query.parachainSystem.lastRelayChainBlockNumber()).toNumber();66 const blockInflation = (await helper.callRpc('api.query.inflation.blockInflation', []) as any).toBigInt();67 //(1) const blockInflation = (await helper.callRpc('api.query.inflation.blockInflation', []) as any).toBigInt();67 const startBlock = (relayBlock + blockInterval) - (relayBlock % blockInterval) + 1;68 const startBlock = (relayBlock + blockInterval) - (relayBlock % blockInterval) + 1;686969 await helper.wait.forRelayBlockNumber(startBlock);70 await helper.wait.forRelayBlockNumber(startBlock);73 await helper.wait.forRelayBlockNumber(startBlock + blockInterval + 1);74 await helper.wait.forRelayBlockNumber(startBlock + blockInterval + 1);747575 const treasuryBalanceAfter = await helper.balance.getSubstrate(TREASURY);76 const treasuryBalanceAfter = await helper.balance.getSubstrate(TREASURY);76 expect(Number(treasuryBalanceAfter)).to.be.eqls(Number(treasuryBalanceBefore + blockInflation));77 expect(Number(treasuryBalanceAfter)).to.be.equal(Number(treasuryBalanceBefore)); //(1) .eqls(Number(treasuryBalanceBefore + blockInflation));77 });78 });78});79});7980