From d1a1bd260374ce1a1a3b5f6e096373ac2368b811 Mon Sep 17 00:00:00 2001 From: moricho Date: Mon, 15 Jul 2024 20:07:51 +0900 Subject: [PATCH 1/8] node-bindings: Add AnvilError::NoKeysAvailable --- crates/node-bindings/src/anvil.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/node-bindings/src/anvil.rs b/crates/node-bindings/src/anvil.rs index 0928957203c..62903e9c2e7 100644 --- a/crates/node-bindings/src/anvil.rs +++ b/crates/node-bindings/src/anvil.rs @@ -119,6 +119,10 @@ pub enum AnvilError { /// An error occurred while parsing a hex string. #[error(transparent)] FromHexError(#[from] hex::FromHexError), + + /// No keys available in anvil instance. + #[error("no keys available in anvil instance")] + NoKeysAvailable, } /// Builder for launching `anvil`. From 5bb7206d8ff86e21bf91dd5a2d3cc854e2e0689c Mon Sep 17 00:00:00 2001 From: moricho Date: Mon, 15 Jul 2024 20:08:17 +0900 Subject: [PATCH 2/8] prevent panic from having 0 keys --- crates/provider/src/builder.rs | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/crates/provider/src/builder.rs b/crates/provider/src/builder.rs index 5105351d75f..3ba67702862 100644 --- a/crates/provider/src/builder.rs +++ b/crates/provider/src/builder.rs @@ -8,9 +8,9 @@ use crate::{ }; use alloy_chains::NamedChain; use alloy_network::{Ethereum, Network}; +use alloy_node_bindings::anvil::AnvilError; use alloy_primitives::ChainId; use alloy_rpc_client::{BuiltInConnectionString, ClientBuilder, RpcClient}; - use alloy_transport::{BoxTransport, Transport, TransportError, TransportResult}; use std::marker::PhantomData; @@ -372,10 +372,13 @@ impl ProviderBuilder { /// use in tests. pub fn on_anvil_with_wallet( self, - ) -> > as ProviderLayer< - L::Provider, - alloy_transport_http::Http, - >>::Provider + ) -> Result< + > as ProviderLayer< + L::Provider, + alloy_transport_http::Http, + >>::Provider, + AnvilError, + > where F: TxFiller + ProviderLayer, Ethereum>, @@ -420,10 +423,13 @@ impl ProviderBuilder { pub fn on_anvil_with_wallet_and_config( self, f: impl FnOnce(alloy_node_bindings::Anvil) -> alloy_node_bindings::Anvil, - ) -> > as ProviderLayer< - L::Provider, - alloy_transport_http::Http, - >>::Provider + ) -> Result< + > as ProviderLayer< + L::Provider, + alloy_transport_http::Http, + >>::Provider, + AnvilError, + > where F: TxFiller + ProviderLayer, Ethereum>, @@ -439,7 +445,8 @@ impl ProviderBuilder { let url = anvil_layer.endpoint_url(); let default_keys = anvil_layer.instance().keys().to_vec(); - let (default_key, remaining_keys) = default_keys.split_first().expect("no keys available"); + let (default_key, remaining_keys) = + default_keys.split_first().ok_or(AnvilError::NoKeysAvailable)?; let default_signer = alloy_signer_local::LocalSigner::from(default_key.clone()); let mut wallet = alloy_network::EthereumWallet::from(default_signer); @@ -448,7 +455,7 @@ impl ProviderBuilder { wallet.register_signer(alloy_signer_local::LocalSigner::from(key.clone())) }); - self.wallet(wallet).layer(anvil_layer).on_http(url) + Ok(self.wallet(wallet).layer(anvil_layer).on_http(url)) } } From af0aec9643e3e096066959b127d4286ee67aeaa5 Mon Sep 17 00:00:00 2001 From: moricho Date: Mon, 15 Jul 2024 20:08:49 +0900 Subject: [PATCH 3/8] fix the error handlings for `on_anvil_with_wallet` --- crates/contract/src/call.rs | 3 ++- crates/provider/src/ext/anvil.rs | 6 +++--- crates/provider/src/ext/debug.rs | 5 +++-- crates/provider/src/fillers/gas.rs | 6 ++++-- crates/provider/src/fillers/nonce.rs | 3 ++- crates/provider/src/fillers/wallet.rs | 2 +- crates/provider/src/provider/trait.rs | 3 ++- crates/provider/src/provider/wallet.rs | 5 +++-- 8 files changed, 20 insertions(+), 13 deletions(-) diff --git a/crates/contract/src/call.rs b/crates/contract/src/call.rs index 77ba97815a2..21ee56f7f46 100644 --- a/crates/contract/src/call.rs +++ b/crates/contract/src/call.rs @@ -727,7 +727,8 @@ mod tests { #[tokio::test(flavor = "multi_thread")] async fn deploy_and_call() { - let provider = ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet(); + let provider = + ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet().unwrap(); let expected_address = provider.default_signer_address().create(0); let my_contract = MyContract::deploy(provider, true).await.unwrap(); diff --git a/crates/provider/src/ext/anvil.rs b/crates/provider/src/ext/anvil.rs index e3719e64ab1..95d6e36a462 100644 --- a/crates/provider/src/ext/anvil.rs +++ b/crates/provider/src/ext/anvil.rs @@ -440,7 +440,7 @@ mod tests { #[tokio::test] async fn test_anvil_drop_transaction() { - let provider = ProviderBuilder::new().on_anvil_with_wallet(); + let provider = ProviderBuilder::new().on_anvil_with_wallet().unwrap(); provider.anvil_set_auto_mine(false).await.unwrap(); @@ -468,7 +468,7 @@ mod tests { #[tokio::test] async fn test_anvil_drop_all_transactions() { - let provider = ProviderBuilder::new().on_anvil_with_wallet(); + let provider = ProviderBuilder::new().on_anvil_with_wallet().unwrap(); provider.anvil_set_auto_mine(false).await.unwrap(); @@ -670,7 +670,7 @@ mod tests { #[tokio::test] async fn test_anvil_remove_pool_transactions() { - let provider = ProviderBuilder::new().on_anvil_with_wallet(); + let provider = ProviderBuilder::new().on_anvil_with_wallet().unwrap(); provider.anvil_set_auto_mine(false).await.unwrap(); diff --git a/crates/provider/src/ext/debug.rs b/crates/provider/src/ext/debug.rs index f8933bff221..a1dac24f386 100644 --- a/crates/provider/src/ext/debug.rs +++ b/crates/provider/src/ext/debug.rs @@ -232,7 +232,8 @@ mod test { #[tokio::test] async fn test_debug_trace_transaction() { init_tracing(); - let provider = ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet(); + let provider = + ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet().unwrap(); let from = provider.default_signer_address(); let gas_price = provider.get_gas_price().await.unwrap(); @@ -258,7 +259,7 @@ mod test { #[tokio::test] async fn test_debug_trace_call() { init_tracing(); - let provider = ProviderBuilder::new().on_anvil_with_wallet(); + let provider = ProviderBuilder::new().on_anvil_with_wallet().unwrap(); let from = provider.default_signer_address(); let gas_price = provider.get_gas_price().await.unwrap(); let tx = TransactionRequest::default() diff --git a/crates/provider/src/fillers/gas.rs b/crates/provider/src/fillers/gas.rs index 756e54d59be..703852fcdce 100644 --- a/crates/provider/src/fillers/gas.rs +++ b/crates/provider/src/fillers/gas.rs @@ -259,7 +259,8 @@ mod tests { #[tokio::test] async fn no_gas_price_or_limit() { - let provider = ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet(); + let provider = + ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet().unwrap(); let from = provider.default_signer_address(); // GasEstimationLayer requires chain_id to be set to handle EIP-1559 tx let tx = TransactionRequest { @@ -280,7 +281,8 @@ mod tests { #[tokio::test] async fn no_gas_limit() { - let provider = ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet(); + let provider = + ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet().unwrap(); let from = provider.default_signer_address(); diff --git a/crates/provider/src/fillers/nonce.rs b/crates/provider/src/fillers/nonce.rs index ad9f0aa60f8..46173808f5c 100644 --- a/crates/provider/src/fillers/nonce.rs +++ b/crates/provider/src/fillers/nonce.rs @@ -191,7 +191,8 @@ mod tests { #[tokio::test] async fn increments_nonce() { - let provider = ProviderBuilder::new().with_nonce_management().on_anvil_with_wallet(); + let provider = + ProviderBuilder::new().with_nonce_management().on_anvil_with_wallet().unwrap(); let from = provider.default_signer_address(); let tx = TransactionRequest { diff --git a/crates/provider/src/fillers/wallet.rs b/crates/provider/src/fillers/wallet.rs index caa321a35b3..b4c57599c50 100644 --- a/crates/provider/src/fillers/wallet.rs +++ b/crates/provider/src/fillers/wallet.rs @@ -113,7 +113,7 @@ mod tests { #[tokio::test] async fn poc() { - let provider = ProviderBuilder::new().on_anvil_with_wallet(); + let provider = ProviderBuilder::new().on_anvil_with_wallet().unwrap(); let tx = TransactionRequest { nonce: Some(0), diff --git a/crates/provider/src/provider/trait.rs b/crates/provider/src/provider/trait.rs index 9ccd9c93f27..5c64bbcbf0e 100644 --- a/crates/provider/src/provider/trait.rs +++ b/crates/provider/src/provider/trait.rs @@ -1352,7 +1352,8 @@ mod tests { #[tokio::test] async fn gets_transaction_by_hash() { init_tracing(); - let provider = ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet(); + let provider = + ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet().unwrap(); let req = TransactionRequest::default() .from(provider.default_signer_address()) diff --git a/crates/provider/src/provider/wallet.rs b/crates/provider/src/provider/wallet.rs index d77ba67de3b..cee683b6c7a 100644 --- a/crates/provider/src/provider/wallet.rs +++ b/crates/provider/src/provider/wallet.rs @@ -99,14 +99,15 @@ mod test { #[test] fn basic_usage() { - let provider = ProviderBuilder::new().on_anvil_with_wallet(); + let provider = ProviderBuilder::new().on_anvil_with_wallet().unwrap(); assert!(provider.signer_addresses().contains(&provider.default_signer_address())); } #[test] fn bubbles_through_fillers() { - let provider = ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet(); + let provider = + ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet().unwrap(); assert!(provider.signer_addresses().contains(&provider.default_signer_address())); } From ba6edc93d5b241a8f0707af70d8a01fc06b07ad6 Mon Sep 17 00:00:00 2001 From: moricho Date: Mon, 15 Jul 2024 20:19:07 +0900 Subject: [PATCH 4/8] fix clippy --- crates/provider/src/builder.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/provider/src/builder.rs b/crates/provider/src/builder.rs index 3ba67702862..90c5a3ca53f 100644 --- a/crates/provider/src/builder.rs +++ b/crates/provider/src/builder.rs @@ -8,7 +8,6 @@ use crate::{ }; use alloy_chains::NamedChain; use alloy_network::{Ethereum, Network}; -use alloy_node_bindings::anvil::AnvilError; use alloy_primitives::ChainId; use alloy_rpc_client::{BuiltInConnectionString, ClientBuilder, RpcClient}; use alloy_transport::{BoxTransport, Transport, TransportError, TransportResult}; @@ -377,7 +376,7 @@ impl ProviderBuilder { L::Provider, alloy_transport_http::Http, >>::Provider, - AnvilError, + alloy_node_bindings::anvil::AnvilError, > where F: TxFiller @@ -428,7 +427,7 @@ impl ProviderBuilder { L::Provider, alloy_transport_http::Http, >>::Provider, - AnvilError, + alloy_node_bindings::anvil::AnvilError, > where F: TxFiller @@ -445,8 +444,9 @@ impl ProviderBuilder { let url = anvil_layer.endpoint_url(); let default_keys = anvil_layer.instance().keys().to_vec(); - let (default_key, remaining_keys) = - default_keys.split_first().ok_or(AnvilError::NoKeysAvailable)?; + let (default_key, remaining_keys) = default_keys + .split_first() + .ok_or(alloy_node_bindings::anvil::AnvilError::NoKeysAvailable)?; let default_signer = alloy_signer_local::LocalSigner::from(default_key.clone()); let mut wallet = alloy_network::EthereumWallet::from(default_signer); From eb3d3e9935ab08f5c2d2c4461af896a5aaa0d9c7 Mon Sep 17 00:00:00 2001 From: moricho Date: Tue, 16 Jul 2024 00:21:53 +0900 Subject: [PATCH 5/8] fix(clippy): Add type alias --- crates/provider/src/builder.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/crates/provider/src/builder.rs b/crates/provider/src/builder.rs index 90c5a3ca53f..ded730c7486 100644 --- a/crates/provider/src/builder.rs +++ b/crates/provider/src/builder.rs @@ -346,6 +346,11 @@ impl ProviderBuilder { } } +type JoinedEthereumWalletFiller = JoinFill>; + +#[cfg(any(test, feature = "anvil-node"))] +type AnvilProviderResult = Result; + // Enabled when the `anvil` feature is enabled, or when both in test and the // `reqwest` feature is enabled. #[cfg(any(test, feature = "anvil-node"))] @@ -371,12 +376,11 @@ impl ProviderBuilder { /// use in tests. pub fn on_anvil_with_wallet( self, - ) -> Result< - > as ProviderLayer< + ) -> AnvilProviderResult< + as ProviderLayer< L::Provider, alloy_transport_http::Http, >>::Provider, - alloy_node_bindings::anvil::AnvilError, > where F: TxFiller @@ -422,12 +426,11 @@ impl ProviderBuilder { pub fn on_anvil_with_wallet_and_config( self, f: impl FnOnce(alloy_node_bindings::Anvil) -> alloy_node_bindings::Anvil, - ) -> Result< - > as ProviderLayer< + ) -> AnvilProviderResult< + as ProviderLayer< L::Provider, alloy_transport_http::Http, >>::Provider, - alloy_node_bindings::anvil::AnvilError, > where F: TxFiller From bd30ae136f9ecc4f61354c5a2a17fca832b4ee6f Mon Sep 17 00:00:00 2001 From: moricho Date: Tue, 16 Jul 2024 00:38:48 +0900 Subject: [PATCH 6/8] Add `try_on_anvil_with_wallet_and_config` and call it in `on_anvil_with_wallet_and_config` --- crates/provider/src/builder.rs | 35 +++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/crates/provider/src/builder.rs b/crates/provider/src/builder.rs index ded730c7486..93f18557e5b 100644 --- a/crates/provider/src/builder.rs +++ b/crates/provider/src/builder.rs @@ -376,12 +376,10 @@ impl ProviderBuilder { /// use in tests. pub fn on_anvil_with_wallet( self, - ) -> AnvilProviderResult< - as ProviderLayer< - L::Provider, - alloy_transport_http::Http, - >>::Provider, - > + ) -> as ProviderLayer< + L::Provider, + alloy_transport_http::Http, + >>::Provider where F: TxFiller + ProviderLayer, Ethereum>, @@ -419,11 +417,34 @@ impl ProviderBuilder { self.layer(anvil_layer).on_http(url) } + /// Build this provider with anvil, using an Reqwest HTTP transport. + /// This calls `try_on_anvil_with_wallet_and_config` and panics on error.` + pub fn on_anvil_with_wallet_and_config( + self, + f: impl FnOnce(alloy_node_bindings::Anvil) -> alloy_node_bindings::Anvil, + ) -> as ProviderLayer< + L::Provider, + alloy_transport_http::Http, + >>::Provider + where + F: TxFiller + + ProviderLayer, Ethereum>, + L: crate::builder::ProviderLayer< + crate::layers::AnvilProvider< + crate::provider::RootProvider>, + alloy_transport_http::Http, + >, + alloy_transport_http::Http, + >, + { + self.try_on_anvil_with_wallet_and_config(f).unwrap() + } + /// Build this provider with anvil, using an Reqwest HTTP transport. The /// given function is used to configure the anvil instance. This /// function configures a wallet backed by anvil keys, and is intended for /// use in tests. - pub fn on_anvil_with_wallet_and_config( + pub fn try_on_anvil_with_wallet_and_config( self, f: impl FnOnce(alloy_node_bindings::Anvil) -> alloy_node_bindings::Anvil, ) -> AnvilProviderResult< From d165e5c9b6548e964d7694eab2a300f841f5a018 Mon Sep 17 00:00:00 2001 From: moricho Date: Tue, 16 Jul 2024 00:39:13 +0900 Subject: [PATCH 7/8] Revert test changes --- crates/contract/src/call.rs | 3 +-- crates/provider/src/ext/anvil.rs | 6 +++--- crates/provider/src/ext/debug.rs | 5 ++--- crates/provider/src/fillers/gas.rs | 6 ++---- crates/provider/src/fillers/nonce.rs | 3 +-- crates/provider/src/fillers/wallet.rs | 2 +- crates/provider/src/provider/trait.rs | 3 +-- crates/provider/src/provider/wallet.rs | 5 ++--- 8 files changed, 13 insertions(+), 20 deletions(-) diff --git a/crates/contract/src/call.rs b/crates/contract/src/call.rs index 21ee56f7f46..77ba97815a2 100644 --- a/crates/contract/src/call.rs +++ b/crates/contract/src/call.rs @@ -727,8 +727,7 @@ mod tests { #[tokio::test(flavor = "multi_thread")] async fn deploy_and_call() { - let provider = - ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet().unwrap(); + let provider = ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet(); let expected_address = provider.default_signer_address().create(0); let my_contract = MyContract::deploy(provider, true).await.unwrap(); diff --git a/crates/provider/src/ext/anvil.rs b/crates/provider/src/ext/anvil.rs index 95d6e36a462..e3719e64ab1 100644 --- a/crates/provider/src/ext/anvil.rs +++ b/crates/provider/src/ext/anvil.rs @@ -440,7 +440,7 @@ mod tests { #[tokio::test] async fn test_anvil_drop_transaction() { - let provider = ProviderBuilder::new().on_anvil_with_wallet().unwrap(); + let provider = ProviderBuilder::new().on_anvil_with_wallet(); provider.anvil_set_auto_mine(false).await.unwrap(); @@ -468,7 +468,7 @@ mod tests { #[tokio::test] async fn test_anvil_drop_all_transactions() { - let provider = ProviderBuilder::new().on_anvil_with_wallet().unwrap(); + let provider = ProviderBuilder::new().on_anvil_with_wallet(); provider.anvil_set_auto_mine(false).await.unwrap(); @@ -670,7 +670,7 @@ mod tests { #[tokio::test] async fn test_anvil_remove_pool_transactions() { - let provider = ProviderBuilder::new().on_anvil_with_wallet().unwrap(); + let provider = ProviderBuilder::new().on_anvil_with_wallet(); provider.anvil_set_auto_mine(false).await.unwrap(); diff --git a/crates/provider/src/ext/debug.rs b/crates/provider/src/ext/debug.rs index a1dac24f386..f8933bff221 100644 --- a/crates/provider/src/ext/debug.rs +++ b/crates/provider/src/ext/debug.rs @@ -232,8 +232,7 @@ mod test { #[tokio::test] async fn test_debug_trace_transaction() { init_tracing(); - let provider = - ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet().unwrap(); + let provider = ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet(); let from = provider.default_signer_address(); let gas_price = provider.get_gas_price().await.unwrap(); @@ -259,7 +258,7 @@ mod test { #[tokio::test] async fn test_debug_trace_call() { init_tracing(); - let provider = ProviderBuilder::new().on_anvil_with_wallet().unwrap(); + let provider = ProviderBuilder::new().on_anvil_with_wallet(); let from = provider.default_signer_address(); let gas_price = provider.get_gas_price().await.unwrap(); let tx = TransactionRequest::default() diff --git a/crates/provider/src/fillers/gas.rs b/crates/provider/src/fillers/gas.rs index 703852fcdce..756e54d59be 100644 --- a/crates/provider/src/fillers/gas.rs +++ b/crates/provider/src/fillers/gas.rs @@ -259,8 +259,7 @@ mod tests { #[tokio::test] async fn no_gas_price_or_limit() { - let provider = - ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet().unwrap(); + let provider = ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet(); let from = provider.default_signer_address(); // GasEstimationLayer requires chain_id to be set to handle EIP-1559 tx let tx = TransactionRequest { @@ -281,8 +280,7 @@ mod tests { #[tokio::test] async fn no_gas_limit() { - let provider = - ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet().unwrap(); + let provider = ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet(); let from = provider.default_signer_address(); diff --git a/crates/provider/src/fillers/nonce.rs b/crates/provider/src/fillers/nonce.rs index 46173808f5c..ad9f0aa60f8 100644 --- a/crates/provider/src/fillers/nonce.rs +++ b/crates/provider/src/fillers/nonce.rs @@ -191,8 +191,7 @@ mod tests { #[tokio::test] async fn increments_nonce() { - let provider = - ProviderBuilder::new().with_nonce_management().on_anvil_with_wallet().unwrap(); + let provider = ProviderBuilder::new().with_nonce_management().on_anvil_with_wallet(); let from = provider.default_signer_address(); let tx = TransactionRequest { diff --git a/crates/provider/src/fillers/wallet.rs b/crates/provider/src/fillers/wallet.rs index b4c57599c50..caa321a35b3 100644 --- a/crates/provider/src/fillers/wallet.rs +++ b/crates/provider/src/fillers/wallet.rs @@ -113,7 +113,7 @@ mod tests { #[tokio::test] async fn poc() { - let provider = ProviderBuilder::new().on_anvil_with_wallet().unwrap(); + let provider = ProviderBuilder::new().on_anvil_with_wallet(); let tx = TransactionRequest { nonce: Some(0), diff --git a/crates/provider/src/provider/trait.rs b/crates/provider/src/provider/trait.rs index 5c64bbcbf0e..9ccd9c93f27 100644 --- a/crates/provider/src/provider/trait.rs +++ b/crates/provider/src/provider/trait.rs @@ -1352,8 +1352,7 @@ mod tests { #[tokio::test] async fn gets_transaction_by_hash() { init_tracing(); - let provider = - ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet().unwrap(); + let provider = ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet(); let req = TransactionRequest::default() .from(provider.default_signer_address()) diff --git a/crates/provider/src/provider/wallet.rs b/crates/provider/src/provider/wallet.rs index cee683b6c7a..d77ba67de3b 100644 --- a/crates/provider/src/provider/wallet.rs +++ b/crates/provider/src/provider/wallet.rs @@ -99,15 +99,14 @@ mod test { #[test] fn basic_usage() { - let provider = ProviderBuilder::new().on_anvil_with_wallet().unwrap(); + let provider = ProviderBuilder::new().on_anvil_with_wallet(); assert!(provider.signer_addresses().contains(&provider.default_signer_address())); } #[test] fn bubbles_through_fillers() { - let provider = - ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet().unwrap(); + let provider = ProviderBuilder::new().with_recommended_fillers().on_anvil_with_wallet(); assert!(provider.signer_addresses().contains(&provider.default_signer_address())); } From 179173a329cdc907ea9de4e3ce2f8aeb73445992 Mon Sep 17 00:00:00 2001 From: moricho Date: Tue, 16 Jul 2024 00:42:11 +0900 Subject: [PATCH 8/8] Fix docs --- crates/provider/src/builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/provider/src/builder.rs b/crates/provider/src/builder.rs index 93f18557e5b..3871ac86865 100644 --- a/crates/provider/src/builder.rs +++ b/crates/provider/src/builder.rs @@ -418,7 +418,7 @@ impl ProviderBuilder { } /// Build this provider with anvil, using an Reqwest HTTP transport. - /// This calls `try_on_anvil_with_wallet_and_config` and panics on error.` + /// This calls `try_on_anvil_with_wallet_and_config` and panics on error. pub fn on_anvil_with_wallet_and_config( self, f: impl FnOnce(alloy_node_bindings::Anvil) -> alloy_node_bindings::Anvil,