diff --git a/examples/anvil/Cargo.toml b/examples/anvil/Cargo.toml index 160ec7d1..4ca556e6 100644 --- a/examples/anvil/Cargo.toml +++ b/examples/anvil/Cargo.toml @@ -19,7 +19,6 @@ alloy-provider.workspace = true alloy-rpc-client.workspace = true alloy-signer-wallet.workspace = true alloy-sol-types.workspace = true -alloy-transport-http.workspace = true eyre.workspace = true reqwest.workspace = true diff --git a/examples/anvil/examples/deploy_contract_anvil.rs b/examples/anvil/examples/deploy_contract_anvil.rs index 5e0042d0..7c9e67c7 100644 --- a/examples/anvil/examples/deploy_contract_anvil.rs +++ b/examples/anvil/examples/deploy_contract_anvil.rs @@ -3,13 +3,11 @@ use alloy_network::EthereumSigner; use alloy_node_bindings::Anvil; use alloy_primitives::U256; -use alloy_provider::{Provider, ProviderBuilder, RootProvider}; +use alloy_provider::{Provider, ProviderBuilder}; use alloy_rpc_client::RpcClient; use alloy_signer_wallet::LocalWallet; use alloy_sol_types::sol; -use alloy_transport_http::Http; use eyre::Result; -use reqwest::Client; // Codegen from embedded Solidity code and precompiled bytecode. sol! { @@ -38,10 +36,10 @@ async fn main() -> Result<()> { let wallet: LocalWallet = anvil.keys()[0].clone().into(); // Create a provider with a signer and the network. - let http = Http::::new(anvil.endpoint().parse()?); + let http = anvil.endpoint().parse()?; let provider = ProviderBuilder::new() .signer(EthereumSigner::from(wallet)) - .provider(RootProvider::new(RpcClient::new(http, true))); + .on_client(RpcClient::new_http(http)); println!("Anvil running at `{}`", anvil.endpoint());