status-im/nim-web3

Some errors and possible bugs in the `provider`

Closed this issue · 0 comments

eth_getStorageAt

eth_getStorageAt causes a ValueError when run.

See test

[Suite] /Users/will/Status/src/nim-web3/tests/execution-apis/tests/eth_getStorage /Users/will/.nimble/pkgs/unittest2-0.0.4/unittest2.nim(848) test_execution_api /Users/will/Status/src/nim-web3/tests/test_execution_api.nim(508) runTest`gensym958 /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(1127) waitFor /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(288) poll /Users/will/.nimble/pkgs/json_rpc-0.0.2/json_rpc/jsonmarshal.nim(214) eth_getStorageAt /Users/will/.nimble/pkgs/json_rpc-0.0.2/json_rpc/jsonmarshal.nim(148) unpackArg /Users/will/.nimble/pkgs/json_rpc-0.0.2/json_rpc/jsonmarshal.nim(131) fromJson /Users/will/.nimble/pkgs/stew-#head/stew/byteutils.nim(149) hexToSeqByte [[reraised from: /Users/will/.nimble/pkgs/unittest2-0.0.4/unittest2.nim(848) test_execution_api /Users/will/Status/src/nim-web3/tests/test_execution_api.nim(508) runTest`gensym958 /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(1127) waitFor /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(288) poll /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncmacro2.nim(288) test_eth_getStorageAt /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncfutures2.nim(501) internalCheckComplete ]] [[reraised from: /Users/will/.nimble/pkgs/unittest2-0.0.4/unittest2.nim(848) test_execution_api /Users/will/Status/src/nim-web3/tests/test_execution_api.nim(508) runTest`gensym958 /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(1127) waitFor /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(288) poll /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncmacro2.nim(288) call_api /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncfutures2.nim(501) internalCheckComplete ]] [[reraised from: /Users/will/.nimble/pkgs/unittest2-0.0.4/unittest2.nim(848) test_execution_api /Users/will/Status/src/nim-web3/tests/test_execution_api.nim(508) runTest`gensym958 /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(1127) waitFor /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(288) poll /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncmacro2.nim(288) do_test /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncfutures2.nim(501) internalCheckComplete ]] [[reraised from: /Users/will/.nimble/pkgs/unittest2-0.0.4/unittest2.nim(848) test_execution_api /Users/will/Status/src/nim-web3/tests/test_execution_api.nim(508) runTest`gensym958 /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(1129) waitFor /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncfutures2.nim(515) read /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncfutures2.nim(501) internalCheckComplete ]]
Unhandled exception: hex string must have even length [ValueError]

[FAILED] eth_getStorageAt

eth_estimateGas

eth_estimateGas causes an IndexError. I have been unable to narrow this down so far so the test remains commented.

See test

[Suite] /Users/will/Status/src/nim-web3/tests/execution-apis/tests/eth_estimateGas
/Users/will/.nimble/pkgs/unittest2-0.0.4/unittest2.nim(848) test_execution_api
/Users/will/Status/src/nim-web3/tests/test_execution_api.nim(508) runTestgensym958 /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(1127) waitFor /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(288) poll /Users/will/Status/src/nim-web3/tests/test_execution_api.nim(503) do_test /Users/will/Status/src/nim-web3/tests/test_execution_api.nim(451) call_api /Users/will/Status/src/nim-web3/tests/test_execution_api.nim(166) test_eth_estimateGas /Users/will/Status/src/nim-web3/tests/test_execution_api.nim(84) getParamBlockIdentifier /Users/will/Status/src/nim-web3/tests/test_execution_api.nim(56) getParamStr /Users/will/Status/src/nim-web3/tests/test_execution_api.nim(53) getParam /usr/local/Cellar/nim/1.6.6/nim/lib/pure/json.nim(525) [] /usr/local/Cellar/nim/1.6.6/nim/lib/system/fatal.nim(53) sysFatal [[reraised from: /Users/will/.nimble/pkgs/unittest2-0.0.4/unittest2.nim(848) test_execution_api /Users/will/Status/src/nim-web3/tests/test_execution_api.nim(508) runTestgensym958
/Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(1127) waitFor
/Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(288) poll
/Users/will/Status/src/nim-web3/tests/test_execution_api.nim(503) do_test
/Users/will/Status/src/nim-web3/tests/test_execution_api.nim(451) call_api
]]
[[reraised from:
/Users/will/.nimble/pkgs/unittest2-0.0.4/unittest2.nim(848) test_execution_api
/Users/will/Status/src/nim-web3/tests/test_execution_api.nim(508) runTestgensym958 /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(1127) waitFor /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(288) poll /Users/will/Status/src/nim-web3/tests/test_execution_api.nim(503) do_test ]] [[reraised from: /Users/will/.nimble/pkgs/unittest2-0.0.4/unittest2.nim(848) test_execution_api /Users/will/Status/src/nim-web3/tests/test_execution_api.nim(508) runTestgensym958
/Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(1127) waitFor
/Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(288) poll
]]

Unhandled exception: index 1 not in 0 .. 0 [IndexDefect]

[FAILED] eth_estimateGas

eth_getBlockByNumber

eth_getBlockByNumber raises an unhelpful ValueError when the block is not found on the chain.

Since this is a ValueError I would assume this is the correct response?

See test

[Suite] /Users/will/Status/src/nim-web3/tests/execution-apis/tests/eth_getBlockByNumber /Users/will/.nimble/pkgs/unittest2-0.0.4/unittest2.nim(848) test_execution_api /Users/will/Status/src/nim-web3/tests/test_execution_api.nim(508) runTest`gensym958 /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(1127) waitFor /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(288) poll /Users/will/.nimble/pkgs/json_rpc-0.0.2/json_rpc/jsonmarshal.nim(214) eth_getBlockByNumber /Users/will/.nimble/pkgs/json_rpc-0.0.2/json_rpc/jsonmarshal.nim(148) unpackArg /Users/will/.nimble/pkgs/json_rpc-0.0.2/json_rpc/jsonmarshal.nim(70) fromJson /Users/will/.nimble/pkgs/json_rpc-0.0.2/json_rpc/jsonmarshal.nim(9) expect [[reraised from: /Users/will/.nimble/pkgs/unittest2-0.0.4/unittest2.nim(848) test_execution_api /Users/will/Status/src/nim-web3/tests/test_execution_api.nim(508) runTest`gensym958 /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(1127) waitFor /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(288) poll /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncmacro2.nim(288) test_eth_getBlockByNumber /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncfutures2.nim(501) internalCheckComplete ]] [[reraised from: /Users/will/.nimble/pkgs/unittest2-0.0.4/unittest2.nim(848) test_execution_api /Users/will/Status/src/nim-web3/tests/test_execution_api.nim(508) runTest`gensym958 /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(1127) waitFor /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(288) poll /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncmacro2.nim(288) call_api /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncfutures2.nim(501) internalCheckComplete ]] [[reraised from: /Users/will/.nimble/pkgs/unittest2-0.0.4/unittest2.nim(848) test_execution_api /Users/will/Status/src/nim-web3/tests/test_execution_api.nim(508) runTest`gensym958 /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(1127) waitFor /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(288) poll /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncmacro2.nim(288) do_test /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncfutures2.nim(501) internalCheckComplete ]] [[reraised from: /Users/will/.nimble/pkgs/unittest2-0.0.4/unittest2.nim(848) test_execution_api /Users/will/Status/src/nim-web3/tests/test_execution_api.nim(508) runTest`gensym958 /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncloop.nim(1129) waitFor /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncfutures2.nim(515) read /Users/will/.nimble/pkgs/chronos-3.0.11/chronos/asyncfutures2.nim(501) internalCheckComplete ]]
Unhandled exception: Parameter [result] expected JObject but got JNull [ValueError]

[FAILED] eth_getBlockByNumber