-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: added pausability to ics20 #257
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #257 +/- ##
==========================================
+ Coverage 99.46% 99.48% +0.01%
==========================================
Files 12 13 +1
Lines 560 580 +20
==========================================
+ Hits 557 577 +20
Misses 3 3 ☔ View full report in Codecov by Sentry. |
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.
Just left a few small comments for improvement, but looks good otherwise!
function sendTransfer(IICS20TransferMsgs.SendTransferMsg calldata msg_) | ||
external | ||
override | ||
whenNotPaused |
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.
I think the "when" part is implied. I think it should be notPaused.
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.
This is inherited from openzeppelin, the name isn't defined by us
|
||
vm.prank(ics20Pauser); | ||
ics20Transfer.unpause(); | ||
assert(!ics20Transfer.paused()); |
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.
should probably test that the function can be called after unpause
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.
Probably not needed as this requires adding unrelated transfer helpers such as an erc20 contract into this test suite. I think simply checking that the contract is not paused and trusting openzeppelin is not so bad. Moreover, this can be fixed by a migration if it ever comes to it,
address newPauser = makeAddr("newPauser"); | ||
|
||
ics20Transfer.setPauser(newPauser); | ||
assertEq(ics20Transfer.getPauser(), newPauser); |
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.
probably would be good to verify that you cannot call it with the old pauser, and that you can call it with the new one.
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.
I think getPauser()
is enough since there is only a single state entry in the contract for pauser. This is a unit test, and the goal of the function is to change that state entry
Description
closes: #231
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
godoc
comments.Files changed
in the GitHub PR explorer.SonarCloud Report
in the comment section below once CI passes.