Some renames

This commit is contained in:
Yuriy Glukhov 2018-05-28 13:22:28 +03:00
parent 8cfebe1691
commit 51b572d8b8
80 changed files with 50 additions and 50 deletions

View File

@ -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")

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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.}

View File

@ -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

View File

@ -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

View File

@ -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) =

View File

@ -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}")

View File

@ -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.}

View File

@ -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")

View File

@ -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.}

View File

@ -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

View File

@ -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)

View File

@ -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.}

View File

@ -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

View File

@ -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}")

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 104 KiB

View File

@ -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

View File

@ -7,7 +7,7 @@
import
strformat,
../logging, ../errors, ../types
../logging, ../errors, ../vm_types
proc newGasMeter*(startGas: GasInt): GasMeter =
new(result)

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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":

View File

@ -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

View File

@ -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

View File

@ -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()

View File

@ -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

View File

@ -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 =

View File

@ -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

View File

@ -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)