-
Notifications
You must be signed in to change notification settings - Fork 44
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
feat(anvil): add anvil
examples from ethers-rs
#2
Conversation
anvil
examples from ethers-rs
anvil
examples from ethers-rs
let base_fee = provider.get_gas_price().await?; | ||
|
||
// Deploy the contract. | ||
let contract_builder = Counter::deploy_builder(&provider); | ||
let estimate = contract_builder.estimate_gas().await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to change the return value from U64 to u64 for all of these to make it easier to use, usually u64 is beneficial
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will implement once alloy-rs/alloy#338 is merged
Co-authored-by: Matthias Seitz <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Previous PR: alloy-rs/alloy#301
Motivation
To add examples from
ethers-rs
:anvil
Solution
Includes a new Anvil test (
deploy_contract
) that was planned inethers-rs
but not added originally. Adds two other very basic tests for forking and local.I'm currently managing the
nonces
,gas
andgas_price
manually which is not ideal. Preferablygas
andgas_price
are derived automatically. I think it is preferable to add support for nonce management to the examples at a later point.