We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently there are not support for multidimensional tuple arrays, so when an abi contents a type like this tuple[][] is trying to parse it as if having a fixed length https://github.com/poanetwork/ex_abi/blob/master/lib/abi/function_selector.ex#L318 and generating an error.
tuple[][]
It's posible to reproduce running this test:
test "parse multidimensional tuple" do abi = %{ "constant" => true, "inputs" => [%{"name" => "swaps", "type" => "tuple[][]", "interalType" => "struct ExchangeProxy.Swap[][]", "components" => [ %{ "name" => "foo", "type" => "uint256" }, %{ "name" => "bar", "type" => "uint256" } ]}], "name" => "batchSwapExactOut", "outputs" => [%{"name" => "totalAmountIn", "type" => "uint256"}], "payable" => true, "stateMutability" => "payable", "type" => "function" } IO.inspect(ABI.parse_specification([abi])) end
The error produced is:
1) test parse multidimensional tuple (Explorer.SmartContract.ReaderTest) apps/explorer/test/explorer/smart_contract/reader_test.exs:385 ** (ArgumentError) errors were found at the given arguments: * 1st argument: not a textual representation of an integer code: IO.inspect(ABI.parse_specification([abi])) stacktrace: :erlang.binary_to_integer("[") (ex_abi 0.5.9) lib/abi/function_selector.ex:318: ABI.FunctionSelector.parse_specification_type/1 (elixir 1.12.3) lib/enum.ex:1582: Enum."-map/2-lists^map/1-0-"/2 (ex_abi 0.5.9) lib/abi/function_selector.ex:174: ABI.FunctionSelector.parse_specification_item/1 (elixir 1.12.3) lib/enum.ex:1582: Enum."-map/2-lists^map/1-0-"/2 (ex_abi 0.5.9) lib/abi.ex:198: ABI.parse_specification/2 test/explorer/smart_contract/reader_test.exs:405: (test)
The text was updated successfully, but these errors were encountered:
@eruizgar91 hello can you please check if https://github.com/poanetwork/ex_abi/pull/89/files works for you
Sorry, something went wrong.
Yes @ayrat555 , it's working fine! Waiting for a new release. Thank you.
Successfully merging a pull request may close this issue.
Currently there are not support for multidimensional tuple arrays, so when an abi contents a type like this
tuple[][]
is trying to parse it as if having a fixed length https://github.com/poanetwork/ex_abi/blob/master/lib/abi/function_selector.ex#L318 and generating an error.It's posible to reproduce running this test:
The error produced is:
The text was updated successfully, but these errors were encountered: