@@ -33,8 +33,8 @@ use graph::{
3333 web3:: {
3434 self ,
3535 types:: {
36- Address , BlockId , BlockNumber as Web3BlockNumber , Bytes , CallRequest , Filter ,
37- FilterBuilder , Log , Transaction , TransactionReceipt , H256 ,
36+ BlockId , BlockNumber as Web3BlockNumber , Bytes , CallRequest , Filter , FilterBuilder ,
37+ Log , Transaction , TransactionReceipt , H256 ,
3838 } ,
3939 } ,
4040 BlockNumber , ChainStore , CheapClone , DynTryFuture , Error , EthereumCallCache , Logger ,
@@ -531,13 +531,13 @@ impl EthereumAdapter {
531531 async fn code (
532532 & self ,
533533 logger : & Logger ,
534- address : Address ,
534+ address : alloy :: primitives :: Address ,
535535 block_ptr : BlockPtr ,
536- ) -> Result < Bytes , EthereumRpcError > {
537- let web3 = self . web3 . clone ( ) ;
536+ ) -> Result < alloy :: primitives :: Bytes , EthereumRpcError > {
537+ let alloy = self . alloy . clone ( ) ;
538538 let logger = Logger :: new ( & logger, o ! ( "provider" => self . provider. clone( ) ) ) ;
539539
540- let block_id = self . block_ptr_to_id ( & block_ptr) ;
540+ let block_id = self . block_ptr_to_alloy_block_id ( & block_ptr) ;
541541 let retry_log_message = format ! ( "eth_getCode RPC call for block {}" , block_ptr) ;
542542
543543 retry ( retry_log_message, & logger)
@@ -549,13 +549,12 @@ impl EthereumAdapter {
549549 . limit ( ENV_VARS . request_retries )
550550 . timeout_secs ( ENV_VARS . json_rpc_timeout . as_secs ( ) )
551551 . run ( move || {
552- let web3 = web3 . cheap_clone ( ) ;
552+ let alloy = alloy . cheap_clone ( ) ;
553553 async move {
554- let result: Result < Bytes , web3:: Error > =
555- web3. eth ( ) . code ( address, Some ( block_id) ) . boxed ( ) . await ;
554+ let result = alloy. get_code_at ( address) . block_id ( block_id) . await ;
556555 match result {
557556 Ok ( code) => Ok ( code) ,
558- Err ( err) => Err ( EthereumRpcError :: Web3Error ( err) ) ,
557+ Err ( err) => Err ( EthereumRpcError :: AlloyError ( err) ) ,
559558 }
560559 }
561560 } )
@@ -1513,9 +1512,9 @@ impl EthereumAdapterTrait for EthereumAdapter {
15131512 async fn get_code (
15141513 & self ,
15151514 logger : & Logger ,
1516- address : H160 ,
1515+ address : alloy :: primitives :: Address ,
15171516 block_ptr : BlockPtr ,
1518- ) -> Result < Bytes , EthereumRpcError > {
1517+ ) -> Result < alloy :: primitives :: Bytes , EthereumRpcError > {
15191518 debug ! (
15201519 logger, "eth_getCode" ;
15211520 "address" => format!( "{}" , address) ,
0 commit comments