Some renames
This commit is contained in:
parent
8cfebe1691
commit
51b572d8b8
|
@ -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")
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
|
@ -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.}
|
|
@ -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
|
|
@ -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
|
|
@ -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) =
|
|
@ -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}")
|
|
@ -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.}
|
|
@ -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")
|
|
@ -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.}
|
|
@ -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
|
||||
|
||||
|
|
@ -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)
|
|
@ -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.}
|
|
@ -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
|
|
@ -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}")
|
|
@ -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
|
||||
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 104 KiB |
|
@ -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
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import
|
||||
strformat,
|
||||
../logging, ../errors, ../types
|
||||
../logging, ../errors, ../vm_types
|
||||
|
||||
proc newGasMeter*(startGas: GasInt): GasMeter =
|
||||
new(result)
|
|
@ -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
|
|
@ -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
|
|
@ -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)
|
||||
|
|
|
@ -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":
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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 =
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue