poanetwork / ex_abi

The Ethereum ABI Interface
GNU General Public License v3.0
61 stars 43 forks source link

ABI.FunctionSelector.decode_type/1 doesn't recognize tuple type #168

Closed vbaranov closed 7 months ago

vbaranov commented 7 months ago
iex(2)> ABI.FunctionSelector.decode_type("tuple[address,bytes32[],bytes][]")
** (MatchError) no match of right hand side value: {:error, {1, :ethereum_abi_parser, ['syntax error before: ', ['"address"']]}}
    (ex_abi 0.7.2) lib/abi/parser.ex:15: ABI.Parser.parse!/2
    iex:2: (file)
vbaranov commented 7 months ago

Ok, tuple is decoded with this input:

iex(1)> ABI.FunctionSelector.decode_type("(address,bytes32[],bytes)[]")
{:array, {:tuple, [:address, {:array, {:bytes, 32}}, :bytes]}}