Skip to content

Commit

Permalink
feature: anvil feature for alloy-provider
Browse files Browse the repository at this point in the history
  • Loading branch information
prestwich committed Apr 3, 2024
1 parent fc4b5e6 commit 7ea802d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/alloy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ contract = ["dep:alloy-contract", "dyn-abi", "json-abi", "json", "sol-types"]
eips = ["dep:alloy-eips"]
genesis = ["dep:alloy-genesis"]
network = ["dep:alloy-network"]
node-bindings = ["dep:alloy-node-bindings"]
node-bindings = ["dep:alloy-node-bindings", "alloy-provider?/anvil"]

# providers
providers = ["dep:alloy-provider"]
Expand Down
3 changes: 3 additions & 0 deletions crates/provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ exclude.workspace = true
alloy-eips.workspace = true
alloy-json-rpc.workspace = true
alloy-network.workspace = true
alloy-node-bindings = { workspace = true, optional = true }
alloy-signer-wallet = { workspace = true, optional = true }
alloy-rpc-client.workspace = true
alloy-rpc-types-trace.workspace = true
alloy-rpc-types.workspace = true
Expand Down Expand Up @@ -61,3 +63,4 @@ reqwest = [
hyper = ["dep:alloy-transport-http", "dep:url", "alloy-rpc-client/hyper"]
ws = ["pubsub", "alloy-rpc-client/ws", "alloy-transport-ws"]
ipc = ["pubsub", "alloy-rpc-client/ipc", "alloy-transport-ipc"]
anvil = ["dep:alloy-node-bindings", "dep:alloy-signer-wallet"]
4 changes: 3 additions & 1 deletion crates/provider/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,9 @@ impl<L, F, N> ProviderBuilder<L, F, N> {
}
}

#[cfg(all(test, feature = "reqwest"))]
// Enabled when the `anvil` feature is enabled, or when both in test and the
// `reqwest` feature is enabled.
#[cfg(any(all(test, feature = "reqwest"), feature = "anvil"))]
impl<L, F> ProviderBuilder<L, F, Ethereum> {
/// Build this provider with anvil, using an Reqwest HTTP transport. This
/// function configures a signer backed by anvil keys, and is intended for
Expand Down

0 comments on commit 7ea802d

Please sign in to comment.