provide vm_memory as import/export wrapper
details: moved original vm/memory.nim => vm/nvm_memory.nim
This commit is contained in:
parent
7b5d00307c
commit
cf63b9b03f
|
@ -10,7 +10,7 @@ import
|
||||||
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],
|
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, opcode_values, nvm_forks],
|
||||||
vm/[memory, stack, code_stream, nvm_computation, nvm_state, nvm_types],
|
vm/[nvm_memory, stack, code_stream, nvm_computation, nvm_state, nvm_types],
|
||||||
errors, constants,
|
errors, constants,
|
||||||
db/[db_chain, accounts_cache]
|
db/[db_chain, accounts_cache]
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
import
|
import
|
||||||
macros, strformat, stint, eth/common,
|
macros, strformat, stint, eth/common,
|
||||||
vm/[nvm_computation, stack, code_stream, memory],
|
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, opcode_values],
|
||||||
vm/interpreter/utils/utils_numeric
|
vm/interpreter/utils/utils_numeric
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import
|
||||||
sets, eth/[common, keys],
|
sets, eth/[common, keys],
|
||||||
constants, errors,
|
constants, errors,
|
||||||
vm/interpreter/[opcode_values, gas_meter, nvm_gas_costs, nvm_forks],
|
vm/interpreter/[opcode_values, gas_meter, nvm_gas_costs, nvm_forks],
|
||||||
vm/[code_stream, memory, nvm_message, stack, nvm_types, nvm_state],
|
vm/[code_stream, nvm_memory, nvm_message, stack, nvm_types, nvm_state],
|
||||||
db/[accounts_cache, db_chain],
|
db/[accounts_cache, db_chain],
|
||||||
utils/header, nvm_precompiles,
|
utils/header, nvm_precompiles,
|
||||||
transaction_tracer, utils
|
transaction_tracer, utils
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
import
|
import
|
||||||
tables, eth/common,
|
tables, eth/common,
|
||||||
options, json, sets,
|
options, json, sets,
|
||||||
vm/[memory, stack, code_stream],
|
vm/[nvm_memory, stack, code_stream],
|
||||||
vm/interpreter/[nvm_gas_costs, opcode_values, nvm_forks],
|
vm/interpreter/[nvm_gas_costs, opcode_values, nvm_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]
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import
|
import
|
||||||
json, strutils, sets, hashes,
|
json, strutils, sets, hashes,
|
||||||
chronicles, nimcrypto, eth/common, stint,
|
chronicles, nimcrypto, eth/common, stint,
|
||||||
vm/nvm_types, memory, vm/stack, db/accounts_cache,
|
vm/[nvm_types, nvm_memory, stack], db/accounts_cache,
|
||||||
eth/trie/hexary,
|
eth/trie/hexary,
|
||||||
vm/interpreter/opcode_values
|
vm/interpreter/opcode_values
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
# Wrapper for a wrapper -- lol
|
||||||
|
|
||||||
|
# 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/nvm_memory as vmm
|
||||||
|
|
||||||
|
export
|
||||||
|
vmm.Memory,
|
||||||
|
vmm.extend,
|
||||||
|
vmm.len,
|
||||||
|
vmm.newMemory,
|
||||||
|
vmm.read,
|
||||||
|
vmm.write
|
||||||
|
|
||||||
|
when defined(evmc_enabled):
|
||||||
|
export
|
||||||
|
vmm.readPtr
|
||||||
|
|
||||||
|
# End
|
|
@ -6,10 +6,10 @@ import
|
||||||
|
|
||||||
import
|
import
|
||||||
options, json, os, eth/trie/[db, hexary],
|
options, json, os, eth/trie/[db, hexary],
|
||||||
../nimbus/[vm_state, vm_types, transaction, utils],
|
../nimbus/[transaction, utils],
|
||||||
../nimbus/db/[db_chain, accounts_cache],
|
../nimbus/db/[db_chain, accounts_cache],
|
||||||
../nimbus/[vm_computation, vm_state_transactions, vm_forks, vm_message],
|
../nimbus/[vm_computation, vm_state_transactions, vm_forks,
|
||||||
../nimbus/vm/memory
|
vm_message, vm_memory, vm_state, vm_types]
|
||||||
|
|
||||||
export opcode_values, byteutils
|
export opcode_values, byteutils
|
||||||
{.experimental: "dynamicBindSym".}
|
{.experimental: "dynamicBindSym".}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
import
|
import
|
||||||
unittest2, sequtils,
|
unittest2, sequtils,
|
||||||
eth/common/eth_types,
|
eth/common/eth_types,
|
||||||
../nimbus/[errors, vm/memory]
|
../nimbus/[errors, vm_memory]
|
||||||
|
|
||||||
proc memory32: Memory =
|
proc memory32: Memory =
|
||||||
result = newMemory()
|
result = newMemory()
|
||||||
|
|
Loading…
Reference in New Issue