reset explicit import paths for local modules

why:
  it was convenient to have relocatable source modules when writing the
  vm interface wrappers. this patch moves it back to the standard.

also:
  there are no deep links into the vm folder anymore which leaves some
  room for manoeuvring inside
This commit is contained in:
Jordan Hrycaj 2021-04-01 12:53:22 +01:00
parent 05bd635da2
commit 827b8c9c81
No known key found for this signature in database
GPG Key ID: 4101B9BC5A0DB080
22 changed files with 55 additions and 56 deletions

View File

@ -1 +0,0 @@
path = nimbus

View File

@ -1,5 +1,5 @@
import ../db/db_chain, eth/common, chronicles, ../vm_state, ../vm_types, import ../db/db_chain, eth/common, chronicles, ../vm_state, ../vm_types,
../vm_computation, ../vm_message, ./vm_types2, stint, nimcrypto, ../vm_computation, ../vm_message, ../vm_types2, stint, nimcrypto,
../utils, eth/trie/db, ./executor, ../config, ../genesis, ../utils, ../utils, eth/trie/db, ./executor, ../config, ../genesis, ../utils,
stew/endians2 stew/endians2

View File

@ -4,7 +4,7 @@ import options, sets,
../utils, ../constants, ../transaction, ../utils, ../constants, ../transaction,
../vm_state, ../vm_types, ../vm_state_transactions, ../vm_state, ../vm_types, ../vm_state_transactions,
../vm_computation, ../vm_message, ../vm_precompiles, ../vm_computation, ../vm_message, ../vm_precompiles,
./vm_types2, ../vm_types2,
./dao, ../config ./dao, ../config
proc processTransaction*(tx: Transaction, sender: EthAddress, vmState: BaseVMState, fork: Fork): GasInt = proc processTransaction*(tx: Transaction, sender: EthAddress, vmState: BaseVMState, fork: Fork): GasInt =

View File

@ -8,7 +8,7 @@
import import
chronicles, strformat, strutils, sequtils, parseutils, sets, macros, chronicles, strformat, strutils, sequtils, parseutils, sets, macros,
eth/common, eth/common,
vm/interpreter/opcode_values ./interpreter/opcode_values
logScope: logScope:
topics = "vm code_stream" topics = "vm code_stream"

View File

@ -8,12 +8,12 @@
import import
chronicles, strformat, macros, options, times, chronicles, strformat, macros, options, times,
sets, eth/[common, keys], sets, eth/[common, keys],
constants, errors, ../constants, ../errors,
vm/interpreter/[opcode_values, gas_meter, gas_costs, vm_forks], ./interpreter/[opcode_values, gas_meter, gas_costs, vm_forks],
vm/[code_stream, memory, message, stack, types, state], ./code_stream, ./memory, ./message, ./stack, ./types, ./state,
db/[accounts_cache, db_chain], ../db/[accounts_cache, db_chain],
utils/header, precompiles, ../utils/header, ./precompiles,
transaction_tracer, utils ./transaction_tracer, ../utils
when defined(chronicles_log_level): when defined(chronicles_log_level):
import stew/byteutils import stew/byteutils

View File

@ -5,7 +5,7 @@
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) # * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except according to those terms. # at your option. This file may not be copied, modified, or distributed except according to those terms.
import evmc/evmc, vm/evmc_helpers, eth/common, constants import evmc/evmc, ./evmc_helpers, eth/common, ../constants
type type
# we are not using EVMC original signature here # we are not using EVMC original signature here

View File

@ -10,21 +10,21 @@
# see vm_opcode_value # see vm_opcode_value
import import
./vm/interpreter/opcode_values as vmo ./interpreter/opcode_values as vmo
export export
vmo.Op vmo.Op
# see vm_forks # see vm_forks
import import
vm/interpreter/vm_forks as vmf ./interpreter/vm_forks as vmf
export export
vmf.Fork vmf.Fork
# see vm_message # see vm_message
import import
./vm/message as vmm ./message as vmm
export export
vmm.isCreate vmm.isCreate
@ -32,7 +32,7 @@ export
# see vm_computation # see vm_computation
import import
./vm/computation as vmc ./computation as vmc
export export
vmc.accountExists, vmc.accountExists,
vmc.addLogEntry, vmc.addLogEntry,
@ -79,7 +79,7 @@ export
import import
vm/interpreter/gas_meter as gmt ./interpreter/gas_meter as gmt
export export
gmt.consumeGas, gmt.consumeGas,
gmt.init, gmt.init,
@ -88,7 +88,7 @@ export
import import
vm/code_stream as cst ./code_stream as cst
export export
cst.CodeStream, cst.CodeStream,
cst.`$`, cst.`$`,
@ -110,7 +110,7 @@ export
import import
vm/stack as stk ./stack as stk
export export
stk.Stack, stk.Stack,
stk.`$`, stk.`$`,

