From 8c5efdd5e586e6429dbeadf9061d0f73b87ced91 Mon Sep 17 00:00:00 2001 From: Aleksandr Kuperman Date: Fri, 24 May 2024 17:36:19 +0100 Subject: [PATCH] test: extending tests --- test/StakingIncentives.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/StakingIncentives.js b/test/StakingIncentives.js index 8db2e8e..76acce9 100644 --- a/test/StakingIncentives.js +++ b/test/StakingIncentives.js @@ -276,13 +276,26 @@ describe("StakingIncentives", async () => { // Check that the target contract got OLAS let sumBalance = ethers.BigNumber.from(0); + let sumWeights = ethers.BigNumber.from(0); let balances = new Array(numInstances).fill(0); + let totalWeights = new Array(numInstances).fill(0); for (let i = 0; i < numInstances; i++) { + const weightBN = ethers.BigNumber.from(weights[i]); + const weightBN2 = ethers.BigNumber.from(weights2[i]); + const maxWeightBN = ethers.BigNumber.from(maxWeight); + + totalWeights[i] = ((await ve.getVotes(deployer.address)).mul(weightBN). + add((await ve.getVotes(signers[1].address)).mul(weightBN2))).div(maxWeightBN); + sumWeights = sumWeights.add(totalWeights[i]); + balances[i] = await olas.balanceOf(stakingInstances[i].address); sumBalance = sumBalance.add(balances[i]); expect(balances[i]).to.gt(0); } + // The overall veOLAS power must be bigger than the inflation + expect(sumWeights).to.gt(sp.stakingIncentive); + // Since the veOLAS power is bigger than staking inflation, all the staking inflation must be used diff = sp.stakingIncentive.sub(sumBalance); expect(diff).to.lt(bnDelta);