From 028a3d6a3710fa0437d619b807f5b6b760c16f86 Mon Sep 17 00:00:00 2001 From: Jordan Hrycaj Date: Mon, 26 Apr 2021 15:08:17 +0100 Subject: [PATCH] removed redundant source file: interpreter.nim why: works as import concentrator for state_transaction.nim for vm_internals.nim interface. --- nimbus/vm2/interpreter.nim | 133 ------------------------------ nimbus/vm2/state_transactions.nim | 2 +- nimbus/vm_internals.nim | 95 ++++++++++++++++++++- 3 files changed, 92 insertions(+), 138 deletions(-) delete mode 100644 nimbus/vm2/interpreter.nim diff --git a/nimbus/vm2/interpreter.nim b/nimbus/vm2/interpreter.nim deleted file mode 100644 index 171a77cc0..000000000 --- a/nimbus/vm2/interpreter.nim +++ /dev/null @@ -1,133 +0,0 @@ -# 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. - - -# see vm_internals - -import - ./interpreter/op_codes as vmo -export - vmo.Op - - -import - ./interpreter/forks_list as vmf -export - vmf.Fork - - -import - ./message as vmm -export - vmm.isCreate - -# Used in vm_types. Beware of recursive dependencies - -import - ./compu_helper as xmc -export - xmc.accountExists, - xmc.addLogEntry, - xmc.chainTo, - xmc.commit, - xmc.dispose, - xmc.fork, - xmc.getBalance, - xmc.getBlockHash, - xmc.getBlockNumber, - xmc.getChainId, - xmc.getCode, - xmc.getCodeHash, - xmc.getCodeSize, - xmc.getCoinbase, - xmc.getDifficulty, - xmc.getGasLimit, - xmc.getGasPrice, - xmc.getGasRefund, - xmc.getOrigin, - xmc.getStorage, - xmc.getTimestamp, - xmc.isError, - xmc.isOriginComputation, - xmc.isSuccess, - xmc.isSuicided, - xmc.merge, - xmc.newComputation, - xmc.prepareTracer, - xmc.refundSelfDestruct, - xmc.rollback, - xmc.selfDestruct, - xmc.setError, - xmc.shouldBurnGas, - xmc.snapshot, - xmc.traceError, - xmc.traceOpCodeEnded, - xmc.traceOpCodeStarted, - xmc.tracingEnabled, - xmc.writeContract - - -import - ./computation as vmc -export - vmc.execCallOrCreate, - vmc.executeOpcodes - - -import - ./interpreter/gas_meter as gmt -export - gmt.consumeGas, - gmt.init, - gmt.refundGas, - gmt.returnGas - - -import - ./code_stream as cst -export - cst.CodeStream, - cst.`$`, - cst.newCodeStream, - cst.newCodeStreamFromUnescaped, - cst.read, - cst.readVmWord, - cst.len, - cst.next, - cst.items, - cst.`[]`, - cst.peek, - cst.updatePc, - cst.isValidOpcode, - cst.decompile, - cst.displayDecompiled, - cst.hasSStore, - cst.atEnd - - -import - ./stack as stk -export - stk.Stack, - stk.`$`, - stk.`[]`, - stk.dup, - stk.len, - stk.newStack, - stk.peek, - stk.peekInt, - stk.popAddress, - stk.popInt, - stk.popTopic, - stk.push, - stk.swap, - stk.top - -# End diff --git a/nimbus/vm2/state_transactions.nim b/nimbus/vm2/state_transactions.nim index 5f5175778..88187dbf7 100644 --- a/nimbus/vm2/state_transactions.nim +++ b/nimbus/vm2/state_transactions.nim @@ -25,8 +25,8 @@ import ../transaction, ./compu_helper, ./computation, - ./interpreter, ./interpreter/[forks_list, gas_costs, gas_meter], + ./message, ./state, ./types, chronicles, diff --git a/nimbus/vm_internals.nim b/nimbus/vm_internals.nim index 0eda97893..936638c95 100644 --- a/nimbus/vm_internals.nim +++ b/nimbus/vm_internals.nim @@ -57,11 +57,98 @@ export when defined(evmc_enabled) or not defined(vm2_enabled): import ./vm/interpreter as vmi + export + vmi + else: import - ./vm2/interpreter as vmi - -export - vmi + ./vm2/code_stream as aCst, + ./vm2/compu_helper as bChp, + ./vm2/computation as cVmc, + ./vm2/interpreter/forks_list as dVmf, + ./vm2/interpreter/gas_meter as eGmt, + ./vm2/interpreter/op_codes as fVmo, + ./vm2/message as gVmg, + ./vm2/stack as hStk + export + aCst.CodeStream, + aCst.`$`, + aCst.`[]`, + aCst.atEnd, + aCst.decompile, + aCst.displayDecompiled, + aCst.hasSStore, + aCst.isValidOpcode, + aCst.items, + aCst.len, + aCst.newCodeStream, + aCst.newCodeStreamFromUnescaped, + aCst.next, + aCst.peek, + aCst.read, + aCst.readVmWord, + aCst.updatePc, + bChp.accountExists, + bChp.addLogEntry, + bChp.chainTo, + bChp.commit, + bChp.dispose, + bChp.fork, + bChp.getBalance, + bChp.getBlockHash, + bChp.getBlockNumber, + bChp.getChainId, + bChp.getCode, + bChp.getCodeHash, + bChp.getCodeSize, + bChp.getCoinbase, + bChp.getDifficulty, + bChp.getGasLimit, + bChp.getGasPrice, + bChp.getGasRefund, + bChp.getOrigin, + bChp.getStorage, + bChp.getTimestamp, + bChp.isError, + bChp.isOriginComputation, + bChp.isSuccess, + bChp.isSuicided, + bChp.merge, + bChp.newComputation, + bChp.prepareTracer, + bChp.refundSelfDestruct, + bChp.rollback, + bChp.selfDestruct, + bChp.setError, + bChp.shouldBurnGas, + bChp.snapshot, + bChp.traceError, + bChp.traceOpCodeEnded, + bChp.traceOpCodeStarted, + bChp.tracingEnabled, + bChp.writeContract, + cVmc.execCallOrCreate, + cVmc.executeOpcodes, + dVmf.Fork, + eGmt.consumeGas, + eGmt.init, + eGmt.refundGas, + eGmt.returnGas, + fVmo.Op, + gVmg.isCreate, + hStk.Stack, + hStk.`$`, + hStk.`[]`, + hStk.dup, + hStk.len, + hStk.newStack, + hStk.peek, + hStk.peekInt, + hStk.popAddress, + hStk.popInt, + hStk.popTopic, + hStk.push, + hStk.swap, + hStk.top # End