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 SafeCallback #220

Merged
merged 5 commits into from
Jul 31, 2024
Merged

test SafeCallback #220

merged 5 commits into from
Jul 31, 2024

Conversation

saucepoint
Copy link
Collaborator

Related Issue

Closes #183

Description of changes

Added a mock contract and tested that SafeCallback.unlockCallback() is only accessible from PoolManager

Comment on lines +24 to +27
vm.startPrank(caller);
if (caller != address(manager)) vm.expectRevert(SafeCallback.NotPoolManager.selector);
safeCallback.unlockCallback(data);
vm.stopPrank();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is pretty neat from foundry, when fuzzing for addresses the fuzzer includes deployed contracts from setup! 😲

safeCallback = new MockSafeCallback(manager);
}

function test_unlock(uint256 num) public {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also just add an assert that the pool manager in SafeCallback is the address we expect/the pool manager address we initialized it with

@saucepoint saucepoint merged commit 0f03176 into main Jul 31, 2024
3 checks passed
@saucepoint saucepoint deleted the safecallback-test-2 branch July 31, 2024 18:16
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.

test SafeCallback
2 participants