View File

@ -7,8 +7,8 @@
import import
math, eth/common/eth_types, math, eth/common/eth_types,
vm/interpreter/utils/[macros_gen_opcodes, utils_numeric], ./utils/[macros_gen_opcodes, utils_numeric],
vm/interpreter/[opcode_values, vm_forks], errors ./opcode_values, ./vm_forks, ../../errors
when defined(evmc_enabled): when defined(evmc_enabled):
import evmc/evmc import evmc/evmc

View File

@ -7,7 +7,7 @@
import import
chronicles, strformat, eth/common, # GasInt chronicles, strformat, eth/common, # GasInt
errors, vm/types ../../errors, ../types
logScope: logScope:
topics = "vm gas" topics = "vm gas"

View File

@ -5,7 +5,7 @@
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) # * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except according to those terms. # at your option. This file may not be copied, modified, or distributed except according to those terms.
import vm/interpreter/utils/macros_gen_opcodes import ./utils/macros_gen_opcodes
fill_enum_holes: fill_enum_holes:
type type

View File

@ -8,14 +8,14 @@
import import
strformat, times, sets, sequtils, options, strformat, times, sets, sequtils, options,
chronicles, stint, nimcrypto, stew/ranges/ptr_arith, eth/common, chronicles, stint, nimcrypto, stew/ranges/ptr_arith, eth/common,
vm/interpreter/utils/[macros_procs_opcodes, utils_numeric], ./utils/[macros_procs_opcodes, utils_numeric],
vm/interpreter/[gas_meter, gas_costs, opcode_values, vm_forks], ./gas_meter, ./gas_costs, ./opcode_values, ./vm_forks,
vm/[memory, stack, code_stream, computation, state, types], ../memory, ../stack, ../code_stream, ../computation, ../state, ../types,
errors, constants, ../../errors, ../../constants,
db/[db_chain, accounts_cache] ../../db/[db_chain, accounts_cache]
when defined(evmc_enabled): when defined(evmc_enabled):
import vm/evmc_api, vm/evmc_helpers, evmc/evmc import ../evmc_api, ../evmc_helpers, evmc/evmc
logScope: logScope:
topics = "opcode impl" topics = "opcode impl"

View File

@ -10,12 +10,12 @@
import import
macros, strformat, stint, eth/common, macros, strformat, stint, eth/common,
vm/[computation, stack, code_stream, memory], ../../computation, ../../stack, ../../code_stream, ../../memory,
vm/types, errors, vm/interpreter/[gas_meter, opcode_values], ../../types, ../../../errors, ../gas_meter, ../opcode_values,
vm/interpreter/utils/utils_numeric ./utils_numeric
when defined(evmc_enabled): when defined(evmc_enabled):
import vm/evmc_api, evmc/evmc import ../../evmc_api, evmc/evmc
proc pop(tree: var NimNode): NimNode = proc pop(tree: var NimNode): NimNode =
## Returns the last value of a NimNode and remove it ## Returns the last value of a NimNode and remove it

View File

@ -9,7 +9,7 @@ import
macros, macros,
stew/endians2, stew/ranges/ptr_arith, stew/endians2, stew/ranges/ptr_arith,
eth/common/eth_types, eth/common/eth_types,
constants ../../../constants
type type
# cannot use range for unknown reason # cannot use range for unknown reason

View File

@ -8,8 +8,8 @@
import import
tables, macros, tables, macros,
chronicles, chronicles,
vm/interpreter/[opcode_values, opcodes_impl, vm_forks, gas_costs, gas_meter, utils/macros_gen_opcodes], ./interpreter/[opcode_values, opcodes_impl, vm_forks, gas_costs, gas_meter, utils/macros_gen_opcodes],
vm/code_stream, vm/types, errors, precompiles, vm/stack, ./code_stream, ./types, ../errors, ./precompiles, ./stack,
terminal # Those are only needed for logging terminal # Those are only needed for logging
logScope: logScope:

View File

