Skip to content

Commit

Permalink
provide vm_opcode_values as import/export wrapper
Browse files Browse the repository at this point in the history
details:
  moved original vm/interpreter/opcode_values.nim => vm/interpreter/nvm_opcode_values.nim
  • Loading branch information
mjfh committed Mar 31, 2021
1 parent cf63b9b commit 99568c9
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 12 deletions.
2 changes: 1 addition & 1 deletion nimbus/vm/code_stream.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import
chronicles, strformat, strutils, sequtils, parseutils, sets, macros,
eth/common,
vm/interpreter/opcode_values
vm/interpreter/nvm_opcode_values

logScope:
topics = "vm code_stream"
Expand Down
2 changes: 1 addition & 1 deletion nimbus/vm/interpreter/nvm_gas_costs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import
math, eth/common/eth_types,
vm/interpreter/utils/[macros_gen_opcodes, utils_numeric],
vm/interpreter/[opcode_values, nvm_forks], errors
vm/interpreter/[nvm_opcode_values, nvm_forks], errors

when defined(evmc_enabled):
import evmc/evmc
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion nimbus/vm/interpreter/opcodes_impl.nim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import
strformat, times, sets, sequtils, options,
chronicles, stint, nimcrypto, stew/ranges/ptr_arith, eth/common,
vm/interpreter/utils/[macros_procs_opcodes, utils_numeric],
vm/interpreter/[gas_meter, nvm_gas_costs, opcode_values, nvm_forks],
vm/interpreter/[gas_meter, nvm_gas_costs, nvm_opcode_values, nvm_forks],
vm/[nvm_memory, stack, code_stream, nvm_computation, nvm_state, nvm_types],
errors, constants,
db/[db_chain, accounts_cache]
Expand Down
2 changes: 1 addition & 1 deletion nimbus/vm/interpreter/utils/macros_procs_opcodes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import
macros, strformat, stint, eth/common,
vm/[nvm_computation, stack, code_stream, nvm_memory],
vm/nvm_types, errors, vm/interpreter/[gas_meter, opcode_values],
vm/nvm_types, errors, vm/interpreter/[gas_meter, nvm_opcode_values],
vm/interpreter/utils/utils_numeric

when defined(evmc_enabled):
Expand Down
2 changes: 1 addition & 1 deletion nimbus/vm/interpreter_dispatch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import
tables, macros,
chronicles,
vm/interpreter/[opcode_values, opcodes_impl, nvm_forks, nvm_gas_costs, gas_meter, utils/macros_gen_opcodes],
vm/interpreter/[nvm_opcode_values, opcodes_impl, nvm_forks, nvm_gas_costs, gas_meter, utils/macros_gen_opcodes],
vm/code_stream, vm/nvm_types, errors, nvm_precompiles, vm/stack,
terminal # Those are only needed for logging

Expand Down
2 changes: 1 addition & 1 deletion nimbus/vm/nvm_computation.nim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import
chronicles, strformat, macros, options, times,
sets, eth/[common, keys],
constants, errors,
vm/interpreter/[opcode_values, gas_meter, nvm_gas_costs, nvm_forks],
vm/interpreter/[nvm_opcode_values, gas_meter, nvm_gas_costs, nvm_forks],
vm/[code_stream, nvm_memory, nvm_message, stack, nvm_types, nvm_state],
db/[accounts_cache, db_chain],
utils/header, nvm_precompiles,
Expand Down
4 changes: 2 additions & 2 deletions nimbus/vm/nvm_interpreter.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
# at your option. This file may not be copied, modified, or distributed except according to those terms.

import
vm/interpreter/[opcode_values, gas_meter, nvm_forks]
vm/interpreter/[nvm_opcode_values, gas_meter, nvm_forks]

import # Used in vm_types. Beware of recursive dependencies
vm/[code_stream, nvm_computation, stack, nvm_message]

export
opcode_values, gas_meter,
nvm_opcode_values, gas_meter,
nvm_forks

export
Expand Down
2 changes: 1 addition & 1 deletion nimbus/vm/nvm_types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import
tables, eth/common,
options, json, sets,
vm/[nvm_memory, stack, code_stream],
vm/interpreter/[nvm_gas_costs, opcode_values, nvm_forks],
vm/interpreter/[nvm_gas_costs, nvm_opcode_values, nvm_forks],
# TODO - will be hidden at a lower layer
db/[db_chain, accounts_cache]

Expand Down
2 changes: 1 addition & 1 deletion nimbus/vm/transaction_tracer.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import
chronicles, nimcrypto, eth/common, stint,
vm/[nvm_types, nvm_memory, stack], db/accounts_cache,
eth/trie/hexary,
vm/interpreter/opcode_values
vm/interpreter/nvm_opcode_values

logScope:
topics = "vm opcode"
Expand Down
19 changes: 19 additions & 0 deletions nimbus/vm_opcode_values.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Nimbus
# Copyright (c) 2018 Status Research & Development GmbH
# Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
# https://www.apache.org/licenses/LICENSE-2.0)
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or
# https://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except
# according to those terms.

# At the moment, this header file interface is only used for testing, so it
# might be worth merging it into a vm_internals.nim (or so) header file.
import
./vm/interpreter/nvm_opcode_values as vmo

export
vmo.Op

# End
4 changes: 2 additions & 2 deletions tests/macro_assembler.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import
macrocache, strutils, unittest2,
stew/byteutils, chronicles, eth/common,
../nimbus/vm/interpreter/opcode_values,
../nimbus/vm_opcode_values,
stew/shims/macros, ../nimbus/config

import
Expand All @@ -11,7 +11,7 @@ import
../nimbus/[vm_computation, vm_state_transactions, vm_forks,
vm_message, vm_memory, vm_state, vm_types]

export opcode_values, byteutils
export vm_opcode_values, byteutils
{.experimental: "dynamicBindSym".}

# backported from Nim 0.19.9
Expand Down

0 comments on commit 99568c9

Please sign in to comment.