You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Impossible to call Solidity function that returns 2d array from contract
Steps To Reproduce
Simple solidity function: function get() view external returns (uint128[][] memory) {...}
Generate wrapper, or construct ethCall manually.
Expected behavior
Function should be called successfully and return result
Actual behavior
Exception occurred
java.lang.UnsupportedOperationException: Unable to access parameterized type org.web3j.abi.datatypes.DynamicArray<org.web3j.abi.datatypes.DynamicArray<org.web3j.abi.datatypes.generated.Uint128>>
at org.web3j.abi.TypeDecoder.decodeArrayElements(TypeDecoder.java:694)
at org.web3j.abi.TypeDecoder.decodeDynamicArray(TypeDecoder.java:442)
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:57)
at org.web3j.tx.Contract.executeCall(Contract.java:313)
at org.web3j.tx.Contract.executeCallMultipleValueReturn(Contract.java:357)
Environment
Web3j version 4.9.8
Additional context
So generated code is using new TypeReference<DynamicArray<DynamicArray<Uint128>>>() {} as output value which seems like not really working.
Is there any workaround? When constructing a call manually (as opposed to generating wrapper), what should I set for Types to 'Output parameters' to make it work?
The text was updated successfully, but these errors were encountered:
Bug_title
Impossible to call Solidity function that returns 2d array from contract
Steps To Reproduce
Simple solidity function:
function get() view external returns (uint128[][] memory) {...}
Generate wrapper, or construct ethCall manually.
Expected behavior
Function should be called successfully and return result
Actual behavior
Exception occurred
Environment
Web3j version 4.9.8
Additional context
So generated code is using
new TypeReference<DynamicArray<DynamicArray<Uint128>>>() {}
as output value which seems like not really working.Is there any workaround? When constructing a call manually (as opposed to generating wrapper), what should I set for Types to 'Output parameters' to make it work?
The text was updated successfully, but these errors were encountered: