only import evmc files when 'evmc_enabled' defined

This commit is contained in:
andri lim 2020-01-17 21:54:28 +07:00 committed by zah
parent 4aa209113a
commit c459879647
4 changed files with 19 additions and 6 deletions

View File

@ -12,7 +12,10 @@ import
./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,
transaction_tracer, evmc/evmc, evmc_helpers, evmc_api
transaction_tracer
when defined(evmc_enabled):
import evmc/evmc, evmc_helpers, evmc_api
logScope:
topics = "vm computation"
@ -379,4 +382,6 @@ proc prepareTracer*(c: Computation) =
c.vmState.tracer.prepare(c.msg.depth)
include interpreter_dispatch
include evmc_host
when defined(evmc_enabled):
include evmc_host

View File

@ -12,7 +12,10 @@ import
./gas_meter, ./gas_costs, ./opcode_values, ./vm_forks,
../memory, ../message, ../stack, ../code_stream, ../computation,
../../vm_state, ../../errors, ../../constants, ../../vm_types,
../../db/[db_chain, state_db], ../../utils, ../evmc_api, ../evmc_helpers
../../db/[db_chain, state_db], ../../utils
when defined(evmc_enabled):
import ../evmc_api, ../evmc_helpers
logScope:
topics = "opcode impl"

View File

@ -13,8 +13,10 @@ import
../../computation, ../../stack, ../../code_stream,
../../../vm_types, ../../memory,
../../../errors, ../../message, ../../interpreter/[gas_meter, opcode_values],
../../interpreter/utils/utils_numeric,
../../evmc_api, evmc/evmc
../../interpreter/utils/utils_numeric
when defined(evmc_enabled):
import ../../evmc_api, evmc/evmc
proc pop(tree: var NimNode): NimNode =
## Returns the last value of a NimNode and remove it

View File

@ -8,10 +8,13 @@
import
tables, eth/common, eth/trie/db,
options, json, sets,
./vm/[memory, stack, code_stream, evmc_api],
./vm/[memory, stack, code_stream],
./vm/interpreter/[gas_costs, opcode_values, vm_forks], # TODO - will be hidden at a lower layer
./db/[db_chain, state_db]
when defined(evmc_enabled):
import ./vm/evmc_api
type
BaseVMState* = ref object of RootObj
prevHeaders* : seq[BlockHeader]