-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: initial structure for covering all key scenarios #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
if (!_isModuleEnabled()) revert ModuleNotEnabled(); | ||
|
||
(, uint256 unlockable,,) = AURA_LOCKER.lockedBalances(address(SAFE)); | ||
if (unlockable == 0) revert NothingToLock(block.timestamp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im guessing formally reverting it will prevent chainlink from making the actual call, and thus saving gas?
|
||
/// @dev The Gnosis Safe version 1.1.1 does not expose directly `isModuleEnabled` method, so we need a workaround | ||
function _isModuleEnabled() internal view returns (bool) { | ||
address[] memory modules = SAFE.getModules(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getModules()
is limited to the first ten modules in the list, but i think that should be fine for now
} | ||
|
||
function test_revertWhen_NothingToUnlock() public {} | ||
function testPerformUpkeep_revertWhen_NothingToLock() public { | ||
// force a `performUpkeep` when weeks did not go by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"when not enough weeks went by"?
No description provided.