@@ -115,12 +115,21 @@ pub fn web3(
115115) -> Web3 {
116116 let http = http_factory. cookie_store ( true ) . build ( ) . unwrap ( ) ;
117117 let http = HttpTransport :: new ( http, url. clone ( ) , name. to_string ( ) ) ;
118- let transport = match args. into_buffered_configuration ( ) {
119- Some ( config) => Web3Transport :: new ( BufferedTransport :: with_config ( http, config) ) ,
120- None => Web3Transport :: new ( http) ,
118+ let buffered_config = args. into_buffered_configuration ( ) ;
119+ let ( legacy, alloy, wallet) = match buffered_config {
120+ Some ( config) => {
121+ let legacy = Web3Transport :: new ( BufferedTransport :: with_config ( http, config) ) ;
122+ let ( alloy, wallet) = alloy:: provider ( url. as_str ( ) ) ;
123+ ( legacy, alloy, wallet)
124+ }
125+ None => {
126+ let legacy = Web3Transport :: new ( http) ;
127+ let ( alloy, wallet) = alloy:: unbuffered_provider ( url. as_str ( ) ) ;
128+ ( legacy, alloy, wallet)
129+ }
121130 } ;
122- let instrumented = instrumented:: InstrumentedTransport :: new ( name. to_string ( ) , transport ) ;
123- let ( alloy , wallet ) = alloy :: provider ( url . as_str ( ) ) ;
131+ let instrumented = instrumented:: InstrumentedTransport :: new ( name. to_string ( ) , legacy ) ;
132+
124133 Web3 {
125134 legacy : web3:: Web3 :: new ( Web3Transport :: new ( instrumented) ) ,
126135 alloy,
0 commit comments