Repository navigation
[CLI] Run the test suite on anvil instead of ganache - #690
Open
Uxío (Uxio0) wants to merge 1 commit into
Open
Uxío (Uxio0) wants to merge 1 commit into
Uxío (Uxio0) wants to merge 1 commit into
Conversation
- Replace ganache with anvil in docker compose, CI and run_tests.sh. Same mnemonic and chain id 1337, so test accounts do not change. - CI starts anvil with the compose service, so CI and local tests use the same node setup. - Bump safe-eth-py to 7.29.1. - Fix drain: get_erc_20_list asked for logs past the requested block range, which anvil rejects. - Node and connection errors in the interactive prompt are printed and the session keeps running. Switching mode only happens after the Safe info is loaded. - Tests read the node URL from the configuration instead of a hardcoded localhost:8545. - run_tests.sh uses uv with the lockfile, returns the pytest exit code and always stops the containers.
Uxío (Uxio0)
force-pushed
the
uxio/pla-2321-cli-run-the-test-suite-on-anvil-instead-of
branch
from
November 9, 2026 15:46
4b88eb3 to
de5c20a
Compare
Uxío (Uxio0)
marked this pull request as ready for review
November 9, 2026 15:49
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de5c20a26f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes PLA-2321
Ganache is not maintained. safe-eth-py and safe-transaction-service already run their tests on anvil, this PR does the same for safe-cli.
Changes
Test node
run_tests.shuse anvil (ghcr.io/foundry-rs/foundry:v1.9.0) instead of ganache. Same setup as safe-transaction-service: the ganache-dmnemonic, chain id 1337, 10 accounts and gas limit 200M. Test keys and addresses do not change.docker compose --profile develop up --detach --wait anvil, so CI and local tests use the same node. CI used 30 accounts before, no test needs more than 10.safe-eth-pyto 7.29.1.ETHEREUM_NODE_URL) instead of a hardcodedlocalhost:8545.run_tests.sh: fix the shebang, use uv with the lockfile, return the pytest exit code and always stop the containers.test_executeused nonce 0, which only works on a fresh chain. It now uses the real account nonce and waits for the receipt (anvil returns the tx hash before the block is mined).CLI fixes found by running on anvil
drain:get_erc_20_listasked for logs past the requested block range (up to block 500000 on a chain at block 87). Anvil rejects it. Each log range now ends at the requestedto_block.Web3RPCError,ContractLogicError,TimeExhausted,ProviderConnectionError,requestserrors) are printed and the session keeps running. Before, the session crashed with a traceback. Switching mode (blockchain/tx-service) only happens, and prints its message, after the Safe info is loaded.Testing
ETHEREUM_MAINNET_NODE).safe-creator,safe-cli send-ether,drainin the interactive prompt, and a node error in the prompt (session keeps running).Not in this PR
drainreads logs from block 1 in steps of 500000 blocks. Many public RPC providers reject ranges that big, sodraincan still fail on mainnet. This existed before.safe-cli send-ether) still end with a traceback and a non-zero exit code.