Skip to content

Commit

Permalink
test: extending tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kupermind committed May 24, 2024
1 parent c5e020f commit 8c5efdd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/StakingIncentives.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8c5efdd

Please sign in to comment.