@@ -415,7 +415,11 @@ impl CallDecl {
415415 self . expr . validate_args ( )
416416 }
417417
418- pub fn address_for_log ( & self , log : & Log , params : & [ abi:: DynSolParam ] ) -> Result < Address , Error > {
418+ pub fn address_for_log (
419+ & self ,
420+ log : & Log ,
421+ params : & [ abi:: DynSolParam ] ,
422+ ) -> Result < Address , Error > {
419423 self . address_for_log_with_abi ( log, params)
420424 }
421425
@@ -1643,9 +1647,9 @@ mod tests {
16431647 let parser = ExprParser :: new ( ) ;
16441648
16451649 let tuple_fields = vec ! [
1646- DynSolValue :: Uint ( U256 :: from( 8u8 ) , 8 ) , // index 0: uint8
1647- DynSolValue :: Address ( Address :: from( [ 1u8 ; 20 ] ) ) , // index 1: address
1648- DynSolValue :: Uint ( U256 :: from( 1000u64 ) , 256 ) , // index 2: uint256
1650+ DynSolValue :: Uint ( U256 :: from( 8u8 ) , 8 ) , // index 0: uint8
1651+ DynSolValue :: Address ( Address :: from( [ 1u8 ; 20 ] ) ) , // index 1: address
1652+ DynSolValue :: Uint ( U256 :: from( 1000u64 ) , 256 ) , // index 2: uint256
16491653 ] ;
16501654
16511655 // Test extract_struct_field with numeric indices
@@ -1687,9 +1691,9 @@ mod tests {
16871691
16881692 #[ test]
16891693 fn test_declarative_call_error_context ( ) {
1690- use alloy:: rpc:: types:: Log ;
1691- use crate :: abi:: { DynSolValue , DynSolParam } ;
1694+ use crate :: abi:: { DynSolParam , DynSolValue } ;
16921695 use alloy:: primitives:: U256 ;
1696+ use alloy:: rpc:: types:: Log ;
16931697
16941698 let parser = ExprParser :: new ( ) ;
16951699
@@ -1769,14 +1773,14 @@ mod tests {
17691773 // The parser thinks there should be 3 fields based on ABI, but at runtime we provide only 2
17701774 let base_struct = DynSolValue :: Tuple ( vec ! [
17711775 DynSolValue :: Address ( alloy:: primitives:: Address :: from( [ 1u8 ; 20 ] ) ) , // addr at index 0
1772- DynSolValue :: Uint ( U256 :: from( 100u64 ) , 256 ) , // amount at index 1
1773- // Missing the active field at index 2!
1776+ DynSolValue :: Uint ( U256 :: from( 100u64 ) , 256 ) , // amount at index 1
1777+ // Missing the active field at index 2!
17741778 ] ) ;
17751779
17761780 let params = vec ! [ DynSolParam {
17771781 name: "complexAsset" . to_string( ) ,
17781782 value: DynSolValue :: Tuple ( vec![
1779- base_struct, // base with only 2 fields
1783+ base_struct, // base with only 2 fields
17801784 DynSolValue :: String ( "metadata" . to_string( ) ) , // metadata at index 1
17811785 DynSolValue :: Array ( vec![ ] ) , // values at index 2
17821786 ] ) ,
@@ -1806,13 +1810,13 @@ mod tests {
18061810 // string name; // index 1
18071811 // }
18081812 let inner_struct = DynSolValue :: Tuple ( vec ! [
1809- DynSolValue :: Address ( Address :: from( [ 0x42 ; 20 ] ) ) , // token.addr
1810- DynSolValue :: String ( "TokenName" . to_string( ) ) , // token.name
1813+ DynSolValue :: Address ( Address :: from( [ 0x42 ; 20 ] ) ) , // token.addr
1814+ DynSolValue :: String ( "TokenName" . to_string( ) ) , // token.name
18111815 ] ) ;
18121816
18131817 let outer_struct = DynSolValue :: Tuple ( vec ! [
1814- DynSolValue :: Uint ( U256 :: from( 1u8 ) , 8 ) , // asset.kind
1815- inner_struct, // asset.token
1818+ DynSolValue :: Uint ( U256 :: from( 1u8 ) , 8 ) , // asset.kind
1819+ inner_struct, // asset.token
18161820 DynSolValue :: Uint ( U256 :: from( 1000u64 ) , 256 ) , // asset.amount
18171821 ] ) ;
18181822
0 commit comments