-
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): add checks for whether lockup period is in range (#39
) This commit introduces `MIN_LOCKUP_PERIOD` and `MAX_LOCKUP_PERIOD` and makes use of them within `StakeManager.stake()` and `StakeManager.lock()` accordingly. When users deposit tokens into their vault via `stake()`, they can provide an optional lockup time. If the value is `0` it implies users do not want to lock their stake. If the value is `> 0` it has to be within the range of `MIN_LOCKUP_PERIOD` and `MAX_LOCKUP_PERIOD`. Properly addresses #15
- Loading branch information
Showing
3 changed files
with
66 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
CreateVaultTest:testDeployment() (gas: 9774) | ||
CreateVaultTest:test_createVault() (gas: 650992) | ||
ExecuteAccountTest:testDeployment() (gas: 26400) | ||
ExecuteAccountTest:test_RevertWhen_InvalidLimitEpoch() (gas: 991602) | ||
LeaveTest:testDeployment() (gas: 26172) | ||
LeaveTest:test_RevertWhen_NoPendingMigration() (gas: 678051) | ||
LeaveTest:test_RevertWhen_SenderIsNotVault() (gas: 10562) | ||
LockTest:testDeployment() (gas: 26400) | ||
LockTest:test_RevertWhen_DecreasingLockTime() (gas: 994528) | ||
LockTest:test_RevertWhen_SenderIsNotVault() (gas: 10607) | ||
MigrateTest:testDeployment() (gas: 26172) | ||
MigrateTest:test_RevertWhen_NoPendingMigration() (gas: 677890) | ||
CreateVaultTest:test_createVault() (gas: 650970) | ||
ExecuteAccountTest:testDeployment() (gas: 26421) | ||
ExecuteAccountTest:test_RevertWhen_InvalidLimitEpoch() (gas: 992511) | ||
LeaveTest:testDeployment() (gas: 26193) | ||
LeaveTest:test_RevertWhen_NoPendingMigration() (gas: 678007) | ||
LeaveTest:test_RevertWhen_SenderIsNotVault() (gas: 10540) | ||
LockTest:testDeployment() (gas: 26421) | ||
LockTest:test_RevertWhen_DecreasingLockTime() (gas: 995651) | ||
LockTest:test_RevertWhen_InvalidLockupPeriod() (gas: 815891) | ||
LockTest:test_RevertWhen_SenderIsNotVault() (gas: 10652) | ||
MigrateTest:testDeployment() (gas: 26193) | ||
MigrateTest:test_RevertWhen_NoPendingMigration() (gas: 677868) | ||
MigrateTest:test_RevertWhen_SenderIsNotVault() (gas: 10629) | ||
SetStakeManagerTest:testDeployment() (gas: 9774) | ||
SetStakeManagerTest:test_RevertWhen_InvalidStakeManagerAddress() (gas: 20481) | ||
SetStakeManagerTest:test_SetStakeManager() (gas: 19869) | ||
StakeManagerTest:testDeployment() (gas: 26172) | ||
StakeTest:testDeployment() (gas: 26172) | ||
StakeTest:test_RevertWhen_SenderIsNotVault() (gas: 10638) | ||
StakeManagerTest:testDeployment() (gas: 26193) | ||
StakeTest:testDeployment() (gas: 26421) | ||
StakeTest:test_RevertWhen_InvalidLockupPeriod() (gas: 827181) | ||
StakeTest:test_RevertWhen_SenderIsNotVault() (gas: 10672) | ||
StakedTokenTest:testStakeToken() (gas: 7638) | ||
UnstakeTest:testDeployment() (gas: 26355) | ||
UnstakeTest:test_RevertWhen_FundsLocked() (gas: 990991) | ||
UnstakeTest:testDeployment() (gas: 26376) | ||
UnstakeTest:test_RevertWhen_FundsLocked() (gas: 991901) | ||
UnstakeTest:test_RevertWhen_SenderIsNotVault() (gas: 10609) | ||
VaultFactoryTest:testDeployment() (gas: 9774) |
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