Skip to content

refactor: update tests with SignetStd for easy local/fork testing #84

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

Merged
merged 11 commits into from
Aug 12, 2025

Conversation

anna-carroll
Copy link
Contributor

@anna-carroll anna-carroll commented Aug 6, 2025

Refactor local tests to run against values in SignetStd contract, so that all local tests can be run as fork tests against any chain.

@anna-carroll anna-carroll self-assigned this Aug 6, 2025
@anna-carroll anna-carroll marked this pull request as ready for review August 7, 2025 18:29
@anna-carroll anna-carroll changed the title WIP: refactor tests with SignetStd for easy local/fork testing refactor: update tests with SignetStd for easy local/fork testing Aug 7, 2025
@prestwich
Copy link
Member

this is based on #83 ?

@anna-carroll
Copy link
Contributor Author

this is based on #83 ?

sorry, no - it's based on main. #83 history was messed up

Copy link
Member

@prestwich prestwich left a comment

Choose a reason for hiding this comment

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

nit: signet std could be immutables, but i don't think it matters

@anna-carroll
Copy link
Contributor Author

anna-carroll commented Aug 12, 2025

nit: signet std could be immutables, but i don't think it matters

i made them mutable because of the pattern i used in the fork testing -- setting up the fork and then re-running setupStd(), so that it re-configures the vars based on the new chainid. if they're immutable and the test contract inherits Std, and Std sets itself up based on the chainid, then you need the correct chainid set at the time that the test boots up for Std to be properly configured.

i am actually realizing while writing this comment though that the fork testing strategy could be changed to

  • do away with the fork/ folder implemented in feat: fork tests #86
  • split these tests into host/ and rollup/ folders
  • run them as unit tests with regular forge test
  • run the exact same tests as fork tests with forge test --match-path rollup/ --fork-url $ROLLUP_RPC / same for host

(which is cool 👀)

nevertheless i think having the configuration mutable leaves things a bit more flexible re: setting up forking in the code? 🤔

@anna-carroll anna-carroll merged commit 688f46f into main Aug 12, 2025
1 check passed
@anna-carroll anna-carroll deleted the anna/refactor-tests branch August 12, 2025 15:34
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.

2 participants