diff --git a/crates/alloy/Cargo.toml b/crates/alloy/Cargo.toml index 92c11b2e7668..5f25605905c3 100644 --- a/crates/alloy/Cargo.toml +++ b/crates/alloy/Cargo.toml @@ -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"] diff --git a/crates/provider/Cargo.toml b/crates/provider/Cargo.toml index 1963aa147153..79f7643547e7 100644 --- a/crates/provider/Cargo.toml +++ b/crates/provider/Cargo.toml @@ -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 @@ -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"] \ No newline at end of file diff --git a/crates/provider/src/builder.rs b/crates/provider/src/builder.rs index 6079ce8d393d..8f0afcef9e45 100644 --- a/crates/provider/src/builder.rs +++ b/crates/provider/src/builder.rs @@ -328,7 +328,9 @@ impl ProviderBuilder { } } -#[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 ProviderBuilder { /// Build this provider with anvil, using an Reqwest HTTP transport. This /// function configures a signer backed by anvil keys, and is intended for