fix bug in finalizePool
This commit is contained in:
parent
c36d0fdc7c
commit
c5b2991821
@ -166,12 +166,15 @@ export function validFinalizePoolAssertion(
|
||||
// Check that pool rewards have increased.
|
||||
const poolRewards = await stakingWrapper.rewardsByPoolId(poolId).callAsync();
|
||||
expect(poolRewards).to.bignumber.equal(beforeInfo.poolRewards.plus(membersReward));
|
||||
|
||||
if (membersReward.isGreaterThan(0)) {
|
||||
// Check that cumulative rewards have increased.
|
||||
const [
|
||||
mostRecentCumulativeRewards,
|
||||
cumulativeRewardsLastStored,
|
||||
] = await stakingWrapper.getMostRecentCumulativeReward(poolId).callAsync();
|
||||
expect(cumulativeRewardsLastStored).to.bignumber.equal(currentEpoch);
|
||||
|
||||
let [numerator, denominator] = ReferenceFunctions.LibFractions.add(
|
||||
beforeInfo.mostRecentCumulativeRewards.numerator,
|
||||
beforeInfo.mostRecentCumulativeRewards.denominator,
|
||||
@ -180,6 +183,7 @@ export function validFinalizePoolAssertion(
|
||||
);
|
||||
[numerator, denominator] = ReferenceFunctions.LibFractions.normalize(numerator, denominator);
|
||||
expect(mostRecentCumulativeRewards).to.deep.equal({ numerator, denominator });
|
||||
}
|
||||
|
||||
// Check that aggregated stats have been updated
|
||||
const aggregatedStats = AggregatedStats.fromArray(
|
||||
|
Loading…
x
Reference in New Issue
Block a user