Skip to content
New issue

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

Handle static array while encode contract call #10011

Open
sl1depengwyn opened this issue May 2, 2024 · 0 comments
Open

Handle static array while encode contract call #10011

sl1depengwyn opened this issue May 2, 2024 · 0 comments

Comments

@sl1depengwyn
Copy link
Collaborator

https://github.com/blockscout/blockscout/blob/master/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/encoder.ex#L28

binding() #=> [args: [[1], [2], [3]], types: {:array, {:array, {:int, 256}}, 3}]

2024-05-02T19:32:16.576 [error] #PID<0.30508.2> running BlockScoutWeb.Endpoint (connection #PID<0.30507.2>, stream id 1) terminated
Server: 127.0.0.1:4000 (http)
Request: POST /api/v2/smart-contracts/0xad1df93A0b970948ADAdA62b0be145b8aC261736/query-read-method?is_custom_abi=false
** (exit) an exception was raised:
    ** (Protocol.UndefinedError) protocol Enumerable not implemented for {:array, {:array, {:int, 256}}, 3} of type Tuple
        (elixir 1.14.5) lib/enum.ex:1: Enumerable.impl_for!/1
        (elixir 1.14.5) lib/enum.ex:166: Enumerable.reduce/3
        (stdlib 4.3.1.3) lists.erl:1442: :lists.foreach_1/2
        (elixir 1.14.5) lib/stream.ex:1371: Stream.do_zip_enum/4
        (elixir 1.14.5) lib/enum.ex:3983: Enum.zip_reduce/3
        (elixir 1.14.5) lib/enum.ex:3837: Enum.zip/1
        (ethereum_jsonrpc 6.5.0) lib/ethereum_jsonrpc/encoder.ex:35: EthereumJSONRPC.Encoder.parse_args/2
        (elixir 1.14.5) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
        (ethereum_jsonrpc 6.5.0) lib/ethereum_jsonrpc/encoder.ex:16: EthereumJSONRPC.Encoder.encode_function_call/2
        (ethereum_jsonrpc 6.5.0) lib/ethereum_jsonrpc/contract.ex:52: anonymous fn/2 in EthereumJSONRPC.Contract.execute_contract_functions/4
        (elixir 1.14.5) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
        (ethereum_jsonrpc 6.5.0) lib/ethereum_jsonrpc/contract.ex:43: EthereumJSONRPC.Contract.execute_contract_functions/4
        (explorer 6.5.0) lib/explorer/smart_contract/reader.ex:191: Explorer.SmartContract.Reader.query_contracts/5
        (explorer 6.5.0) lib/explorer/smart_contract/reader.ex:156: Explorer.SmartContract.Reader.query_contract_inner/7
        (explorer 6.5.0) lib/explorer/smart_contract/reader.ex:98: Explorer.SmartContract.Reader.query_verified_contract_inner/6
        (explorer 6.5.0) lib/explorer/smart_contract/reader.ex:628: Explorer.SmartContract.Reader.query_contract_and_link_outputs/8
        (explorer 6.5.0) lib/explorer/smart_contract/reader.ex:586: Explorer.SmartContract.Reader.query_function_with_custom_abi_inner/7
        (explorer 6.5.0) lib/explorer/smart_contract/reader.ex:416: Explorer.SmartContract.Reader.query_function_with_names/7
        (block_scout_web 6.5.0) lib/block_scout_web/controllers/api/v2/smart_contract_controller.ex:173: BlockScoutWeb.API.V2.SmartContractController.query_read_method/2
        (block_scout_web 6.5.0) lib/block_scout_web/controllers/api/v2/smart_contract_controller.ex:1: BlockScoutWeb.API.V2.SmartContractController.action/2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant