fix evmc compilation issue

This commit is contained in:
jangko 2020-03-09 17:20:08 +07:00 committed by andri lim
parent 266e0ddb1e
commit b5850ca748
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
3 changed files with 6 additions and 6 deletions

View File

@ -11,7 +11,7 @@ import
../constants, ../errors, ../vm_state, ../vm_types,
./interpreter/[opcode_values, gas_meter, gas_costs, vm_forks],
./code_stream, ./memory, ./message, ./stack, ../db/[state_db, db_chain],
../utils/header, stew/[byteutils, ranges], precompiles,
../utils/header, stew/[byteutils, ranges, ranges/ptr_arith], precompiles,
transaction_tracer, ../utils
when defined(evmc_enabled):

View File

@ -116,7 +116,7 @@ proc hostEmitLogImpl(ctx: Computation, address: EthAddress,
for i in 0 ..< topicsCount:
log.topics[i] = topics[i].bytes
log.data = @makeOpenArray(data, dataSize)
log.data = @(makeOpenArray(data, dataSize))
log.address = address
ctx.addLogEntry(log)
@ -128,7 +128,7 @@ template createImpl(c: Computation, m: nimbus_message, res: nimbus_result) =
gas: m.gas,
sender: m.sender,
value: Uint256.fromEvmc(m.value),
data: @makeOpenArray(m.inputData, m.inputSize.int)
data: @(makeOpenArray(m.inputData, m.inputSize.int))
)
let child = newComputation(c.vmState, childMsg, Uint256.fromEvmc(m.create2_salt))
@ -159,7 +159,7 @@ template callImpl(c: Computation, m: nimbus_message, res: nimbus_result) =
codeAddress: m.destination,
contractAddress: if m.kind == EVMC_CALL: m.destination else: c.msg.contractAddress,
value: Uint256.fromEvmc(m.value),
data: @makeOpenArray(m.inputData, m.inputSize.int)
data: @(makeOpenArray(m.inputData, m.inputSize.int)),
flags: MsgFlags(m.flags)
)

View File

@ -614,7 +614,7 @@ template genCreate(callName: untyped, opCode: Op): untyped =
)
var res = c.host.call(msg)
c.returnData = @makeOpenArray(res.outputData, res.outputSize.int)
c.returnData = @(makeOpenArray(res.outputData, res.outputSize.int))
c.gasMeter.returnGas(res.gas_left)
if res.status_code == EVMC_SUCCESS:
@ -780,7 +780,7 @@ template genCall(callName: untyped, opCode: Op): untyped =
)
var res = c.host.call(msg)
c.returnData = @makeOpenArray(res.outputData, res.outputSize.int)
c.returnData = @(makeOpenArray(res.outputData, res.outputSize.int))
let actualOutputSize = min(memOutLen, c.returnData.len)
if actualOutputSize > 0: