Commit baa0fa5b authored by Maurelian's avatar Maurelian

test(ctb): Add test for transferring to fallback owner

parent f6838067
...@@ -20,10 +20,10 @@ contract LivnessModule_TestInit is Test, SafeTestTools { ...@@ -20,10 +20,10 @@ contract LivnessModule_TestInit is Test, SafeTestTools {
LivenessGuard livenessGuard; LivenessGuard livenessGuard;
SafeInstance safeInstance; SafeInstance safeInstance;
function makeKeys(uint256 num) public pure returns (uint256[] memory) { function makeKeys(uint256 num) public pure returns (uint256[] memory keys_) {
uint256[] memory keys = new uint256[](num); keys_ = new uint256[](num);
for (uint256 i; i < num; i++) { for (uint256 i; i < num; i++) {
keys[i] = uint256(keccak256(abi.encodePacked(i))); keys_[i] = uint256(keccak256(abi.encodePacked(i)));
} }
} }
...@@ -44,8 +44,18 @@ contract LivnessModule_TestInit is Test, SafeTestTools { ...@@ -44,8 +44,18 @@ contract LivnessModule_TestInit is Test, SafeTestTools {
} }
contract LivenessModule_RemoveOwner_Test is LivnessModule_TestInit { contract LivenessModule_RemoveOwner_Test is LivnessModule_TestInit {
function test_removeOwner_succeeds() external { function test_removeOwner_oneOwner_succeeds() external {
uint256 ownersBefore = safeInstance.owners.length;
vm.warp(block.timestamp + 30 days); vm.warp(block.timestamp + 30 days);
livenessModule.removeOwner(safeInstance.owners[0]); livenessModule.removeOwner(safeInstance.owners[0]);
assertEq(safeInstance.safe.getOwners().length, ownersBefore - 1);
}
function test_removeOwner_allOwners_succeeds() external {
vm.warp(block.timestamp + 30 days);
// The safe is initialized with 10 owners, so we need to remove 3 to get below the minOwners threshold
livenessModule.removeOwner(safeInstance.owners[0]);
livenessModule.removeOwner(safeInstance.owners[1]);
livenessModule.removeOwner(safeInstance.owners[2]);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment