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

chore: refactor MessagIdHook/ISM tests into a common ExternalBridgeTest contract #4490

Merged
merged 17 commits into from
Sep 20, 2024

Conversation

aroralanuk
Copy link
Contributor

@aroralanuk aroralanuk commented Sep 16, 2024

Description

We currently have 6 different versions of ISMs derived from AbstractMessageIdAuthorizedIsm:

  • OPL2ToL1
  • ArbL2ToL1
  • OPStack (L1->L2)
  • ERC5164
  • LayerZero
  • PolygonPOS

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:

  • harder to miss tests for known pitfalls like msg.value or asynchronicity assumption for verifyMessageId
  • less code duplication with each additional Ism

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

Copy link

changeset-bot bot commented Sep 16, 2024

⚠️ No Changeset found

Latest commit: fb089e2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

codecov bot commented Sep 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.22%. Comparing base (291c5fe) to head (fb089e2).
Report is 36 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4490      +/-   ##
==========================================
+ Coverage   81.37%   82.22%   +0.84%     
==========================================
  Files         100      100              
  Lines        1412     1412              
  Branches      178      178              
==========================================
+ Hits         1149     1161      +12     
+ Misses        263      251      -12     
Components Coverage Δ
core 96.92% <ø> (ø)
hooks 86.66% <ø> (+4.28%) ⬆️
isms 93.80% <ø> (+1.32%) ⬆️
token 93.05% <ø> (ø)
middlewares 86.52% <ø> (ø)

@aroralanuk aroralanuk marked this pull request as ready for review September 17, 2024 15:20
@aroralanuk aroralanuk changed the title feat: refactor MessagIdHook/ISM tests into a common ExternalBridgeTest contract chore: refactor MessagIdHook/ISM tests into a common ExternalBridgeTest contract Sep 17, 2024
solidity/test/isms/ExternalBridgeTest.sol Show resolved Hide resolved
solidity/test/isms/ExternalBridgeTest.sol Outdated Show resolved Hide resolved
solidity/test/isms/ExternalBridgeTest.sol Outdated Show resolved Hide resolved
solidity/test/isms/ExternalBridgeTest.sol Outdated Show resolved Hide resolved
solidity/test/isms/ExternalBridgeTest.sol Outdated Show resolved Hide resolved
solidity/test/isms/ExternalBridgeTest.sol Outdated Show resolved Hide resolved
solidity/test/isms/ExternalBridgeTest.sol Outdated Show resolved Hide resolved
solidity/test/isms/ExternalBridgeTest.sol Outdated Show resolved Hide resolved
solidity/test/isms/ExternalBridgeTest.sol Outdated Show resolved Hide resolved
solidity/test/isms/ExternalBridgeTest.sol Outdated Show resolved Hide resolved
@aroralanuk aroralanuk added this pull request to the merge queue Sep 20, 2024
Merged via the queue into main with commit c032b8b Sep 20, 2024
37 checks passed
@aroralanuk aroralanuk deleted the kunal/external-bridge-refactor branch September 20, 2024 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants