Commit ade16503 authored by Maurelian's avatar Maurelian

test(ctb): Additional Liveness Module Testing

parent 69f3cce1
...@@ -33,6 +33,8 @@ contract LivenessModule_TestInit is Test, SafeTestTools { ...@@ -33,6 +33,8 @@ contract LivenessModule_TestInit is Test, SafeTestTools {
event SignersRecorded(bytes32 indexed txHash, address[] signers); event SignersRecorded(bytes32 indexed txHash, address[] signers);
uint256 livenessInterval = 30 days;
uint256 minOwners = 6;
LivenessModule livenessModule; LivenessModule livenessModule;
LivenessGuard livenessGuard; LivenessGuard livenessGuard;
SafeInstance safeInstance; SafeInstance safeInstance;
...@@ -82,8 +84,8 @@ contract LivenessModule_TestInit is Test, SafeTestTools { ...@@ -82,8 +84,8 @@ contract LivenessModule_TestInit is Test, SafeTestTools {
livenessModule = new LivenessModule({ livenessModule = new LivenessModule({
_safe: safeInstance.safe, _safe: safeInstance.safe,
_livenessGuard: livenessGuard, _livenessGuard: livenessGuard,
_livenessInterval: 30 days, _livenessInterval: livenessInterval,
_minOwners: 6, _minOwners: minOwners,
_fallbackOwner: fallbackOwner _fallbackOwner: fallbackOwner
}); });
safeInstance.enableModule(address(livenessModule)); safeInstance.enableModule(address(livenessModule));
...@@ -91,6 +93,20 @@ contract LivenessModule_TestInit is Test, SafeTestTools { ...@@ -91,6 +93,20 @@ contract LivenessModule_TestInit is Test, SafeTestTools {
} }
} }
contract LivenessModule_Constructor_Test is LivenessModule_TestInit {
/// @dev Tests that the constructor fails if the minOwners is greater than the number of owners
function test_constructor_minOwnersGreaterThanOwners_revert() external {
vm.expectRevert("LivenessModule: minOwners must be less than the number of owners");
new LivenessModule({
_safe: safeInstance.safe,
_livenessGuard: livenessGuard,
_livenessInterval: livenessInterval,
_minOwners: 11,
_fallbackOwner: address(0)
});
}
}
contract LivenessModule_Getters_Test is LivenessModule_TestInit { contract LivenessModule_Getters_Test is LivenessModule_TestInit {
/// @dev Tests if the getters work correctly /// @dev Tests if the getters work correctly
function test_getters_works() external { function test_getters_works() external {
......
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