@@ -415,7 +415,11 @@ impl CallDecl {
415
415
self . expr . validate_args ( )
416
416
}
417
417
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 > {
419
423
self . address_for_log_with_abi ( log, params)
420
424
}
421
425
@@ -1643,9 +1647,9 @@ mod tests {
1643
1647
let parser = ExprParser :: new ( ) ;
1644
1648
1645
1649
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
1649
1653
] ;
1650
1654
1651
1655
// Test extract_struct_field with numeric indices
@@ -1687,9 +1691,9 @@ mod tests {
1687
1691
1688
1692
#[ test]
1689
1693
fn test_declarative_call_error_context ( ) {
1690
- use alloy:: rpc:: types:: Log ;
1691
- use crate :: abi:: { DynSolValue , DynSolParam } ;
1694
+ use crate :: abi:: { DynSolParam , DynSolValue } ;
1692
1695
use alloy:: primitives:: U256 ;
1696
+ use alloy:: rpc:: types:: Log ;
1693
1697
1694
1698
let parser = ExprParser :: new ( ) ;
1695
1699
@@ -1769,14 +1773,14 @@ mod tests {
1769
1773
// The parser thinks there should be 3 fields based on ABI, but at runtime we provide only 2
1770
1774
let base_struct = DynSolValue :: Tuple ( vec ! [
1771
1775
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!
1774
1778
] ) ;
1775
1779
1776
1780
let params = vec ! [ DynSolParam {
1777
1781
name: "complexAsset" . to_string( ) ,
1778
1782
value: DynSolValue :: Tuple ( vec![
1779
- base_struct, // base with only 2 fields
1783
+ base_struct, // base with only 2 fields
1780
1784
DynSolValue :: String ( "metadata" . to_string( ) ) , // metadata at index 1
1781
1785
DynSolValue :: Array ( vec![ ] ) , // values at index 2
1782
1786
] ) ,
@@ -1806,13 +1810,13 @@ mod tests {
1806
1810
// string name; // index 1
1807
1811
// }
1808
1812
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
1811
1815
] ) ;
1812
1816
1813
1817
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
1816
1820
DynSolValue :: Uint ( U256 :: from( 1000u64 ) , 256 ) , // asset.amount
1817
1821
] ) ;
1818
1822
0 commit comments