mirror of
https://github.com/logos-co/staking.git
synced 2025-01-25 18:09:39 +00:00
fix(StakeManager.spec): make epochOnlyIncreases
rule pass
This was failing due to `migrationInitialize()` allowing for resetting or decreasing a `StakeManager`s `currentEpoch`. In practice, however, this is not possible because a new manager can only be called from an old manager and the old manager can only migrate once. So if `migrationInitialize()` is called from an old manager, we can safely assume it's the first time this is called, meaning the new manager's `currentEpoch` must be `0` at this point in time.
This commit is contained in:
parent
50c8a11d5d
commit
9bfcb0710e
@ -119,7 +119,9 @@ rule revertsWhenNoMigration(method f) {
|
||||
// assert before == staked.balanceOf(user);
|
||||
// }
|
||||
|
||||
rule epochOnlyIncreases {
|
||||
rule epochOnlyIncreases(method f) filtered {
|
||||
f -> f.selector != sig:migrationInitialize(uint256,uint256,uint256,uint256).selector;
|
||||
} {
|
||||
method f;
|
||||
env e;
|
||||
calldataarg args;
|
||||
|
Loading…
x
Reference in New Issue
Block a user