diff --git a/nimbus/vm/interpreter/nvm_gas_costs.nim b/nimbus/vm/interpreter/nvm_gas_costs.nim index 0492829c4..088115404 100644 --- a/nimbus/vm/interpreter/nvm_gas_costs.nim +++ b/nimbus/vm/interpreter/nvm_gas_costs.nim @@ -7,7 +7,7 @@ import math, eth/common/eth_types, - vm/interpreter/utils/[macros_gen_opcodes, utils_numeric], + vm/interpreter/utils/[macros_gen_opcodes, nvm_utils_numeric], vm/interpreter/[nvm_opcode_values, nvm_forks], errors when defined(evmc_enabled): diff --git a/nimbus/vm/interpreter/opcodes_impl.nim b/nimbus/vm/interpreter/opcodes_impl.nim index 8fffc39e9..a691f4bcf 100644 --- a/nimbus/vm/interpreter/opcodes_impl.nim +++ b/nimbus/vm/interpreter/opcodes_impl.nim @@ -8,7 +8,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/utils/[macros_procs_opcodes, nvm_utils_numeric], 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, diff --git a/nimbus/vm/interpreter/utils/macros_procs_opcodes.nim b/nimbus/vm/interpreter/utils/macros_procs_opcodes.nim index f474591c4..bc3851a24 100644 --- a/nimbus/vm/interpreter/utils/macros_procs_opcodes.nim +++ b/nimbus/vm/interpreter/utils/macros_procs_opcodes.nim @@ -12,7 +12,7 @@ import macros, strformat, stint, eth/common, vm/[nvm_computation, stack, code_stream, nvm_memory], vm/nvm_types, errors, vm/interpreter/[gas_meter, nvm_opcode_values], - vm/interpreter/utils/utils_numeric + vm/interpreter/utils/nvm_utils_numeric when defined(evmc_enabled): import vm/evmc_api, evmc/evmc diff --git a/nimbus/vm/interpreter/utils/utils_numeric.nim b/nimbus/vm/interpreter/utils/nvm_utils_numeric.nim similarity index 100% rename from nimbus/vm/interpreter/utils/utils_numeric.nim rename to nimbus/vm/interpreter/utils/nvm_utils_numeric.nim diff --git a/nimbus/vm/nvm_memory.nim b/nimbus/vm/nvm_memory.nim index 1d1e55a93..11ea255ea 100644 --- a/nimbus/vm/nvm_memory.nim +++ b/nimbus/vm/nvm_memory.nim @@ -9,7 +9,7 @@ import sequtils, chronicles, eth/common/eth_types, errors, validation, - vm/interpreter/utils/utils_numeric + vm/interpreter/utils/nvm_utils_numeric logScope: topics = "vm memory" diff --git a/nimbus/vm/nvm_precompiles.nim b/nimbus/vm/nvm_precompiles.nim index 1cdd5502c..8695041c9 100644 --- a/nimbus/vm/nvm_precompiles.nim +++ b/nimbus/vm/nvm_precompiles.nim @@ -1,6 +1,6 @@ import vm/nvm_types, - vm/interpreter/[gas_meter, nvm_gas_costs, utils/utils_numeric, nvm_forks], + vm/interpreter/[gas_meter, nvm_gas_costs, utils/nvm_utils_numeric, nvm_forks], errors, stint, eth/[keys, common], chronicles, tables, macros, math, nimcrypto, bncurve/[fields, groups], vm/blake2b_f, vm/blscurve diff --git a/nimbus/vm_utils_numeric.nim b/nimbus/vm_utils_numeric.nim new file mode 100644 index 000000000..5d83a991e --- /dev/null +++ b/nimbus/vm_utils_numeric.nim @@ -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. + +# 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/utils/nvm_utils_numeric as vmn + +export + vmn.GasNatural, + vmn.calcMemSize, + vmn.ceil32, + vmn.cleanMemRef, + vmn.log2, + vmn.log256, + vmn.rangeToPadded, + vmn.rangeToPadded2, + vmn.safeInt, + vmn.setSign, + vmn.toInt, + vmn.wordCount + +# End diff --git a/tests/test_misc.nim b/tests/test_misc.nim index 7629500e4..92d35f270 100644 --- a/tests/test_misc.nim +++ b/tests/test_misc.nim @@ -1,7 +1,7 @@ import unittest2, stew/byteutils, eth/common/eth_types, - ../nimbus/vm/interpreter/utils/utils_numeric + ../nimbus/vm_utils_numeric func toAddress(n: int): EthAddress = result[19] = n.byte