fix evmc compilation issue
This commit is contained in:
parent
266e0ddb1e
commit
b5850ca748
|
@ -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):
|
||||
|
|
|
@ -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)
|
||||
)
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue