22
33use alloy_network:: EthereumSigner ;
44use alloy_primitives:: { address, U256 } ;
5- use alloy_provider:: { Provider , ProviderBuilder , RootProvider } ;
5+ use alloy_provider:: { Provider , ProviderBuilder } ;
66use alloy_rpc_client:: RpcClient ;
77use alloy_rpc_types:: request:: TransactionRequest ;
88use alloy_signer_wallet:: {
99 yubihsm:: { Connector , Credentials , UsbConfig } ,
1010 YubiWallet ,
1111} ;
12- use alloy_transport_http:: Http ;
1312use eyre:: Result ;
14- use reqwest:: Client ;
1513
1614#[ tokio:: main]
1715async fn main ( ) -> Result < ( ) > {
@@ -24,11 +22,11 @@ async fn main() -> Result<()> {
2422 // to generate a new keypair.
2523 let signer = YubiWallet :: connect ( connector, Credentials :: default ( ) , 0 ) ;
2624
27- // Create a provider with the signer and the network .
28- let http = Http :: < Client > :: new ( "http://localhost:8545" . parse ( ) ?) ;
25+ // Create a provider with the signer.
26+ let http = "http://localhost:8545" . parse ( ) ?;
2927 let provider = ProviderBuilder :: new ( )
3028 . signer ( EthereumSigner :: from ( signer) )
31- . provider ( RootProvider :: new ( RpcClient :: new ( http, true ) ) ) ;
29+ . on_client ( RpcClient :: new_http ( http) ) ;
3230
3331 // Create a transaction.
3432 let tx = TransactionRequest {
0 commit comments