-
Notifications
You must be signed in to change notification settings - Fork 66
Test: Add stakingPool processExpiration unit tests #538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test: Add stakingPool processExpiration unit tests #538
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR missed a bug caught by @kyledewy in his pricing tests. The bucket expirations has a tranche id misalignment that led to an underflow when attempting to expire the allocations from the wrong tranche.
The test that caught it is here:
The bugfix is on #546.
Please include some tests for that edge case.
const bucketStartTime = firstActiveBucketId.mul(BUCKET_DURATION); | ||
const elapsed = bucketStartTime.sub(lastAccNxmUpdateBefore); | ||
|
||
expect(expiredBucketRewards).to.gt(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have an exact value here for expiredBucketRewards
?
strengthen the assertion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed here e587527
e587527
to
dcbe77c
Compare
dcbe77c
to
3e288c7
Compare
@shark0der It seems that the mentioned bug is related to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
328d5a5
to
94749cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall! Minor changes requested.
After requesting changes I've added this comment. |
6047d7b
to
a7dafea
Compare
a7dafea
to
f942c63
Compare
Context
Closes #524
Changes proposed in this pull request
Adds new unit tests for
processExpiration
. Followed the list of test cases from the issueTest plan
New tests were added in
test/unit/StakingPool/processExpirations.js
Checklist
Review
When reviewing a PR, please indicate intention in comments using the following emojis: