merge vm_forks and vm_opcode_values => vm_type2

why:
  all types, but they cannot be merged int vm_types because of a circular
  dependency.
This commit is contained in:
Jordan Hrycaj 2021-03-31 17:53:15 +01:00
parent 9e365734e6
commit 00ba7a2718
No known key found for this signature in database
GPG Key ID: 4101B9BC5A0DB080
17 changed files with 27 additions and 41 deletions

View File

@ -12,7 +12,7 @@ import
chronos, eth/[keys, common, p2p, net/nat], chronicles, nimcrypto/hash,
eth/p2p/bootnodes, eth/p2p/rlpx_protocols/whisper_protocol,
./db/select_backend, eth/keys,
./vm_forks
./vm_types2
const
NimbusName* = "Nimbus"

View File

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

View File

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

View File

@ -15,7 +15,7 @@ import
../transaction, ../config, ../vm_state, ../constants, ../vm_types,
../utils, ../db/[db_chain, state_db],
rpc_types, rpc_utils, ../vm_message, ../vm_computation,
../vm_forks
../vm_types2
#[
Note:

View File

@ -10,7 +10,7 @@
import hexstrings, eth/[common, rlp, keys, trie/db], stew/byteutils, nimcrypto,
../db/[db_chain, accounts_cache], strutils, algorithm, options, times, json,
../constants, stint, hexstrings, rpc_types, ../config,
../vm_state_transactions, ../vm_state, ../vm_types, ../vm_forks,
../vm_state_transactions, ../vm_state, ../vm_types, ../vm_types2,
../vm_computation, ../p2p/executor, ../utils, ../transaction
type

View File

@ -3,7 +3,7 @@ import
constants, vm_state, vm_types, transaction, p2p/executor,
eth/trie/db, nimcrypto, strutils,
chronicles, rpc/hexstrings, launcher,
./vm_forks, ./config
./vm_types2, ./config
when defined(geth):
import db/geth_db

View File

@ -7,7 +7,7 @@
import
./constants, ./errors, eth/[common, keys], ./utils,
./vm_forks, ./vm_gas_costs
./vm_types2, ./vm_gas_costs
import eth/common/transaction as common_transaction
export common_transaction

View File

@ -28,6 +28,7 @@ import
export
vmm.isCreate
# Used in vm_types. Beware of recursive dependencies
# see vm_computation
import
@ -77,8 +78,6 @@ export
vmc.writeContract
# Used in vm_types. Beware of recursive dependencies
import
vm/interpreter/gas_meter as gmt
export

View File

@ -1,19 +0,0 @@
# Nimbus
# Copyright (c) 2018 Status Research & Development GmbH
# Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
# http://www.apache.org/licenses/LICENSE-2.0)
# * 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.
# This should really go into vm_types once the circular computation.nim
# include/import dependency is solved
import
./vm/interpreter/vm_forks as vmf
export
vmf.Fork
# End

View File

@ -8,7 +8,9 @@
# at your option. This file may not be copied, modified, or distributed except
# according to those terms.
# Should be considered part of another header file (e.h. vm_misc)
# Should be considered part of another header file (e.g. vm_misc) once the circular
# computation.nim include/import dependency is solved. The problem is with
# vm_types.nim (included by message.nim) which includes computation.nim.
import
./vm/message as vmm

View File

@ -8,12 +8,17 @@
# 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.
# The following should really go into vm_types once the circular computation.nim
# include/import dependency is solved. The problem is with vm_types.nim which
# includes computation.nim.
import
./vm/interpreter/vm_forks as vmf
export
vmf.Fork
import
./vm/interpreter/opcode_values as vmo
export
vmo.Op
# End

View File

@ -1,17 +1,16 @@
import
macrocache, strutils, unittest2,
stew/byteutils, chronicles, eth/common,
../nimbus/vm_opcode_values,
stew/shims/macros, ../nimbus/config
import
options, json, os, eth/trie/[db, hexary],
../nimbus/[transaction, utils],
../nimbus/db/[db_chain, accounts_cache],
../nimbus/[vm_computation, vm_state_transactions, vm_forks,
../nimbus/[vm_computation, vm_state_transactions, vm_types2,
vm_message, vm_memory, vm_state, vm_types]
export vm_opcode_values, byteutils
export vm_types2, byteutils
{.experimental: "dynamicBindSym".}
# backported from Nim 0.19.9

View File

@ -12,7 +12,7 @@ import
ethash, stew/endians2, nimcrypto,
./test_helpers, ./test_allowed_to_fail,
../premix/parser, test_config,
../nimbus/[vm_state, utils, vm_types, errors, transaction, constants, vm_forks],
../nimbus/[vm_state, utils, vm_types, errors, transaction, constants, vm_types2],
../nimbus/db/[db_chain, accounts_cache],
../nimbus/utils/header,
../nimbus/p2p/[executor, dao],

View File

@ -1,6 +1,6 @@
import
parseopt, strutils,
../nimbus/vm_forks
../nimbus/vm_types2
type
ConfigStatus* = enum

View File

@ -1,7 +1,7 @@
import unittest2, strutils, tables, os, json,
../nimbus/utils/difficulty, stint, times,
eth/common, test_helpers, stew/byteutils,
../nimbus/constants, ../nimbus/vm_forks,
../nimbus/constants, ../nimbus/vm_types2,
../nimbus/config
type

View File

@ -10,7 +10,7 @@ import
stew/byteutils, net, eth/[common, keys, rlp, p2p], unittest2,
testutils/markdown_reports,
../nimbus/[config, transaction, utils, errors],
../nimbus/vm_forks,
../nimbus/vm_types2,
../nimbus/db/accounts_cache,
../nimbus/random_keys

View File

@ -8,7 +8,7 @@
import
unittest2, ../nimbus/vm_precompiles, json, stew/byteutils, test_helpers, os, tables,
strformat, strutils, eth/trie/db, eth/common, ../nimbus/db/db_chain,
../nimbus/[vm_computation, vm_types, vm_state, vm_forks], macros,
../nimbus/[vm_computation, vm_types, vm_state, vm_types2], macros,
test_allowed_to_fail
proc initAddress(i: byte): EthAddress = result[19] = i