remove relative paths ./ and ../ from import section

why:
  relative paths make sources inherently non-relocatable

details:
  import base is set to the nimbus directoy, so importing ./stack
  from file interpreter.nim becomes vm/stack etc.

caveat:
   a file named nimbus/strformat.nim would clash with strformat (but
   not with std/strformat)
This commit is contained in:
Jordan Hrycaj 2021-03-30 17:20:43 +01:00
parent 6d2b7ad6da
commit a3db0f41d8
No known key found for this signature in database
GPG Key ID: 4101B9BC5A0DB080
18 changed files with 42 additions and 42 deletions

1
nim.cfg Normal file
View File

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

View File

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

View File

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

View File

@ -5,7 +5,7 @@
# * 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.
import evmc/evmc, evmc_helpers, eth/common, ../constants
import evmc/evmc, vm/evmc_helpers, eth/common, constants
type
# we are not using EVMC original signature here

View File

@ -6,11 +6,10 @@
# at your option. This file may not be copied, modified, or distributed except according to those terms.
import
./interpreter/[opcode_values, gas_meter],
./interpreter/vm_forks
vm/interpreter/[opcode_values, gas_meter, vm_forks]
import # Used in vm_types. Beware of recursive dependencies
./code_stream, ./computation, ./stack, ./message
vm/[code_stream, computation, stack, message]
export
opcode_values, gas_meter,

View File

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

View File

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

View File

@ -5,7 +5,7 @@
# * 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.
import ./utils/macros_gen_opcodes
import vm/interpreter/utils/macros_gen_opcodes
fill_enum_holes:
type

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -5,7 +5,7 @@
# * 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.
import ../vm_types
import vm_types
proc isCreate*(message: Message): bool =
message.kind in {evmcCreate, evmcCreate2}

View File

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

View File

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

View File

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

View File

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