@ -8,8 +8,8 @@
import import
sequtils, sequtils,
chronicles, eth/common/eth_types, chronicles, eth/common/eth_types,
errors, validation, ../errors, ../validation,
vm/interpreter/utils/utils_numeric ./interpreter/utils/utils_numeric
logScope: logScope:
topics = "vm memory" topics = "vm memory"

View File

@ -5,7 +5,7 @@
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) # * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except according to those terms. # at your option. This file may not be copied, modified, or distributed except according to those terms.
import vm/types import ./types
proc isCreate*(message: Message): bool = proc isCreate*(message: Message): bool =
message.kind in {evmcCreate, evmcCreate2} message.kind in {evmcCreate, evmcCreate2}

View File

@ -1,8 +1,8 @@
import import
vm/types, ./types,
vm/interpreter/[gas_meter, gas_costs, utils/utils_numeric, vm_forks], ./interpreter/[gas_meter, gas_costs, utils/utils_numeric, vm_forks],
errors, stint, eth/[keys, common], chronicles, tables, macros, ../errors, stint, eth/[keys, common], chronicles, tables, macros,
math, nimcrypto, bncurve/[fields, groups], vm/blake2b_f, vm/blscurve math, nimcrypto, bncurve/[fields, groups], ./blake2b_f, ./blscurve
type type
PrecompileAddresses* = enum PrecompileAddresses* = enum

View File

@ -7,7 +7,7 @@
import import
chronicles, strformat, strutils, sequtils, macros, eth/common, nimcrypto, chronicles, strformat, strutils, sequtils, macros, eth/common, nimcrypto,
errors, validation ../errors, ../validation
logScope: logScope:
topics = "vm stack" topics = "vm stack"

View File

@ -11,10 +11,10 @@
import import
macros, strformat, tables, sets, options, macros, strformat, tables, sets, options,
eth/[common, keys, rlp], nimcrypto/keccak, eth/[common, keys, rlp], nimcrypto/keccak,
vm/interpreter/[vm_forks, gas_costs], errors, ./interpreter/[vm_forks, gas_costs], ../errors,
constants, db/[db_chain, accounts_cache], ../constants, ../db/[db_chain, accounts_cache],
utils, json, vm/[transaction_tracer, types], ../utils, json, ./transaction_tracer, ./types,
config, ../stateless/[witness_from_tree, witness_types] ../config, ../../stateless/[witness_from_tree, witness_types]
proc newAccessLogs*: AccessLogs = proc newAccessLogs*: AccessLogs =
AccessLogs(reads: initTable[string, string](), writes: initTable[string, string]()) AccessLogs(reads: initTable[string, string](), writes: initTable[string, string]())

View File

@ -7,9 +7,9 @@
import import
options, sets, options, sets,
eth/common, chronicles, db/accounts_cache, eth/common, chronicles, ../db/accounts_cache,
transaction, ../transaction,
vm/[computation, interpreter, state, types] ./computation, ./interpreter, ./state, ./types
proc validateTransaction*(vmState: BaseVMState, tx: Transaction, sender: EthAddress, fork: Fork): bool = proc validateTransaction*(vmState: BaseVMState, tx: Transaction, sender: EthAddress, fork: Fork): bool =
let balance = vmState.readOnlyStateDB.getBalance(sender) let balance = vmState.readOnlyStateDB.getBalance(sender)

View File

@ -1,9 +1,9 @@
import import
json, strutils, sets, hashes, json, strutils, sets, hashes,
chronicles, nimcrypto, eth/common, stint, chronicles, nimcrypto, eth/common, stint,
vm/[types, memory, stack], db/accounts_cache, ./types, ./memory, ./stack, ../db/accounts_cache,
eth/trie/hexary, eth/trie/hexary,
vm/interpreter/opcode_values ./interpreter/opcode_values
logScope: logScope:
topics = "vm opcode" topics = "vm opcode"

View File

@ -11,14 +11,14 @@
import import
tables, eth/common, tables, eth/common,
options, json, sets, options, json, sets,
vm/[memory, stack, code_stream], ./memory, ./stack, ./code_stream,
vm/interpreter/[gas_costs, opcode_values, vm_forks], ./interpreter/[gas_costs, opcode_values, vm_forks],
# TODO - will be hidden at a lower layer # TODO - will be hidden at a lower layer
db/[db_chain, accounts_cache] ../db/[db_chain, accounts_cache]
when defined(evmc_enabled): when defined(evmc_enabled):
import import
./vm/evmc_api ./evmc_api
type type
VMFlag* = enum VMFlag* = enum