@@ -500,12 +500,12 @@ impl EthereumAdapter {
500500 }
501501 }
502502
503- fn code (
503+ async fn code (
504504 & self ,
505505 logger : & Logger ,
506506 address : Address ,
507507 block_ptr : BlockPtr ,
508- ) -> impl Future < Item = Bytes , Error = EthereumRpcError > + Send {
508+ ) -> Result < Bytes , EthereumRpcError > {
509509 let web3 = self . web3 . clone ( ) ;
510510 let logger = Logger :: new ( & logger, o ! ( "provider" => self . provider. clone( ) ) ) ;
511511
@@ -531,17 +531,16 @@ impl EthereumAdapter {
531531 }
532532 }
533533 } )
534+ . await
534535 . map_err ( |e| e. into_inner ( ) . unwrap_or ( EthereumRpcError :: Timeout ) )
535- . boxed ( )
536- . compat ( )
537536 }
538537
539- fn balance (
538+ async fn balance (
540539 & self ,
541540 logger : & Logger ,
542541 address : Address ,
543542 block_ptr : BlockPtr ,
544- ) -> impl Future < Item = U256 , Error = EthereumRpcError > + Send {
543+ ) -> Result < U256 , EthereumRpcError > {
545544 let web3 = self . web3 . clone ( ) ;
546545 let logger = Logger :: new ( & logger, o ! ( "provider" => self . provider. clone( ) ) ) ;
547546
@@ -567,9 +566,8 @@ impl EthereumAdapter {
567566 }
568567 }
569568 } )
569+ . await
570570 . map_err ( |e| e. into_inner ( ) . unwrap_or ( EthereumRpcError :: Timeout ) )
571- . boxed ( )
572- . compat ( )
573571 }
574572
575573 async fn call (
@@ -1470,32 +1468,32 @@ impl EthereumAdapterTrait for EthereumAdapter {
14701468 } )
14711469 }
14721470
1473- fn get_balance (
1471+ async fn get_balance (
14741472 & self ,
14751473 logger : & Logger ,
14761474 address : H160 ,
14771475 block_ptr : BlockPtr ,
1478- ) -> Box < dyn Future < Item = U256 , Error = EthereumRpcError > + Send > {
1476+ ) -> Result < U256 , EthereumRpcError > {
14791477 debug ! (
14801478 logger, "eth_getBalance" ;
14811479 "address" => format!( "{}" , address) ,
14821480 "block" => format!( "{}" , block_ptr)
14831481 ) ;
1484- Box :: new ( self . balance ( logger, address, block_ptr) )
1482+ self . balance ( logger, address, block_ptr) . await
14851483 }
14861484
1487- fn get_code (
1485+ async fn get_code (
14881486 & self ,
14891487 logger : & Logger ,
14901488 address : H160 ,
14911489 block_ptr : BlockPtr ,
1492- ) -> Box < dyn Future < Item = Bytes , Error = EthereumRpcError > + Send > {
1490+ ) -> Result < Bytes , EthereumRpcError > {
14931491 debug ! (
14941492 logger, "eth_getCode" ;
14951493 "address" => format!( "{}" , address) ,
14961494 "block" => format!( "{}" , block_ptr)
14971495 ) ;
1498- Box :: new ( self . code ( logger, address, block_ptr) )
1496+ self . code ( logger, address, block_ptr) . await
14991497 }
15001498
15011499 async fn next_existing_ptr_to_number (
0 commit comments