File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -1157,14 +1157,27 @@ impl UserDefinedFieldType {
1157
1157
Ok ( Self :: NonNullType ( Box :: new ( Self :: Single ( GqlScalar :: String ) ) ) )
1158
1158
}
1159
1159
EthAbiParamType :: Array ( abi_type) | EthAbiParamType :: FixedArray ( abi_type, _) => {
1160
- let inner_type = Self :: from_ethabi_type ( abi_type) ?;
1160
+ //Validate no nested arrays or
1161
+ match abi_type. as_ref ( ) {
1162
+ EthAbiParamType :: Tuple ( _) => {
1163
+ Err ( anyhow ! ( "Unhandled contract import type 'array of tuple'" ) ) ?
1164
+ }
1165
+ EthAbiParamType :: Array ( _) => {
1166
+ Err ( anyhow ! ( "Unhandled contract import type 'array of array'" ) ) ?
1167
+ }
1168
+ _ => ( ) ,
1169
+ }
1170
+ let inner_type = Self :: from_ethabi_type ( abi_type)
1171
+ . context ( "Unhandled contract import nested type in array" ) ?;
1161
1172
Ok ( Self :: NonNullType ( Box :: new ( Self :: ListType ( Box :: new (
1162
1173
inner_type,
1163
1174
) ) ) ) )
1164
1175
}
1165
- EthAbiParamType :: Tuple ( _abi_types) => Err ( anyhow ! (
1166
- "Tuples are not handled currently using contract import."
1167
- ) ) ,
1176
+ EthAbiParamType :: Tuple ( _abi_types) =>
1177
+ //This case should be flattened out unless it is nested inside an array
1178
+ {
1179
+ Err ( anyhow ! ( "Unhandled contract import type 'tuple'" ) )
1180
+ }
1168
1181
}
1169
1182
}
1170
1183
}
Original file line number Diff line number Diff line change @@ -402,7 +402,10 @@ impl Param {
402
402
event_key : flattened_event_param. get_event_param_key ( ) ,
403
403
tuple_param_accessor_indexes : flattened_event_param. accessor_indexes ,
404
404
graphql_type : FieldType :: from_ethabi_type ( & flattened_event_param. event_param . kind )
405
- . context ( "converting eth event param to gql scalar" ) ?,
405
+ . context ( format ! (
406
+ "Converting eth event param '{}' to gql scalar" ,
407
+ flattened_event_param. event_param. name
408
+ ) ) ?,
406
409
is_eth_address : flattened_event_param. event_param . kind == ParamType :: Address ,
407
410
} )
408
411
}
You can’t perform that action at this time.
0 commit comments