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 @@ -1170,19 +1170,17 @@ impl EthereumAdapter {
1170
1170
1171
1171
pub async fn chain_id ( & self ) -> Result < u64 , Error > {
1172
1172
let logger = self . logger . clone ( ) ;
1173
- let web3 = self . web3 . clone ( ) ;
1174
- u64:: try_from (
1175
- retry ( "chain_id RPC call" , & logger)
1176
- . redact_log_urls ( true )
1177
- . no_limit ( )
1178
- . timeout_secs ( ENV_VARS . json_rpc_timeout . as_secs ( ) )
1179
- . run ( move || {
1180
- let web3 = web3. cheap_clone ( ) ;
1181
- async move { web3. eth ( ) . chain_id ( ) . await }
1182
- } )
1183
- . await ?,
1184
- )
1185
- . map_err ( Error :: msg)
1173
+ let alloy = self . alloy . clone ( ) ;
1174
+ retry ( "chain_id RPC call" , & logger)
1175
+ . redact_log_urls ( true )
1176
+ . no_limit ( )
1177
+ . timeout_secs ( ENV_VARS . json_rpc_timeout . as_secs ( ) )
1178
+ . run ( move || {
1179
+ let alloy = alloy. cheap_clone ( ) ;
1180
+ async move { alloy. get_chain_id ( ) . await . map_err ( Error :: from) }
1181
+ } )
1182
+ . await
1183
+ . map_err ( |e| e. into_inner ( ) . unwrap_or ( EthereumRpcError :: Timeout . into ( ) ) )
1186
1184
}
1187
1185
}
1188
1186
You can’t perform that action at this time.
0 commit comments