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

feature: AnvilProvider #611

Merged
merged 2 commits into from
Apr 24, 2024
Merged

feature: AnvilProvider #611

merged 2 commits into from
Apr 24, 2024

Conversation

prestwich
Copy link
Member

Motivation

Closes #578

Solution

Make an anvil layer that configures and spawns a shared anvil instance
Refactor existing on_anvil code to use new provider

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@prestwich prestwich added the enhancement New feature or request label Apr 23, 2024
@prestwich prestwich self-assigned this Apr 23, 2024
Comment on lines -141 to +143
let (provider, anvil) =
ProviderBuilder::new().with_nonce_management().on_anvil_with_signer();
let provider = ProviderBuilder::new().with_nonce_management().on_anvil_with_signer();

let from = anvil.addresses()[0];
let from = provider.default_signer_address();
Copy link
Member

Choose a reason for hiding this comment

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

very nice API

@prestwich prestwich merged commit 98da8b8 into main Apr 24, 2024
18 checks passed
@prestwich prestwich deleted the prestwich/anvil-provider branch April 24, 2024 11:10
ben186 pushed a commit to ben186/alloy that referenced this pull request Jul 27, 2024
* feature: AnvilProvider

* fix: tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] AnvilProvider
4 participants