From 51b572d8b87f8774ac963ff21a06f711dc59dacd Mon Sep 17 00:00:00 2001 From: Yuriy Glukhov Date: Mon, 28 May 2018 13:22:28 +0300 Subject: [PATCH] Some renames --- examples/decompile_smart_contract.nim | 2 +- nimbus.nimble | 6 +++--- {src => nimbus}/account.nim | 0 {src => nimbus}/block_types.nim | 0 {src => nimbus}/chain.nim | 0 {src => nimbus}/computation.nim | 2 +- {src => nimbus}/config.nim | 0 {src => nimbus}/constants.nim | 0 {src => nimbus}/db/backends/memory_backend.nim | 0 {src => nimbus}/db/db_chain.nim | 0 {src => nimbus}/db/state_db.nim | 0 {src => nimbus}/errors.nim | 0 {src => nimbus}/lightchain_shell.nim | 0 {src => nimbus}/logging.nim | 0 {src => nimbus}/logic/arithmetic.nim | 2 +- {src => nimbus}/logic/block.nim | 0 {src => nimbus}/logic/block_ops.nim | 2 +- {src => nimbus}/logic/call.nim | 2 +- {src => nimbus}/logic/comparison.nim | 2 +- {src => nimbus}/logic/context.nim | 2 +- {src => nimbus}/logic/duplication.nim | 2 +- {src => nimbus}/logic/flow.nim | 2 +- {src => nimbus}/logic/helpers.nim | 0 {src => nimbus}/logic/invalid.nim | 2 +- {src => nimbus}/logic/logging_ops.nim | 2 +- {src => nimbus}/logic/memory_ops.nim | 2 +- {src => nimbus}/logic/sha3.nim | 2 +- {src => nimbus}/logic/stack_ops.nim | 2 +- {src => nimbus}/logic/storage.nim | 2 +- {src => nimbus}/logic/swap.nim | 2 +- {src => nimbus}/logic/system_ops.nim | 2 +- {src => nimbus}/nim.cfg | 0 {src => nimbus}/nimbus.nim | 0 {src => nimbus}/opcode.nim | 4 ++-- {src => nimbus}/opcode_table.nim | 2 +- {src => nimbus}/opcode_values.nim | 0 {src => nimbus}/p2p/disc4service.nim | 0 {src => nimbus}/p2p/service.nim | 0 {src => nimbus}/runner.nim | 0 {src => nimbus}/transaction.nim | 0 {src => nimbus}/utils/address.nim | 0 {src => nimbus}/utils/bytes.nim | 0 {src => nimbus}/utils/header.nim | 0 {src => nimbus}/utils/hexadecimal.nim | 0 {src => nimbus}/utils/keccak.nim | 0 {src => nimbus}/utils/padding.nim | 0 {src => nimbus}/utils/state.nim | 0 {src => nimbus}/utils_numeric.nim | 0 {src => nimbus}/validation.nim | 0 {src => nimbus}/vm/base.nim | 2 +- {src => nimbus}/vm/code_stream.nim | 0 .../vm/forks/f20150730_frontier/frontier_block.nim | 0 .../f20150730_frontier/frontier_validation.nim | 0 .../vm/forks/f20150730_frontier/frontier_vm.nim | 0 .../forks/f20150730_frontier/frontier_vm_state.nim | 0 .../f20161018_tangerine_whistle/tangerine_block.nim | 0 .../tangerine_validation.nim | 0 .../f20161018_tangerine_whistle/tangerine_vm.nim | 0 .../tangerine_vm_state.nim | 0 {src => nimbus}/vm/forks/forks_list.md | 0 {src => nimbus}/vm/forks/forks_list.png | Bin {src => nimbus}/vm/forks/gas_costs.nim | 2 +- {src => nimbus}/vm/forks/vm_forks.nim | 0 {src => nimbus}/vm/gas_meter.nim | 2 +- {src => nimbus}/vm/memory.nim | 0 {src => nimbus}/vm/message.nim | 2 +- {src => nimbus}/vm/stack.nim | 0 {src => nimbus}/vm/value.nim | 0 {src => nimbus}/vm_state.nim | 0 {src => nimbus}/vm_state_transactions.nim | 2 +- src/types.nim => nimbus/vm_types.nim | 0 tests/fixtures.nim | 2 +- tests/test_code_stream.nim | 2 +- tests/test_gas_meter.nim | 2 +- tests/test_helpers.nim | 8 ++++---- tests/test_memory.nim | 2 +- tests/test_opcode.nim | 12 ++++++------ tests/test_stack.nim | 2 +- tests/test_vm.nim | 4 ++-- tests/test_vm_json.nim | 10 +++++----- 80 files changed, 50 insertions(+), 50 deletions(-) rename {src => nimbus}/account.nim (100%) rename {src => nimbus}/block_types.nim (100%) rename {src => nimbus}/chain.nim (100%) rename {src => nimbus}/computation.nim (99%) rename {src => nimbus}/config.nim (100%) rename {src => nimbus}/constants.nim (100%) rename {src => nimbus}/db/backends/memory_backend.nim (100%) rename {src => nimbus}/db/db_chain.nim (100%) rename {src => nimbus}/db/state_db.nim (100%) rename {src => nimbus}/errors.nim (100%) rename {src => nimbus}/lightchain_shell.nim (100%) rename {src => nimbus}/logging.nim (100%) rename {src => nimbus}/logic/arithmetic.nim (98%) rename {src => nimbus}/logic/block.nim (100%) rename {src => nimbus}/logic/block_ops.nim (92%) rename {src => nimbus}/logic/call.nim (99%) rename {src => nimbus}/logic/comparison.nim (99%) rename {src => nimbus}/logic/context.nim (97%) rename {src => nimbus}/logic/duplication.nim (94%) rename {src => nimbus}/logic/flow.nim (92%) rename {src => nimbus}/logic/helpers.nim (100%) rename {src => nimbus}/logic/invalid.nim (92%) rename {src => nimbus}/logic/logging_ops.nim (94%) rename {src => nimbus}/logic/memory_ops.nim (91%) rename {src => nimbus}/logic/sha3.nim (92%) rename {src => nimbus}/logic/stack_ops.nim (91%) rename {src => nimbus}/logic/storage.nim (96%) rename {src => nimbus}/logic/swap.nim (94%) rename {src => nimbus}/logic/system_ops.nim (98%) rename {src => nimbus}/nim.cfg (100%) rename {src => nimbus}/nimbus.nim (100%) rename {src => nimbus}/opcode.nim (96%) rename {src => nimbus}/opcode_table.nim (99%) rename {src => nimbus}/opcode_values.nim (100%) rename {src => nimbus}/p2p/disc4service.nim (100%) rename {src => nimbus}/p2p/service.nim (100%) rename {src => nimbus}/runner.nim (100%) rename {src => nimbus}/transaction.nim (100%) rename {src => nimbus}/utils/address.nim (100%) rename {src => nimbus}/utils/bytes.nim (100%) rename {src => nimbus}/utils/header.nim (100%) rename {src => nimbus}/utils/hexadecimal.nim (100%) rename {src => nimbus}/utils/keccak.nim (100%) rename {src => nimbus}/utils/padding.nim (100%) rename {src => nimbus}/utils/state.nim (100%) rename {src => nimbus}/utils_numeric.nim (100%) rename {src => nimbus}/validation.nim (100%) rename {src => nimbus}/vm/base.nim (93%) rename {src => nimbus}/vm/code_stream.nim (100%) rename {src => nimbus}/vm/forks/f20150730_frontier/frontier_block.nim (100%) rename {src => nimbus}/vm/forks/f20150730_frontier/frontier_validation.nim (100%) rename {src => nimbus}/vm/forks/f20150730_frontier/frontier_vm.nim (100%) rename {src => nimbus}/vm/forks/f20150730_frontier/frontier_vm_state.nim (100%) rename {src => nimbus}/vm/forks/f20161018_tangerine_whistle/tangerine_block.nim (100%) rename {src => nimbus}/vm/forks/f20161018_tangerine_whistle/tangerine_validation.nim (100%) rename {src => nimbus}/vm/forks/f20161018_tangerine_whistle/tangerine_vm.nim (100%) rename {src => nimbus}/vm/forks/f20161018_tangerine_whistle/tangerine_vm_state.nim (100%) rename {src => nimbus}/vm/forks/forks_list.md (100%) rename {src => nimbus}/vm/forks/forks_list.png (100%) rename {src => nimbus}/vm/forks/gas_costs.nim (98%) rename {src => nimbus}/vm/forks/vm_forks.nim (100%) rename {src => nimbus}/vm/gas_meter.nim (98%) rename {src => nimbus}/vm/memory.nim (100%) rename {src => nimbus}/vm/message.nim (97%) rename {src => nimbus}/vm/stack.nim (100%) rename {src => nimbus}/vm/value.nim (100%) rename {src => nimbus}/vm_state.nim (100%) rename {src => nimbus}/vm_state_transactions.nim (96%) rename src/types.nim => nimbus/vm_types.nim (100%) diff --git a/examples/decompile_smart_contract.nim b/examples/decompile_smart_contract.nim index f0c37ce44..e46fa3828 100644 --- a/examples/decompile_smart_contract.nim +++ b/examples/decompile_smart_contract.nim @@ -1,4 +1,4 @@ -import ../src/vm/code_stream, ../src/opcode_values, strformat +import ../nimbus/vm/code_stream, ../nimbus/opcode_values, strformat var c = newCodeStreamFromUnescaped("0x6003600202600055") diff --git a/nimbus.nimble b/nimbus.nimble index fecfd14e1..841a4e70d 100644 --- a/nimbus.nimble +++ b/nimbus.nimble @@ -8,9 +8,9 @@ license = "Apache License 2.0" skipDirs = @["tests"] requires "nim >= 0.18.1", - "https://github.com/cheatfate/nimcrypto", - "https://github.com/status-im/nim-rlp", - "https://github.com/status-im/nim-stint", + "nimcrypto", + "rlp", + "stint", "https://github.com/status-im/nim-eth-p2p", "https://github.com/status-im/nim-eth-keyfile" diff --git a/src/account.nim b/nimbus/account.nim similarity index 100% rename from src/account.nim rename to nimbus/account.nim diff --git a/src/block_types.nim b/nimbus/block_types.nim similarity index 100% rename from src/block_types.nim rename to nimbus/block_types.nim diff --git a/src/chain.nim b/nimbus/chain.nim similarity index 100% rename from src/chain.nim rename to nimbus/chain.nim diff --git a/src/computation.nim b/nimbus/computation.nim similarity index 99% rename from src/computation.nim rename to nimbus/computation.nim index 6fe60d6f6..d0e20a7a4 100644 --- a/src/computation.nim +++ b/nimbus/computation.nim @@ -7,7 +7,7 @@ import strformat, strutils, sequtils, tables, macros, stint, terminal, math, - constants, errors, utils/hexadecimal, utils_numeric, validation, vm_state, logging, opcode_values, types, + constants, errors, utils/hexadecimal, utils_numeric, validation, vm_state, logging, opcode_values, vm_types, vm / [code_stream, gas_meter, memory, message, stack], # TODO further refactoring of gas cost diff --git a/src/config.nim b/nimbus/config.nim similarity index 100% rename from src/config.nim rename to nimbus/config.nim diff --git a/src/constants.nim b/nimbus/constants.nim similarity index 100% rename from src/constants.nim rename to nimbus/constants.nim diff --git a/src/db/backends/memory_backend.nim b/nimbus/db/backends/memory_backend.nim similarity index 100% rename from src/db/backends/memory_backend.nim rename to nimbus/db/backends/memory_backend.nim diff --git a/src/db/db_chain.nim b/nimbus/db/db_chain.nim similarity index 100% rename from src/db/db_chain.nim rename to nimbus/db/db_chain.nim diff --git a/src/db/state_db.nim b/nimbus/db/state_db.nim similarity index 100% rename from src/db/state_db.nim rename to nimbus/db/state_db.nim diff --git a/src/errors.nim b/nimbus/errors.nim similarity index 100% rename from src/errors.nim rename to nimbus/errors.nim diff --git a/src/lightchain_shell.nim b/nimbus/lightchain_shell.nim similarity index 100% rename from src/lightchain_shell.nim rename to nimbus/lightchain_shell.nim diff --git a/src/logging.nim b/nimbus/logging.nim similarity index 100% rename from src/logging.nim rename to nimbus/logging.nim diff --git a/src/logic/arithmetic.nim b/nimbus/logic/arithmetic.nim similarity index 98% rename from src/logic/arithmetic.nim rename to nimbus/logic/arithmetic.nim index b33477ee1..919d33120 100644 --- a/src/logic/arithmetic.nim +++ b/nimbus/logic/arithmetic.nim @@ -6,7 +6,7 @@ # at your option. This file may not be copied, modified, or distributed except according to those terms. import - ../constants, ../utils_numeric, ../computation, ../types, + ../constants, ../utils_numeric, ../computation, ../vm_types, .. / vm / [gas_meter, stack], ../opcode, ../opcode_values, helpers, stint, strutils diff --git a/src/logic/block.nim b/nimbus/logic/block.nim similarity index 100% rename from src/logic/block.nim rename to nimbus/logic/block.nim diff --git a/src/logic/block_ops.nim b/nimbus/logic/block_ops.nim similarity index 92% rename from src/logic/block_ops.nim rename to nimbus/logic/block_ops.nim index a3f90f2df..ef621c93e 100644 --- a/src/logic/block_ops.nim +++ b/nimbus/logic/block_ops.nim @@ -7,7 +7,7 @@ import times, - ../constants, ../errors, ../computation, ../vm_state, ../types, .. / vm / [stack], stint + ../constants, ../errors, ../computation, ../vm_state, ../vm_types, .. / vm / [stack], stint {.this: computation.} {.experimental.} diff --git a/src/logic/call.nim b/nimbus/logic/call.nim similarity index 99% rename from src/logic/call.nim rename to nimbus/logic/call.nim index 88cb4ea6b..e28e17fb1 100644 --- a/src/logic/call.nim +++ b/nimbus/logic/call.nim @@ -7,7 +7,7 @@ import strformat, - ../constants, ../types, ../errors, ../computation, ../opcode, ../opcode_values, ../logging, + ../constants, ../vm_types, ../errors, ../computation, ../opcode, ../opcode_values, ../logging, .. / vm / [stack, memory, gas_meter, message], .. / utils / [address, bytes], stint diff --git a/src/logic/comparison.nim b/nimbus/logic/comparison.nim similarity index 99% rename from src/logic/comparison.nim rename to nimbus/logic/comparison.nim index af928e739..5280b077c 100644 --- a/src/logic/comparison.nim +++ b/nimbus/logic/comparison.nim @@ -6,7 +6,7 @@ # at your option. This file may not be copied, modified, or distributed except according to those terms. import - ../constants, ../utils_numeric, ../computation, ../vm/stack, ../types, + ../constants, ../utils_numeric, ../computation, ../vm/stack, ../vm_types, helpers, stint quasiBoolean(lt, `<`) # Lesser Comparison diff --git a/src/logic/context.nim b/nimbus/logic/context.nim similarity index 97% rename from src/logic/context.nim rename to nimbus/logic/context.nim index 5c4e41d27..689ae6650 100644 --- a/src/logic/context.nim +++ b/nimbus/logic/context.nim @@ -7,7 +7,7 @@ import strformat, - ../constants, ../types, ../errors, ../utils_numeric, ../computation, ../vm_state, ../account, ../db/state_db, ../validation, + ../constants, ../vm_types, ../errors, ../utils_numeric, ../computation, ../vm_state, ../account, ../db/state_db, ../validation, .. / vm / [stack, message, gas_meter, memory, code_stream], .. / utils / [address, padding, bytes], stint proc balance*(computation: var BaseComputation) = diff --git a/src/logic/duplication.nim b/nimbus/logic/duplication.nim similarity index 94% rename from src/logic/duplication.nim rename to nimbus/logic/duplication.nim index c1dfd00c4..6ba577a79 100644 --- a/src/logic/duplication.nim +++ b/nimbus/logic/duplication.nim @@ -7,7 +7,7 @@ import macros, strformat, - ../types, ../computation, ../vm/stack + ../vm_types, ../computation, ../vm/stack macro dupXX(position: static[int]): untyped = let name = ident(&"dup{position}") diff --git a/src/logic/flow.nim b/nimbus/logic/flow.nim similarity index 92% rename from src/logic/flow.nim rename to nimbus/logic/flow.nim index c9601ba35..46a635dba 100644 --- a/src/logic/flow.nim +++ b/nimbus/logic/flow.nim @@ -7,7 +7,7 @@ import strformat, stint, - ../constants, ../types, ../opcode_values, ../logging, ../errors, ../computation, .. /vm / [code_stream, stack] + ../constants, ../vm_types, ../opcode_values, ../logging, ../errors, ../computation, .. /vm / [code_stream, stack] {.this: computation.} diff --git a/src/logic/helpers.nim b/nimbus/logic/helpers.nim similarity index 100% rename from src/logic/helpers.nim rename to nimbus/logic/helpers.nim diff --git a/src/logic/invalid.nim b/nimbus/logic/invalid.nim similarity index 92% rename from src/logic/invalid.nim rename to nimbus/logic/invalid.nim index 05bd78b31..05ca3d202 100644 --- a/src/logic/invalid.nim +++ b/nimbus/logic/invalid.nim @@ -6,7 +6,7 @@ # at your option. This file may not be copied, modified, or distributed except according to those terms. import - ../errors, ../types, ../computation + ../errors, ../vm_types, ../computation proc invalidOp*(computation: var BaseComputation) = raise newException(InvalidInstruction, "Invalid opcode") diff --git a/src/logic/logging_ops.nim b/nimbus/logic/logging_ops.nim similarity index 94% rename from src/logic/logging_ops.nim rename to nimbus/logic/logging_ops.nim index 37f75266e..1aaa2562d 100644 --- a/src/logic/logging_ops.nim +++ b/nimbus/logic/logging_ops.nim @@ -7,7 +7,7 @@ import strformat, macros, - ../constants, ../errors, ../types, ../computation, .. / vm / [stack, memory, gas_meter, message], .. / utils / bytes, stint + ../constants, ../errors, ../vm_types, ../computation, .. / vm / [stack, memory, gas_meter, message], .. / utils / bytes, stint {.this: computation.} {.experimental.} diff --git a/src/logic/memory_ops.nim b/nimbus/logic/memory_ops.nim similarity index 91% rename from src/logic/memory_ops.nim rename to nimbus/logic/memory_ops.nim index eaf36239d..337cf0e8b 100644 --- a/src/logic/memory_ops.nim +++ b/nimbus/logic/memory_ops.nim @@ -6,7 +6,7 @@ # at your option. This file may not be copied, modified, or distributed except according to those terms. import - ../constants, ../computation, ../types, .. / vm / [stack, memory], .. / utils / [padding, bytes], + ../constants, ../computation, ../vm_types, .. / vm / [stack, memory], .. / utils / [padding, bytes], stint diff --git a/src/logic/sha3.nim b/nimbus/logic/sha3.nim similarity index 92% rename from src/logic/sha3.nim rename to nimbus/logic/sha3.nim index b284652eb..7a7076e5c 100644 --- a/src/logic/sha3.nim +++ b/nimbus/logic/sha3.nim @@ -6,7 +6,7 @@ # at your option. This file may not be copied, modified, or distributed except according to those terms. import - ../constants, ../utils_numeric, .. / utils / [keccak, bytes], .. / vm / [stack, memory, gas_meter], ../computation, ../types, helpers, stint + ../constants, ../utils_numeric, .. / utils / [keccak, bytes], .. / vm / [stack, memory, gas_meter], ../computation, ../vm_types, helpers, stint proc sha3op*(computation: var BaseComputation) = let (startPosition, size) = computation.stack.popInt(2) diff --git a/src/logic/stack_ops.nim b/nimbus/logic/stack_ops.nim similarity index 91% rename from src/logic/stack_ops.nim rename to nimbus/logic/stack_ops.nim index ba05bf450..3f0ecdc94 100644 --- a/src/logic/stack_ops.nim +++ b/nimbus/logic/stack_ops.nim @@ -7,7 +7,7 @@ import strformat, macros, sequtils, - ../types, ../constants, ../errors, ../computation, .. / vm / [stack, code_stream], .. / utils / [padding, bytes], stint + ../vm_types, ../constants, ../errors, ../computation, .. / vm / [stack, code_stream], .. / utils / [padding, bytes], stint {.this: computation.} {.experimental.} diff --git a/src/logic/storage.nim b/nimbus/logic/storage.nim similarity index 96% rename from src/logic/storage.nim rename to nimbus/logic/storage.nim index fef369301..0ca318bc4 100644 --- a/src/logic/storage.nim +++ b/nimbus/logic/storage.nim @@ -6,7 +6,7 @@ # at your option. This file may not be copied, modified, or distributed except according to those terms. import - ../constants, ../types, ../errors, ../computation, ../vm_state, + ../constants, ../vm_types, ../errors, ../computation, ../vm_state, ../utils/header, ../db/[db_chain, state_db], ../vm/[stack, gas_meter, message], strformat, stint diff --git a/src/logic/swap.nim b/nimbus/logic/swap.nim similarity index 94% rename from src/logic/swap.nim rename to nimbus/logic/swap.nim index 950d8a5c6..f457a7b26 100644 --- a/src/logic/swap.nim +++ b/nimbus/logic/swap.nim @@ -7,7 +7,7 @@ import macros, strformat, - ../types, ../computation, ../vm/stack + ../vm_types, ../computation, ../vm/stack macro swapXX(position: static[int]): untyped = let name = ident(&"swap{position}") diff --git a/src/logic/system_ops.nim b/nimbus/logic/system_ops.nim similarity index 98% rename from src/logic/system_ops.nim rename to nimbus/logic/system_ops.nim index e9c627690..f6ff65a97 100644 --- a/src/logic/system_ops.nim +++ b/nimbus/logic/system_ops.nim @@ -7,7 +7,7 @@ import strformat, - ../constants, ../types, ../errors, ../computation, ../opcode, ../opcode_values, ../logging, ../vm_state, call, + ../constants, ../vm_types, ../errors, ../computation, ../opcode, ../opcode_values, ../logging, ../vm_state, call, .. / vm / [stack, gas_meter, memory, message], .. / utils / [address, hexadecimal, bytes], stint diff --git a/src/nim.cfg b/nimbus/nim.cfg similarity index 100% rename from src/nim.cfg rename to nimbus/nim.cfg diff --git a/src/nimbus.nim b/nimbus/nimbus.nim similarity index 100% rename from src/nimbus.nim rename to nimbus/nimbus.nim diff --git a/src/opcode.nim b/nimbus/opcode.nim similarity index 96% rename from src/opcode.nim rename to nimbus/opcode.nim index 1a59f7df1..a46c409bc 100644 --- a/src/opcode.nim +++ b/nimbus/opcode.nim @@ -7,8 +7,8 @@ import strformat, strutils, sequtils, macros, - constants, logging, errors, types, opcode_values, computation, vm/stack, stint, - ./types + constants, logging, errors, opcode_values, computation, vm/stack, stint, + ./vm_types template run*(opcode: Opcode, computation: var BaseComputation) = # Hook for performing the actual VM execution diff --git a/src/opcode_table.nim b/nimbus/opcode_table.nim similarity index 99% rename from src/opcode_table.nim rename to nimbus/opcode_table.nim index e421d4c6c..62072d32b 100644 --- a/src/opcode_table.nim +++ b/nimbus/opcode_table.nim @@ -10,7 +10,7 @@ import constants, stint, errors, logging, vm_state, vm / [gas_meter, stack, code_stream, memory, message, value], db / db_chain, computation, opcode, opcode_values, utils / [header, address], logic / [arithmetic, comparison, sha3, context, block_ops, stack_ops, duplication, swap, memory_ops, storage, flow, logging_ops, invalid, call, system_ops], - ./types + ./vm_types var OPCODE_TABLE* = initOpcodes: # arithmetic diff --git a/src/opcode_values.nim b/nimbus/opcode_values.nim similarity index 100% rename from src/opcode_values.nim rename to nimbus/opcode_values.nim diff --git a/src/p2p/disc4service.nim b/nimbus/p2p/disc4service.nim similarity index 100% rename from src/p2p/disc4service.nim rename to nimbus/p2p/disc4service.nim diff --git a/src/p2p/service.nim b/nimbus/p2p/service.nim similarity index 100% rename from src/p2p/service.nim rename to nimbus/p2p/service.nim diff --git a/src/runner.nim b/nimbus/runner.nim similarity index 100% rename from src/runner.nim rename to nimbus/runner.nim diff --git a/src/transaction.nim b/nimbus/transaction.nim similarity index 100% rename from src/transaction.nim rename to nimbus/transaction.nim diff --git a/src/utils/address.nim b/nimbus/utils/address.nim similarity index 100% rename from src/utils/address.nim rename to nimbus/utils/address.nim diff --git a/src/utils/bytes.nim b/nimbus/utils/bytes.nim similarity index 100% rename from src/utils/bytes.nim rename to nimbus/utils/bytes.nim diff --git a/src/utils/header.nim b/nimbus/utils/header.nim similarity index 100% rename from src/utils/header.nim rename to nimbus/utils/header.nim diff --git a/src/utils/hexadecimal.nim b/nimbus/utils/hexadecimal.nim similarity index 100% rename from src/utils/hexadecimal.nim rename to nimbus/utils/hexadecimal.nim diff --git a/src/utils/keccak.nim b/nimbus/utils/keccak.nim similarity index 100% rename from src/utils/keccak.nim rename to nimbus/utils/keccak.nim diff --git a/src/utils/padding.nim b/nimbus/utils/padding.nim similarity index 100% rename from src/utils/padding.nim rename to nimbus/utils/padding.nim diff --git a/src/utils/state.nim b/nimbus/utils/state.nim similarity index 100% rename from src/utils/state.nim rename to nimbus/utils/state.nim diff --git a/src/utils_numeric.nim b/nimbus/utils_numeric.nim similarity index 100% rename from src/utils_numeric.nim rename to nimbus/utils_numeric.nim diff --git a/src/validation.nim b/nimbus/validation.nim similarity index 100% rename from src/validation.nim rename to nimbus/validation.nim diff --git a/src/vm/base.nim b/nimbus/vm/base.nim similarity index 93% rename from src/vm/base.nim rename to nimbus/vm/base.nim index 8b250ba44..d70571ea6 100644 --- a/src/vm/base.nim +++ b/nimbus/vm/base.nim @@ -6,7 +6,7 @@ # at your option. This file may not be copied, modified, or distributed except according to those terms. import - ../logging, ../constants, ../errors, ../transaction, ../types, ../computation, ../block_types, ../vm_state, ../vm_state_transactions, ../db/db_chain, ../utils/header + ../logging, ../constants, ../errors, ../transaction, ../vm_types, ../computation, ../block_types, ../vm_state, ../vm_state_transactions, ../db/db_chain, ../utils/header type VMkind* = enum diff --git a/src/vm/code_stream.nim b/nimbus/vm/code_stream.nim similarity index 100% rename from src/vm/code_stream.nim rename to nimbus/vm/code_stream.nim diff --git a/src/vm/forks/f20150730_frontier/frontier_block.nim b/nimbus/vm/forks/f20150730_frontier/frontier_block.nim similarity index 100% rename from src/vm/forks/f20150730_frontier/frontier_block.nim rename to nimbus/vm/forks/f20150730_frontier/frontier_block.nim diff --git a/src/vm/forks/f20150730_frontier/frontier_validation.nim b/nimbus/vm/forks/f20150730_frontier/frontier_validation.nim similarity index 100% rename from src/vm/forks/f20150730_frontier/frontier_validation.nim rename to nimbus/vm/forks/f20150730_frontier/frontier_validation.nim diff --git a/src/vm/forks/f20150730_frontier/frontier_vm.nim b/nimbus/vm/forks/f20150730_frontier/frontier_vm.nim similarity index 100% rename from src/vm/forks/f20150730_frontier/frontier_vm.nim rename to nimbus/vm/forks/f20150730_frontier/frontier_vm.nim diff --git a/src/vm/forks/f20150730_frontier/frontier_vm_state.nim b/nimbus/vm/forks/f20150730_frontier/frontier_vm_state.nim similarity index 100% rename from src/vm/forks/f20150730_frontier/frontier_vm_state.nim rename to nimbus/vm/forks/f20150730_frontier/frontier_vm_state.nim diff --git a/src/vm/forks/f20161018_tangerine_whistle/tangerine_block.nim b/nimbus/vm/forks/f20161018_tangerine_whistle/tangerine_block.nim similarity index 100% rename from src/vm/forks/f20161018_tangerine_whistle/tangerine_block.nim rename to nimbus/vm/forks/f20161018_tangerine_whistle/tangerine_block.nim diff --git a/src/vm/forks/f20161018_tangerine_whistle/tangerine_validation.nim b/nimbus/vm/forks/f20161018_tangerine_whistle/tangerine_validation.nim similarity index 100% rename from src/vm/forks/f20161018_tangerine_whistle/tangerine_validation.nim rename to nimbus/vm/forks/f20161018_tangerine_whistle/tangerine_validation.nim diff --git a/src/vm/forks/f20161018_tangerine_whistle/tangerine_vm.nim b/nimbus/vm/forks/f20161018_tangerine_whistle/tangerine_vm.nim similarity index 100% rename from src/vm/forks/f20161018_tangerine_whistle/tangerine_vm.nim rename to nimbus/vm/forks/f20161018_tangerine_whistle/tangerine_vm.nim diff --git a/src/vm/forks/f20161018_tangerine_whistle/tangerine_vm_state.nim b/nimbus/vm/forks/f20161018_tangerine_whistle/tangerine_vm_state.nim similarity index 100% rename from src/vm/forks/f20161018_tangerine_whistle/tangerine_vm_state.nim rename to nimbus/vm/forks/f20161018_tangerine_whistle/tangerine_vm_state.nim diff --git a/src/vm/forks/forks_list.md b/nimbus/vm/forks/forks_list.md similarity index 100% rename from src/vm/forks/forks_list.md rename to nimbus/vm/forks/forks_list.md diff --git a/src/vm/forks/forks_list.png b/nimbus/vm/forks/forks_list.png similarity index 100% rename from src/vm/forks/forks_list.png rename to nimbus/vm/forks/forks_list.png diff --git a/src/vm/forks/gas_costs.nim b/nimbus/vm/forks/gas_costs.nim similarity index 98% rename from src/vm/forks/gas_costs.nim rename to nimbus/vm/forks/gas_costs.nim index 50186befc..3b9f29a5b 100644 --- a/src/vm/forks/gas_costs.nim +++ b/nimbus/vm/forks/gas_costs.nim @@ -6,7 +6,7 @@ # at your option. This file may not be copied, modified, or distributed except according to those terms. import - stint, ../../types + stint, ../../vm_types # TODO: Make that computation at compile-time. # Go-Ethereum uses pure uint64 for gas computation diff --git a/src/vm/forks/vm_forks.nim b/nimbus/vm/forks/vm_forks.nim similarity index 100% rename from src/vm/forks/vm_forks.nim rename to nimbus/vm/forks/vm_forks.nim diff --git a/src/vm/gas_meter.nim b/nimbus/vm/gas_meter.nim similarity index 98% rename from src/vm/gas_meter.nim rename to nimbus/vm/gas_meter.nim index 528a1cf97..dd10c2351 100644 --- a/src/vm/gas_meter.nim +++ b/nimbus/vm/gas_meter.nim @@ -7,7 +7,7 @@ import strformat, - ../logging, ../errors, ../types + ../logging, ../errors, ../vm_types proc newGasMeter*(startGas: GasInt): GasMeter = new(result) diff --git a/src/vm/memory.nim b/nimbus/vm/memory.nim similarity index 100% rename from src/vm/memory.nim rename to nimbus/vm/memory.nim diff --git a/src/vm/message.nim b/nimbus/vm/message.nim similarity index 97% rename from src/vm/message.nim rename to nimbus/vm/message.nim index ed5b7e7e2..5e75cceab 100644 --- a/src/vm/message.nim +++ b/nimbus/vm/message.nim @@ -6,7 +6,7 @@ # at your option. This file may not be copied, modified, or distributed except according to those terms. import - ../logging, ../constants, ../validation, stint, ../types + ../logging, ../constants, ../validation, stint, ../vm_types proc `origin=`*(message: var Message, value: string) = message.internalOrigin = value diff --git a/src/vm/stack.nim b/nimbus/vm/stack.nim similarity index 100% rename from src/vm/stack.nim rename to nimbus/vm/stack.nim diff --git a/src/vm/value.nim b/nimbus/vm/value.nim similarity index 100% rename from src/vm/value.nim rename to nimbus/vm/value.nim diff --git a/src/vm_state.nim b/nimbus/vm_state.nim similarity index 100% rename from src/vm_state.nim rename to nimbus/vm_state.nim diff --git a/src/vm_state_transactions.nim b/nimbus/vm_state_transactions.nim similarity index 96% rename from src/vm_state_transactions.nim rename to nimbus/vm_state_transactions.nim index 660cf0367..b1b016bd4 100644 --- a/src/vm_state_transactions.nim +++ b/nimbus/vm_state_transactions.nim @@ -7,7 +7,7 @@ import strformat, tables, - logging, constants, errors, computation, transaction, types, vm_state, block_types, db / db_chain, utils / [state, header] + logging, constants, errors, computation, transaction, vm_types, vm_state, block_types, db / db_chain, utils / [state, header] method executeTransaction(vmState: var BaseVMState, transaction: BaseTransaction): (BaseComputation, BlockHeader) {.base.}= # Execute the transaction in the vm diff --git a/src/types.nim b/nimbus/vm_types.nim similarity index 100% rename from src/types.nim rename to nimbus/vm_types.nim diff --git a/tests/fixtures.nim b/tests/fixtures.nim index 447d894d1..8b44edac0 100644 --- a/tests/fixtures.nim +++ b/tests/fixtures.nim @@ -8,7 +8,7 @@ import unittest, strformat, tables, times, stint, - ../src/[constants, chain, vm/base, vm/forks/f20150730_frontier/frontier_vm, utils/header, utils/address, db/db_chain, db/backends/memory_backend] + ../nimbus/[constants, chain, vm/base, vm/forks/f20150730_frontier/frontier_vm, utils/header, utils/address, db/db_chain, db/backends/memory_backend] proc chainWithoutBlockValidation*: Chain = result = configureChain("TestChain", GENESIS_BLOCK_NUMBER, vmkFrontier, false, false) diff --git a/tests/test_code_stream.nim b/tests/test_code_stream.nim index 1341d8831..3b33d26ac 100644 --- a/tests/test_code_stream.nim +++ b/tests/test_code_stream.nim @@ -6,7 +6,7 @@ # at your option. This file may not be copied, modified, or distributed except according to those terms. import unittest, strutils, sequtils, - ../src/opcode_values, ../src/vm/code_stream + ../nimbus/opcode_values, ../nimbus/vm/code_stream suite "parse bytecode": test "accepts bytes": diff --git a/tests/test_gas_meter.nim b/tests/test_gas_meter.nim index deb1eea63..3781740d4 100644 --- a/tests/test_gas_meter.nim +++ b/tests/test_gas_meter.nim @@ -7,7 +7,7 @@ import unittest, macros, strformat, strutils, sequtils, stint, - ../src/[constants, opcode_values, errors, logging, types, vm/gas_meter] + ../nimbus/[constants, opcode_values, errors, logging, vm_types, vm/gas_meter] # TODO: quicktest # PS: parametrize can be easily immitated, but still quicktests would be even more useful diff --git a/tests/test_helpers.nim b/tests/test_helpers.nim index 8eb3f4a31..177fd1ea2 100644 --- a/tests/test_helpers.nim +++ b/tests/test_helpers.nim @@ -8,10 +8,10 @@ import os, macros, json, strformat, strutils, parseutils, ospaths, tables, stint, - ../src/utils/[hexadecimal, address, padding], - ../src/[chain, vm_state, constants], - ../src/db/[db_chain, state_db], ../src/vm/forks/f20150730_frontier/frontier_vm, - ../src/vm/base, ../src/transaction + ../nimbus/utils/[hexadecimal, address, padding], + ../nimbus/[chain, vm_state, constants], + ../nimbus/db/[db_chain, state_db], ../nimbus/vm/forks/f20150730_frontier/frontier_vm, + ../nimbus/vm/base, ../nimbus/transaction type Status* {.pure.} = enum OK, Fail, Skip diff --git a/tests/test_memory.nim b/tests/test_memory.nim index 125393500..6c8838679 100644 --- a/tests/test_memory.nim +++ b/tests/test_memory.nim @@ -7,7 +7,7 @@ import unittest, macros, strformat, strutils, sequtils, stint, - ../src/[constants, opcode_values, errors, vm/memory] + ../nimbus/[constants, opcode_values, errors, vm/memory] proc memory32: Memory = result = newMemory() diff --git a/tests/test_opcode.nim b/tests/test_opcode.nim index 9ac298178..6667788ee 100644 --- a/tests/test_opcode.nim +++ b/tests/test_opcode.nim @@ -7,12 +7,12 @@ import unittest, stint, tables, parseutils, - ../src/[constants, types, errors, logging], - ../src/[chain, vm_state, computation, opcode, opcode_table], - ../src/[utils/header, utils/padding], - ../src/vm/[gas_meter, message, code_stream, stack], - ../src/vm/forks/vm_forks, - ../src/db/[db_chain, state_db, backends/memory_backend], + ../nimbus/[constants, vm_types, errors, logging], + ../nimbus/[chain, vm_state, computation, opcode, opcode_table], + ../nimbus/[utils/header, utils/padding], + ../nimbus/vm/[gas_meter, message, code_stream, stack], + ../nimbus/vm/forks/vm_forks, + ../nimbus/db/[db_chain, state_db, backends/memory_backend], test_helpers diff --git a/tests/test_stack.nim b/tests/test_stack.nim index c5ae63f79..3c22c2af0 100644 --- a/tests/test_stack.nim +++ b/tests/test_stack.nim @@ -7,7 +7,7 @@ import unittest, macros, strformat, strutils, sequtils, stint, - ../src/[constants, opcode_values, errors, utils_numeric, vm/stack, vm/value, utils/bytes, utils/padding] + ../nimbus/[constants, opcode_values, errors, utils_numeric, vm/stack, vm/value, utils/bytes, utils/padding] template testPush(value: untyped, expected: untyped): untyped = diff --git a/tests/test_vm.nim b/tests/test_vm.nim index 6468dec66..fc65f0e2f 100644 --- a/tests/test_vm.nim +++ b/tests/test_vm.nim @@ -8,8 +8,8 @@ import unittest, stint, ./test_helpers, ./fixtures, - ../src/[db/backends/memory_backend, db/state_db, chain, constants, utils/hexadecimal, vm_state], - ../src/[vm/base, computation] + ../nimbus/[db/backends/memory_backend, db/state_db, chain, constants, utils/hexadecimal, vm_state], + ../nimbus/[vm/base, computation] import typetraits diff --git a/tests/test_vm_json.nim b/tests/test_vm_json.nim index 40291e100..c87916a98 100644 --- a/tests/test_vm_json.nim +++ b/tests/test_vm_json.nim @@ -8,11 +8,11 @@ import unittest, strformat, strutils, sequtils, tables, stint, json, ospaths, times, ./test_helpers, - ../src/[constants, errors, logging], - ../src/[chain, vm_state, computation, opcode, types, opcode_table], - ../src/utils/[header, padding], - ../src/vm/[gas_meter, message, code_stream, stack], - ../src/vm/forks/vm_forks, ../src/db/[db_chain, state_db, backends/memory_backend] + ../nimbus/[constants, errors, logging], + ../nimbus/[chain, vm_state, computation, opcode, vm_types, opcode_table], + ../nimbus/utils/[header, padding], + ../nimbus/vm/[gas_meter, message, code_stream, stack], + ../nimbus/vm/forks/vm_forks, ../nimbus/db/[db_chain, state_db, backends/memory_backend] proc testFixture(fixtures: JsonNode, testStatusIMPL: var TestStatus)