File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -1185,19 +1185,17 @@ impl EthereumAdapter {
1185
1185
1186
1186
pub async fn chain_id ( & self ) -> Result < u64 , Error > {
1187
1187
let logger = self . logger . clone ( ) ;
1188
- let web3 = self . web3 . clone ( ) ;
1189
- u64:: try_from (
1190
- retry ( "chain_id RPC call" , & logger)
1191
- . redact_log_urls ( true )
1192
- . no_limit ( )
1193
- . timeout_secs ( ENV_VARS . json_rpc_timeout . as_secs ( ) )
1194
- . run ( move || {
1195
- let web3 = web3. cheap_clone ( ) ;
1196
- async move { web3. eth ( ) . chain_id ( ) . await }
1197
- } )
1198
- . await ?,
1199
- )
1200
- . map_err ( Error :: msg)
1188
+ let alloy = self . alloy . clone ( ) ;
1189
+ retry ( "chain_id RPC call" , & logger)
1190
+ . redact_log_urls ( true )
1191
+ . no_limit ( )
1192
+ . timeout_secs ( ENV_VARS . json_rpc_timeout . as_secs ( ) )
1193
+ . run ( move || {
1194
+ let alloy = alloy. cheap_clone ( ) ;
1195
+ async move { alloy. get_chain_id ( ) . await . map_err ( Error :: from) }
1196
+ } )
1197
+ . await
1198
+ . map_err ( |e| e. into_inner ( ) . unwrap_or ( EthereumRpcError :: Timeout . into ( ) ) )
1201
1199
}
1202
1200
}
1203
1201
You can’t perform that action at this time.
0 commit comments