When I call Contract.excuteCall, how do I receive the response of [{a:[]}, {a:[]}]
When I call Contract.excuteCall, how do I receive the response of [{a:[]}, {a:[]}]
Issue_description
this is my code
//request
final Function function = new Function(FUNC_XXX,
Arrays.<Type>asList(new DynamicArray<Uint256>(
Uint256.class,
org.web3j.abi.Utils.typeMap(ids, Uint256.class)),
new org.web3j.abi.datatypes.Address(160, param1),
new org.web3j.abi.datatypes.Address(160, param2)),
Collections.<TypeReference<?>>singletonList(new TypeReference<DynamicArray<StructA>>() {
}));
return new RemoteFunctionCall<List>(function,
new Callable<List>() {
@Override
@SuppressWarnings("unchecked")
public List call() throws Exception {
List<Type> result = (List<Type>) executeCallSingleValueReturn(function, List.class);
return convertToNative(result);
}
});
// struct
class StructA(
val array: DynamicArray<Uint256>
) : DynamicStruct(
array)
This is the exception I encountered:
Caused by: java.lang.UnsupportedOperationException: Array types must be wrapped in a TypeReference at org.web3j.abi.TypeDecoder.decode(TypeDecoder.java:114) at org.web3j.abi.TypeDecoder.decode(TypeDecoder.java:122) at org.web3j.abi.TypeDecoder.decodeDynamicParameterFromStruct(TypeDecoder.java:590) at org.web3j.abi.TypeDecoder.decodeDynamicStructElements(TypeDecoder.java:546) at org.web3j.abi.TypeDecoder.decodeDynamicStruct(TypeDecoder.java:472) at org.web3j.abi.TypeDecoder.decodeArrayElements(TypeDecoder.java:666) at org.web3j.abi.TypeDecoder.decodeDynamicArray(TypeDecoder.java:456) at org.web3j.abi.DefaultFunctionReturnDecoder.build(DefaultFunctionReturnDecoder.java:100) at org.web3j.abi.DefaultFunctionReturnDecoder.decodeFunctionResult(DefaultFunctionReturnDecoder.java:52) at org.web3j.abi.FunctionReturnDecoder.decode(FunctionReturnDecoder.java:49) at org.web3j.tx.Contract.executeCall(Contract.java:295) at org.web3j.tx.Contract.executeCallSingleValueReturn(Contract.java:301) at org.web3j.tx.Contract.executeCallSingleValueReturn(Contract.java:312)
Ask for help~~~
same error. any one have idea on this?
same error