99 } ,
1010 token_info:: TokenInfoFetching ,
1111 } ,
12- alloy:: primitives:: Address ,
12+ alloy:: primitives:: { Address , U256 } ,
1313 anyhow:: { Context , Result , anyhow, ensure} ,
1414 contracts:: alloy:: { BalancerV2BasePool , BalancerV2Vault } ,
15- ethcontract:: { BlockId , H256 , U256 } ,
15+ ethcontract:: { BlockId , H256 } ,
1616 ethrpc:: alloy:: conversions:: { IntoAlloy , IntoLegacy } ,
1717 futures:: { FutureExt as _, future:: BoxFuture } ,
1818 std:: { collections:: BTreeMap , future:: Future , sync:: Arc } ,
@@ -89,7 +89,7 @@ impl<Factory> PoolInfoFetcher<Factory> {
8989 ) -> Result < PoolInfo > {
9090 let pool = self . base_pool_at ( pool_address) ;
9191
92- let pool_id = pool. getPoolId ( ) . call ( ) . await ?. into_legacy ( ) ;
92+ let pool_id = pool. getPoolId ( ) . call ( ) . await ?;
9393 let tokens = self
9494 . vault
9595 . getPoolTokens ( pool_id. 0 . into ( ) )
@@ -99,7 +99,7 @@ impl<Factory> PoolInfoFetcher<Factory> {
9999 let scaling_factors = self . scaling_factors ( & tokens) . await ?;
100100
101101 Ok ( PoolInfo {
102- id : pool_id,
102+ id : pool_id. into_legacy ( ) ,
103103 address : pool_address,
104104 tokens,
105105 scaling_factors,
@@ -150,7 +150,7 @@ impl<Factory> PoolInfoFetcher<Factory> {
150150 async move {
151151 let ( paused, swap_fee, pool_tokens) =
152152 futures:: try_join!( fetch_paused, fetch_swap_fee, pool_tokens) ?;
153- let swap_fee = Bfp :: from_wei ( swap_fee. into_legacy ( ) ) ;
153+ let swap_fee = Bfp :: from_wei ( swap_fee) ;
154154
155155 let balances = pool_tokens. balances ;
156156 let tokens = pool_tokens. tokens . into_iter ( ) . collect :: < Vec < _ > > ( ) ;
@@ -160,7 +160,7 @@ impl<Factory> PoolInfoFetcher<Factory> {
160160 (
161161 address,
162162 TokenState {
163- balance : balance . into_legacy ( ) ,
163+ balance,
164164 scaling_factor,
165165 } ,
166166 )
@@ -371,7 +371,6 @@ mod tests {
371371 } ,
372372 anyhow:: bail,
373373 contracts:: alloy:: BalancerV2Vault ,
374- ethcontract:: U256 ,
375374 maplit:: { btreemap, hashmap} ,
376375 mockall:: predicate,
377376 std:: future,
@@ -401,7 +400,7 @@ mod tests {
401400 & BalancerV2Vault :: BalancerV2Vault :: getPoolTokensReturn {
402401 tokens : tokens. to_vec ( ) ,
403402 balances : vec ! [ ] ,
404- lastChangeBlock : U256 :: zero ( ) . into_alloy ( ) ,
403+ lastChangeBlock : U256 :: ZERO ,
405404 } ,
406405 ) ;
407406 asserter. push_success ( & get_pool_tokens_response) ;
@@ -463,26 +462,23 @@ mod tests {
463462 BalancerV2BasePool :: BalancerV2BasePool :: getPausedStateCall:: abi_encode_returns (
464463 & BalancerV2BasePool :: BalancerV2BasePool :: getPausedStateReturn {
465464 paused : false ,
466- pauseWindowEndTime : U256 :: zero ( ) . into_alloy ( ) ,
467- bufferPeriodEndTime : U256 :: zero ( ) . into_alloy ( ) ,
465+ pauseWindowEndTime : U256 :: ZERO ,
466+ bufferPeriodEndTime : U256 :: ZERO ,
468467 } ,
469468 ) ;
470469 asserter. push_success ( & get_paused_state_response) ;
471470 let get_swap_fee_percentage_response =
472471 BalancerV2BasePool :: BalancerV2BasePool :: getSwapFeePercentageCall:: abi_encode_returns (
473- & bfp ! ( "0.003" ) . as_uint256 ( ) . into_alloy ( ) ,
472+ & bfp ! ( "0.003" ) . as_uint256 ( ) ,
474473 ) ;
475474 asserter. push_success ( & get_swap_fee_percentage_response) ;
476475
477476 let get_pool_tokens_response =
478477 BalancerV2Vault :: BalancerV2Vault :: getPoolTokensCall:: abi_encode_returns (
479478 & BalancerV2Vault :: BalancerV2Vault :: getPoolTokensReturn {
480479 tokens : tokens. to_vec ( ) ,
481- balances : balances
482- . iter ( )
483- . map ( |b| b. as_uint256 ( ) . into_alloy ( ) )
484- . collect ( ) ,
485- lastChangeBlock : U256 :: zero ( ) . into_alloy ( ) ,
480+ balances : balances. iter ( ) . map ( |b| b. as_uint256 ( ) ) . collect ( ) ,
481+ lastChangeBlock : U256 :: ZERO ,
486482 } ,
487483 ) ;
488484 asserter. push_success ( & get_pool_tokens_response) ;
@@ -554,24 +550,24 @@ mod tests {
554550 BalancerV2BasePool :: BalancerV2BasePool :: getPausedStateCall:: abi_encode_returns (
555551 & BalancerV2BasePool :: BalancerV2BasePool :: getPausedStateReturn {
556552 paused : false ,
557- pauseWindowEndTime : U256 :: zero ( ) . into_alloy ( ) ,
558- bufferPeriodEndTime : U256 :: zero ( ) . into_alloy ( ) ,
553+ pauseWindowEndTime : U256 :: ZERO ,
554+ bufferPeriodEndTime : U256 :: ZERO ,
559555 } ,
560556 ) ;
561557 asserter. push_success ( & get_paused_state_response) ;
562558
563559 let get_swap_fee_percentage_response =
564560 BalancerV2BasePool :: BalancerV2BasePool :: getSwapFeePercentageCall:: abi_encode_returns (
565- & U256 :: zero ( ) . into_alloy ( ) ,
561+ & U256 :: ZERO ,
566562 ) ;
567563 asserter. push_success ( & get_swap_fee_percentage_response) ;
568564
569565 let get_pool_tokens_response =
570566 BalancerV2Vault :: BalancerV2Vault :: getPoolTokensCall:: abi_encode_returns (
571567 & BalancerV2Vault :: BalancerV2Vault :: getPoolTokensReturn {
572568 tokens : vec ! [ Address :: repeat_byte( 1 ) , Address :: repeat_byte( 4 ) ] ,
573- balances : vec ! [ U256 :: zero ( ) . into_alloy ( ) , U256 :: zero ( ) . into_alloy ( ) ] ,
574- lastChangeBlock : U256 :: zero ( ) . into_alloy ( ) ,
569+ balances : vec ! [ U256 :: ZERO , U256 :: ZERO ] ,
570+ lastChangeBlock : U256 :: ZERO ,
575571 } ,
576572 ) ;
577573 asserter. push_success ( & get_pool_tokens_response) ;
@@ -619,14 +615,14 @@ mod tests {
619615 BalancerV2BasePool :: BalancerV2BasePool :: getPausedStateCall:: abi_encode_returns (
620616 & BalancerV2BasePool :: BalancerV2BasePool :: getPausedStateReturn {
621617 paused : false ,
622- pauseWindowEndTime : U256 :: zero ( ) . into_alloy ( ) ,
623- bufferPeriodEndTime : U256 :: zero ( ) . into_alloy ( ) ,
618+ pauseWindowEndTime : U256 :: ZERO ,
619+ bufferPeriodEndTime : U256 :: ZERO ,
624620 } ,
625621 ) ;
626622 asserter. push_success ( & get_paused_state_response) ;
627623 let get_swap_fee_percentage_response =
628624 BalancerV2BasePool :: BalancerV2BasePool :: getSwapFeePercentageCall:: abi_encode_returns (
629- & swap_fee. as_uint256 ( ) . into_alloy ( ) ,
625+ & swap_fee. as_uint256 ( ) ,
630626 ) ;
631627 asserter. push_success ( & get_swap_fee_percentage_response) ;
632628
@@ -679,9 +675,9 @@ mod tests {
679675 balances : pool_state
680676 . tokens
681677 . values ( )
682- . map ( |token| token. common . balance . into_alloy ( ) )
678+ . map ( |token| token. common . balance )
683679 . collect ( ) ,
684- lastChangeBlock : U256 :: zero ( ) . into_alloy ( ) ,
680+ lastChangeBlock : U256 :: ZERO ,
685681 } ,
686682 ) ;
687683 asserter. push_success ( & get_pool_tokens_response) ;
@@ -734,15 +730,15 @@ mod tests {
734730 BalancerV2BasePool :: BalancerV2BasePool :: getPausedStateCall:: abi_encode_returns (
735731 & BalancerV2BasePool :: BalancerV2BasePool :: getPausedStateReturn {
736732 paused : true ,
737- pauseWindowEndTime : U256 :: zero ( ) . into_alloy ( ) ,
738- bufferPeriodEndTime : U256 :: zero ( ) . into_alloy ( ) ,
733+ pauseWindowEndTime : U256 :: ZERO ,
734+ bufferPeriodEndTime : U256 :: ZERO ,
739735 } ,
740736 ) ;
741737 asserter. push_success ( & get_paused_state_response) ;
742738
743739 let get_swap_fee_percentage_response =
744740 BalancerV2BasePool :: BalancerV2BasePool :: getSwapFeePercentageCall:: abi_encode_returns (
745- & U256 :: zero ( ) . into_alloy ( ) ,
741+ & U256 :: ZERO ,
746742 ) ;
747743 asserter. push_success ( & get_swap_fee_percentage_response) ;
748744
@@ -751,7 +747,7 @@ mod tests {
751747 & BalancerV2Vault :: BalancerV2Vault :: getPoolTokensReturn {
752748 tokens : vec ! [ ] ,
753749 balances : vec ! [ ] ,
754- lastChangeBlock : U256 :: zero ( ) . into_alloy ( ) ,
750+ lastChangeBlock : U256 :: ZERO ,
755751 } ,
756752 ) ;
757753 asserter. push_success ( & get_pool_tokens_response) ;
@@ -813,15 +809,15 @@ mod tests {
813809 BalancerV2BasePool :: BalancerV2BasePool :: getPausedStateCall:: abi_encode_returns (
814810 & BalancerV2BasePool :: BalancerV2BasePool :: getPausedStateReturn {
815811 paused : false ,
816- pauseWindowEndTime : U256 :: zero ( ) . into_alloy ( ) ,
817- bufferPeriodEndTime : U256 :: zero ( ) . into_alloy ( ) ,
812+ pauseWindowEndTime : U256 :: ZERO ,
813+ bufferPeriodEndTime : U256 :: ZERO ,
818814 } ,
819815 ) ;
820816 asserter. push_success ( & get_paused_state_response) ;
821817
822818 let get_swap_fee_percentage_response =
823819 BalancerV2BasePool :: BalancerV2BasePool :: getSwapFeePercentageCall:: abi_encode_returns (
824- & U256 :: zero ( ) . into_alloy ( ) ,
820+ & U256 :: ZERO ,
825821 ) ;
826822 asserter. push_success ( & get_swap_fee_percentage_response) ;
827823
@@ -830,7 +826,7 @@ mod tests {
830826 & BalancerV2Vault :: BalancerV2Vault :: getPoolTokensReturn {
831827 tokens : vec ! [ ] ,
832828 balances : vec ! [ ] ,
833- lastChangeBlock : U256 :: zero ( ) . into_alloy ( ) ,
829+ lastChangeBlock : U256 :: ZERO ,
834830 } ,
835831 ) ;
836832 asserter. push_success ( & get_pool_tokens_response) ;
0 commit comments