Closed tomasz90 closed 2 years ago
There must be a mismatch between your function's specified return type and the data you're trying to decode. It looks like the function is expecting to find an offset (31 bits) where the data is specifying an address value (160 bits).
Try using the return type as the input type for another function and use that function to encode values. Then see if that encoding looks similar to what you're trying to decode.
Thanks, for hints I just figured it out. First I had problem with preparing proper inputs/outputs as array of structs - so I tried to use Function.fromJson()
then extract inputs/outputs. I don't know why but I get this ((address,string,string))
as array of structs. When I applied it as outputs this leaded me to above problem. As you mentioned in the second issue that I reported this should be ((address,string,string)[]). Now it works fine, thanks :)
Glad to hear it.
Hi, I would like to decode function return. I am testing this returning single element array of structs. Tried using:
public Tuple decodeReturn(ByteBuffer buf) { return outputTypes.decode(buf); }
but I am receiving error thatunsigned val exceeds bit limit: 160 > 31
. Going through stacktrace I am landing inUnitType<J>
which as description says is not suitable for arrays... Is there a way that I can decode output of my function? Thanks!