Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: stop messaging #7
feat: stop messaging #7
Changes from 4 commits
3063cd2
60130bb
37bb81e
531c00a
5668af2
56cadff
45ca1bb
c6a0ad7
b76e7fa
0f87ce4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Since its just one line of code I dont think its worth it to make it an internal function as it adds extra JUMP opcodes making it more expensive, lets just put the if statement in the
receiveStopMessaging
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.
same here
Check warning on line 62 in src/interfaces/IOpUSDCBridgeAdapter.sol
GitHub Actions / Lint Commit Messages
Check warning on line 68 in src/interfaces/IOpUSDCBridgeAdapter.sol
GitHub Actions / Lint Commit Messages
Check warning on line 91 in src/interfaces/IOpUSDCBridgeAdapter.sol
GitHub Actions / Lint Commit Messages
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.
fuzz
_linkedAdapter
and_minGasLimit
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.
honestly I think its much cleaner and simpler if we just use
setLinkedAdapter
instead of stdstore, they do the same thing and we already havesetLinkedAdapter
fully covered in other test casesThere 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.
Lets split the expect emit into a different test case, and also use
vm.expectCall
for this one to ensure we are calling what we mockThere 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.
msg.sender
is supposed to beMESSENGER
I would change this to_notMessenger
to be clear.We also need one more test case for the case of when msg.sender is
messenger
butxDomainMessageSender()
is not thelinkedAdapter
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.
Done!
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.
StdStorage and stdStorage are now unused i believe, so we can remove them
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 use of stdstore is creative, but its much simpler and easy to maintain if we just create a test setter function to manipulate storage, see how I have a TestOPUSDCBridgeAdapter that extends the real one, add a setter function to make
isMessageDisabled
true in the test contract.This also makes it much easier to maintain if we ever need to change the storage layout
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.
fuzz the variables instead of 0,0