fixes rpc/p2p.nim compilation error

This commit is contained in:
andri lim 2020-01-09 18:11:26 +07:00 committed by zah
parent d30f434f03
commit e4db21272c
1 changed files with 16 additions and 15 deletions

View File

@ -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.