-
Notifications
You must be signed in to change notification settings - Fork 1
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
Adds assertions to verify rewards contract balance, rewards surplus and weight #144
Conversation
98cfef1
to
07b3d82
Compare
c56b1e0
to
29af93c
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.
Left a few comments/questions
48b2eba
to
24e88be
Compare
refactor: merge all tests for scenario1 into test_scenario1 refactor: merge all tests for scenario1 into test_scenario1
…enario2 and scenario3
…kConsistencyTotalWeight
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! Just left a few last minor comments.
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.
Nice work!
2183bf3
into
feature/improvements-and-recommendations
…nd weight (#144) * Refactors scenarios * refactor: test_scenario1_dailyRewards * refactor: merge all tests for scenario1 into test_scenario1 refactor: merge all tests for scenario1 into test_scenario1 refactor: merge all tests for scenario1 into test_scenario1 * Adds checkRewardsContractBalance * refactor: removes redundant pending unlock amount test methods for scenario2 and scenario3 * refactor: moves the logic from scenario2_dailyRewards to scenario2 * refactor: moves the logic from scenario3_dailyRewards to scenario3 * add scenario4 to test surplus and reward contract balance * Reverts L2Reward * Adds more complex assertions to scenario4 regarding surplus verification * adds checkConsistencyTotalWeight * adds zero value check for amount and duration when adding rewards * added stakerClaimOnDayAndCheckConsistencyTotalWeight and removed checkConsistencyTotalWeight * test consistency of total weight and daily weights * updates scenario2 and scenario3 to check reward contract balance * refactors and adds docs * resolves compiler warnings * adds documentation to assertion functions
What was the problem?
This PR resolves issues:
How was it solved?
Added
checkRewardsContractBalance
to verify that rewards contract balance after all stakes claim rewards at a day is equal to funds - sum of dailyRewards from 1st day to yesterday.Added
verifyRewardsSurplusForLockedAmountBetweenDays
to verify reward surplus amount.Added
checkConsistencyTotalWeight
to verify that at all times totalWeight is the sum of daily weights and it is zero if all positions are expired or greater than zero if at least one position is active.Added checks to verify zero values for amount and duration for
fundStakingRewards
,addUnusedRewards
and_addRewards
.Refactored scenarios.