File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -1762,10 +1762,7 @@ impl SimpleCast {
1762
1762
let func = get_func ( sig) ?;
1763
1763
match encode_function_args ( & func, args) {
1764
1764
Ok ( res) => Ok ( hex:: encode_prefixed ( & res[ 4 ..] ) ) ,
1765
- Err ( e) => eyre:: bail!(
1766
- "Could not ABI encode the function and arguments. Did you pass in the right types?\n Error\n {}" ,
1767
- e
1768
- ) ,
1765
+ Err ( e) => eyre:: bail!( "{}" , e) ,
1769
1766
}
1770
1767
}
1771
1768
Original file line number Diff line number Diff line change 15
15
I : IntoIterator < Item = S > ,
16
16
S : AsRef < str > ,
17
17
{
18
+ let args: Vec < S > = args. into_iter ( ) . collect ( ) ;
19
+
20
+ if inputs. len ( ) != args. len ( ) {
21
+ eyre:: bail!(
22
+ "encode length mismatch: expected {} types, got {}" ,
23
+ inputs. len( ) ,
24
+ args. len( )
25
+ )
26
+ }
27
+
18
28
std:: iter:: zip ( inputs, args)
19
29
. map ( |( input, arg) | coerce_value ( & input. selector_type ( ) , arg. as_ref ( ) ) )
20
30
. collect ( )
You can’t perform that action at this time.
0 commit comments