-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(StakeManager): initial MP should not increase when locking
When an account calls `lock()` on the `StakeManager` it ultimately called `_mintInitialMP()` which besides increasing the accounts `currentMP`, it also increases the accounts `initialMP`. This seems incorrect, as `initialMP` should only increase at first stake. Also, notice how inside `lock()` it always passes an `amount` of `0` to to `_mintInitialMP()`, so it only ever uses one code path of that function. This commit adjust `lock()` such that it no longer uses `_mintInitialMP()`. Instead it makes use of `_getMaxMPToMint` based on the lock up time delta. It also removes a test that claims that `initialMP` should increase on `lock()` and instead adds a test an a CVL rule ensure `initialMP` doesn't increase when locking.
- Loading branch information
Showing
3 changed files
with
39 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters