Moch test for eth_call but needs working header fetching

This commit is contained in:
coffeepots 2018-11-26 18:16:58 +00:00
parent 0899634b6d
commit 3557567a1b
1 changed files with 9 additions and 2 deletions

View File

@ -1,7 +1,7 @@
import
unittest, json, strformat, nimcrypto, rlp,
unittest, json, strformat, nimcrypto, rlp, options,
json_rpc/[rpcserver, rpcclient],
../nimbus/rpc/[common, p2p, hexstrings],
../nimbus/rpc/[common, p2p, hexstrings, rpc_types],
../nimbus/constants,
../nimbus/nimbus/[vm_state, config],
../nimbus/db/[state_db, db_chain], eth_common, byteutils,
@ -68,6 +68,13 @@ proc doTests =
waitFor client.connect("localhost", Port(8545))
suite "Remote Procedure Calls":
# TODO: Currently returning 'block not found' when fetching header in p2p, so cannot perform tests
test "eth_call":
let
blockNum = state.blockheader.blockNumber
callParams = EthCall(value: some(100.u256))
var r = waitFor client.eth_call(callParams, "0x" & blockNum.toHex)
echo r
test "eth_getBalance":
expect ValueError:
# check error is raised on null address