Skip to content
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

Merged
merged 9 commits into from
Aug 28, 2024

Conversation

petrovska-petro
Copy link
Collaborator

No description provided.

@petrovska-petro petrovska-petro marked this pull request as ready for review August 21, 2024 14:29
Copy link
Contributor

@gosuto-inzasheru gosuto-inzasheru left a 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);
Copy link
Contributor

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();
Copy link
Contributor

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
Copy link
Contributor

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"?

@petrovska-petro petrovska-petro merged commit c536cb7 into main Aug 28, 2024
1 check passed
@petrovska-petro petrovska-petro deleted the feat/tests branch August 28, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants