-
Notifications
You must be signed in to change notification settings - Fork 322
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
chore: refactor MessagIdHook/ISM tests into a common ExternalBridgeTest
contract
#4490
base: main
Are you sure you want to change the base?
Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4490 +/- ##
==========================================
+ Coverage 81.37% 82.01% +0.63%
==========================================
Files 100 100
Lines 1412 1412
Branches 178 178
==========================================
+ Hits 1149 1158 +9
+ Misses 263 254 -9
|
ExternalBridgeTest
contractExternalBridgeTest
contract
// async call - native bridges might have try catch block to prevent revert | ||
try | ||
this.externalBridgeDestinationCallWrapper(externalCalldata, 0) | ||
{} catch {} |
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 dont understand this
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.
optimism has a try catch in their l2Messenger.relayMessage() so it doesn't revert.
); | ||
} | ||
|
||
// try catch block to prevent revert |
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 not descriptive enough to be useful
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.
add more detail here:
"wrapper function needed for _externalBridgeDestinationCall because try catch cannot call an internal function"
Description
We currently have 6 different versions of ISMs derived from AbstractMessageIdAuthorizedIsm:
But all of them have their own custom test suite right now, with widely overlapping testing areas. For standardizing the tests, I've created a base test contract
ExternalBridgeTest
that handles the common tests. This has a few benefits:I have moved OPL2ToL1, ArbL2ToL1, OPStack, and ERC5164 to the new base test, and I'll forgo the rest for now because of the time sensitivity of audit remediations. I've created an issue tracking the remaining work here: https://github.com/hyperlane-xyz/issues/issues/1384
Drive-by changes
None
Related issues
Related to https://github.com/chainlight-io/2024-08-hyperlane/issues/3
Backward compatibility
Yes
Testing
Unit