From e4db21272cc77aff7e819508e329cf60f53dc920 Mon Sep 17 00:00:00 2001 From: andri lim Date: Thu, 9 Jan 2020 18:11:26 +0700 Subject: [PATCH] fixes rpc/p2p.nim compilation error --- nimbus/rpc/p2p.nim | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/nimbus/rpc/p2p.nim b/nimbus/rpc/p2p.nim index 2059a4427..16d34dc16 100644 --- a/nimbus/rpc/p2p.nim +++ b/nimbus/rpc/p2p.nim @@ -277,21 +277,22 @@ proc setupEthRpc*(node: EthereumNode, chain: BaseChainDB, rpcsrv: RpcServer) = sender, destination: EthAddress, gasLimit, gasPrice: GasInt, contractCreation: bool): BaseComputation = - #let - # # Handle optional defaults. - # message = newMessage( - # gas = gasLimit, - # gasPrice = gasPrice, - # to = destination, - # sender = sender, - # value = value, - # data = data, - # code = vmState.readOnlyStateDB.getCode(destination).toSeq, - # contractCreation = contractCreation, - # options = newMessageOptions(origin = sender, - # createAddress = destination)) - # - #result = newBaseComputation(vmState, blockNumber, message) + let + # Handle optional defaults. + message = Message( + kind: if contractCreation: evmcCreate else: evmcCall, + depth: 0, + gas: gasLimit, + gasPrice: gasPrice, + origin: sender, + sender: sender, + contractAddress: destination, + codeAddress: CREATE_CONTRACT_ADDRESS, + value: value, + data: data, + code: vmState.readOnlyStateDB.getCode(destination).toSeq + ) + result = newBaseComputation(vmState, blockNumber, message) rpcsrv.rpc("eth_call") do(call: EthCall, quantityTag: string) -> HexDataStr: ## Executes a new message call immediately without creating a transaction on the block chain.