Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

test: replace ganache with anvil #1286

Merged
merged 26 commits into from
Jun 1, 2022

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented May 19, 2022

Motivation

Closes #1227

supersedes #1229

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Updated the changelog

onbjerg and others added 16 commits May 5, 2022 18:44
Ganache is needed for the Ganache tests
this was only possible in ganache because it gives serial
sub ids, but in every other reasonable client the ids are generated
randomly, so we cannot test for its value
There is a bug in Ganache's mempool which accepts duplicate transactions (here with the same nonce), whereas here we pre-set all the nonces so that they end up having a different transaction hash.
@mattsse mattsse force-pushed the onbjerg/ganache-to-anvil branch from 01141f3 to e1efec5 Compare May 19, 2022 21:30
@gakonst
Copy link
Owner

gakonst commented May 20, 2022

I also think we may want to replace all Geth instances with Anvil in the tests? Found a mempool API which we do not implement in Anvil:

running 1 test
test txpool ... FAILED

failures:

---- txpool stdout ----
thread 'txpool' panicked at 'called `Result::unwrap()` on an `Err` value: JsonRpcClientError(JsonRpcError(JsonRpcError { code: -32601, message: "Method not found", data: None }))', ethers-providers/tests/txpool.rs:28:49
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

for the call provider.txpool_status(), supect it may apply to the txpool_inspect() too

gakonst added 2 commits May 25, 2022 11:39
some tests start to fail now
Anvil does not support IPC yet
@gakonst
Copy link
Owner

gakonst commented May 27, 2022

@mattsse the commit above where I replaced Geth txpool with Anvil highlights some new issue in the mempool implementation I think

@mattsse
Copy link
Collaborator Author

mattsse commented May 28, 2022

@mattsse the commit above where I replaced Geth txpool with Anvil highlights some new issue in the mempool implementation I think

used the current gas price rather than the gas price set by the tx, fixed here foundry-rs/foundry#1756 which should unblock this once included in nightly

@mattsse mattsse force-pushed the onbjerg/ganache-to-anvil branch from fa0383e to f823d62 Compare May 28, 2022 10:03
@mattsse mattsse force-pushed the onbjerg/ganache-to-anvil branch 6 times, most recently from 50c465f to 466be46 Compare June 1, 2022 11:49
@mattsse mattsse force-pushed the onbjerg/ganache-to-anvil branch from 466be46 to 5e6af90 Compare June 1, 2022 12:02
Copy link
Owner

@gakonst gakonst left a comment

Choose a reason for hiding this comment

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

Let's goooo

@gakonst gakonst merged commit 89bc642 into gakonst:master Jun 1, 2022
@dbelv dbelv mentioned this pull request Nov 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace ganache with anvil
3 participants