mirror of
https://github.com/logos-co/staking.git
synced 2025-01-24 17:39:15 +00:00
refactor(StakeVault): use custom error over error strings (#35)
This commit is contained in:
parent
6f591dd674
commit
70c74e2c2c
@ -1,16 +1,17 @@
|
||||
ExecuteAccountTest:testDeployment() (gas: 26400)
|
||||
ExecuteAccountTest:test_RevertWhen_InvalidLimitEpoch() (gas: 974502)
|
||||
ExecuteAccountTest:test_RevertWhen_InvalidLimitEpoch() (gas: 964423)
|
||||
LeaveTest:testDeployment() (gas: 26172)
|
||||
LeaveTest:test_RevertWhen_NoPendingMigration() (gas: 662520)
|
||||
LeaveTest:test_RevertWhen_NoPendingMigration() (gas: 652901)
|
||||
LeaveTest:test_RevertWhen_SenderIsNotVault() (gas: 10562)
|
||||
LockTest:testDeployment() (gas: 26400)
|
||||
LockTest:test_RevertWhen_DecreasingLockTime() (gas: 976972)
|
||||
LockTest:test_RevertWhen_DecreasingLockTime() (gas: 967353)
|
||||
LockTest:test_RevertWhen_SenderIsNotVault() (gas: 10607)
|
||||
MigrateTest:testDeployment() (gas: 26172)
|
||||
MigrateTest:test_RevertWhen_NoPendingMigration() (gas: 652740)
|
||||
MigrateTest:test_RevertWhen_SenderIsNotVault() (gas: 10629)
|
||||
StakeManagerTest:testDeployment() (gas: 26172)
|
||||
StakeTest:testDeployment() (gas: 26172)
|
||||
StakeTest:test_RevertWhen_SenderIsNotVault() (gas: 10638)
|
||||
UnstakeTest:testDeployment() (gas: 26355)
|
||||
UnstakeTest:test_RevertWhen_FundsLocked() (gas: 973435)
|
||||
UnstakeTest:test_RevertWhen_FundsLocked() (gas: 963816)
|
||||
UnstakeTest:test_RevertWhen_SenderIsNotVault() (gas: 10609)
|
@ -13,6 +13,8 @@ import { StakeManager } from "./StakeManager.sol";
|
||||
*/
|
||||
|
||||
contract StakeVault is Ownable {
|
||||
error StakeVault__MigrationNotAvailable();
|
||||
|
||||
StakeManager private stakeManager;
|
||||
ERC20 immutable stakedToken;
|
||||
|
||||
@ -50,7 +52,7 @@ contract StakeVault is Ownable {
|
||||
*/
|
||||
function updateManager() external onlyOwner {
|
||||
StakeManager migrated = stakeManager.migrate();
|
||||
require(address(migrated) != address(0), "Migration not available.");
|
||||
if (address(migrated) == address(0)) revert StakeVault__MigrationNotAvailable();
|
||||
stakeManager = migrated;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user