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

refactor: fork tests can easily be modified to any chain #561

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anna-carroll
Copy link
Member

Motivation

We'd like the ability to run the fork tests on any chain

Solution

Refactor to use CallBatch domain wherever possible so that the test domain can be changed in one single place in Reboot.t.sol.

PR Checklist

  • Added Tests
  • Updated Documentation
  • Updated CHANGELOG.md for the appropriate package

@anna-carroll anna-carroll requested a review from a team as a code owner November 29, 2022 21:40
@anna-carroll anna-carroll self-assigned this Nov 29, 2022
function setUp() public override(BridgeRouterBaseTest, NomadTest) {
setUpReboot("ethBridgeRouter");
require(
keccak256(bytes(localDomainName)) == keccak256(bytes("ethereum")),
"not ethereum bridge router"
Copy link
Member Author

Choose a reason for hiding this comment

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

i don't think there's a skipTest cheat code, so allowing it to fail at setup (thus not run any tests) with a clear error message

Copy link
Contributor

Choose a reason for hiding this comment

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

We can do an early return, which would count as successful.

Copy link
Member

Choose a reason for hiding this comment

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

modifier skipNotEthereum() {
    if (keccak256(bytes(localDomainName)) == keccak256(bytes("ethereum"))) {
        _;
    }
}

Copy link
Member Author

Choose a reason for hiding this comment

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

we don't have access to localDomainName in the inherited unit tests. also, that would mean that the unit tests don't run

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.

3 participants