diff --git a/lib/vm/memory.js b/lib/evm/memory.js similarity index 100% rename from lib/vm/memory.js rename to lib/evm/memory.js diff --git a/lib/vm/opFns.js b/lib/evm/opFns.js similarity index 100% rename from lib/vm/opFns.js rename to lib/evm/opFns.js diff --git a/lib/vm/opcodes.js b/lib/evm/opcodes.js similarity index 100% rename from lib/vm/opcodes.js rename to lib/evm/opcodes.js diff --git a/lib/precompiled/01-ecrecover.js b/lib/evm/precompiles/01-ecrecover.js similarity index 95% rename from lib/precompiled/01-ecrecover.js rename to lib/evm/precompiles/01-ecrecover.js index f3e2e0f1f2..99de6c6eb3 100644 --- a/lib/precompiled/01-ecrecover.js +++ b/lib/evm/precompiles/01-ecrecover.js @@ -1,6 +1,6 @@ const utils = require('ethereumjs-util') const BN = utils.BN -const error = require('../exceptions.js').ERROR +const error = require('../../exceptions.js').ERROR const assert = require('assert') module.exports = function (opts) { diff --git a/lib/precompiled/02-sha256.js b/lib/evm/precompiles/02-sha256.js similarity index 93% rename from lib/precompiled/02-sha256.js rename to lib/evm/precompiles/02-sha256.js index 125ebd10cf..3c545f6851 100644 --- a/lib/precompiled/02-sha256.js +++ b/lib/evm/precompiles/02-sha256.js @@ -1,6 +1,6 @@ const utils = require('ethereumjs-util') const BN = utils.BN -const error = require('../exceptions.js').ERROR +const error = require('../../exceptions.js').ERROR const assert = require('assert') module.exports = function (opts) { diff --git a/lib/precompiled/03-ripemd160.js b/lib/evm/precompiles/03-ripemd160.js similarity index 93% rename from lib/precompiled/03-ripemd160.js rename to lib/evm/precompiles/03-ripemd160.js index 565d592f27..681ea3ac22 100644 --- a/lib/precompiled/03-ripemd160.js +++ b/lib/evm/precompiles/03-ripemd160.js @@ -1,6 +1,6 @@ const utils = require('ethereumjs-util') const BN = utils.BN -const error = require('../exceptions.js').ERROR +const error = require('../../exceptions.js').ERROR const assert = require('assert') module.exports = function (opts) { diff --git a/lib/precompiled/04-identity.js b/lib/evm/precompiles/04-identity.js similarity index 93% rename from lib/precompiled/04-identity.js rename to lib/evm/precompiles/04-identity.js index b1b5808691..dae1eee942 100644 --- a/lib/precompiled/04-identity.js +++ b/lib/evm/precompiles/04-identity.js @@ -1,6 +1,6 @@ const utils = require('ethereumjs-util') const BN = utils.BN -const error = require('../exceptions.js').ERROR +const error = require('../../exceptions.js').ERROR const assert = require('assert') module.exports = function (opts) { diff --git a/lib/precompiled/05-modexp.js b/lib/evm/precompiles/05-modexp.js similarity index 98% rename from lib/precompiled/05-modexp.js rename to lib/evm/precompiles/05-modexp.js index 60028bab71..e68f1f23dd 100644 --- a/lib/precompiled/05-modexp.js +++ b/lib/evm/precompiles/05-modexp.js @@ -1,6 +1,6 @@ const utils = require('ethereumjs-util') const BN = utils.BN -const error = require('../exceptions.js').ERROR +const error = require('../../exceptions.js').ERROR const assert = require('assert') function multComplexity (x) { diff --git a/lib/precompiled/06-ecadd.js b/lib/evm/precompiles/06-ecadd.js similarity index 94% rename from lib/precompiled/06-ecadd.js rename to lib/evm/precompiles/06-ecadd.js index 5a7188596e..8130ca6b22 100644 --- a/lib/precompiled/06-ecadd.js +++ b/lib/evm/precompiles/06-ecadd.js @@ -1,6 +1,6 @@ const utils = require('ethereumjs-util') const BN = utils.BN -const error = require('../exceptions.js').ERROR +const error = require('../../exceptions.js').ERROR const assert = require('assert') const bn128 = require('rustbn.js') diff --git a/lib/precompiled/07-ecmul.js b/lib/evm/precompiles/07-ecmul.js similarity index 94% rename from lib/precompiled/07-ecmul.js rename to lib/evm/precompiles/07-ecmul.js index dfca05f72f..741d34b255 100644 --- a/lib/precompiled/07-ecmul.js +++ b/lib/evm/precompiles/07-ecmul.js @@ -1,5 +1,5 @@ const utils = require('ethereumjs-util') -const ERROR = require('../exceptions.js').ERROR +const ERROR = require('../../exceptions.js').ERROR const BN = utils.BN const assert = require('assert') diff --git a/lib/precompiled/08-ecpairing.js b/lib/evm/precompiles/08-ecpairing.js similarity index 95% rename from lib/precompiled/08-ecpairing.js rename to lib/evm/precompiles/08-ecpairing.js index 6941dd6bac..d91655e9b8 100644 --- a/lib/precompiled/08-ecpairing.js +++ b/lib/evm/precompiles/08-ecpairing.js @@ -1,6 +1,6 @@ const utils = require('ethereumjs-util') const BN = utils.BN -const error = require('../exceptions.js').ERROR +const error = require('../../exceptions.js').ERROR const assert = require('assert') const bn128 = require('rustbn.js') diff --git a/lib/vm/stack.js b/lib/evm/stack.js similarity index 100% rename from lib/vm/stack.js rename to lib/evm/stack.js diff --git a/lib/index.js b/lib/index.js index 57673155e6..ab1ff19f77 100644 --- a/lib/index.js +++ b/lib/index.js @@ -9,14 +9,14 @@ const fakeBlockchain = require('./fakeBlockChain.js') const BN = ethUtil.BN // require the precompiled contracts -const num01 = require('./precompiled/01-ecrecover.js') -const num02 = require('./precompiled/02-sha256.js') -const num03 = require('./precompiled/03-ripemd160.js') -const num04 = require('./precompiled/04-identity.js') -const num05 = require('./precompiled/05-modexp.js') -const num06 = require('./precompiled/06-ecadd.js') -const num07 = require('./precompiled/07-ecmul.js') -const num08 = require('./precompiled/08-ecpairing.js') +const num01 = require('./evm/precompiles/01-ecrecover.js') +const num02 = require('./evm/precompiles/02-sha256.js') +const num03 = require('./evm/precompiles/03-ripemd160.js') +const num04 = require('./evm/precompiles/04-identity.js') +const num05 = require('./evm/precompiles/05-modexp.js') +const num06 = require('./evm/precompiles/06-ecadd.js') +const num07 = require('./evm/precompiles/07-ecmul.js') +const num08 = require('./evm/precompiles/08-ecpairing.js') /** * VM Class, `new VM(opts)` creates a new VM object diff --git a/lib/runCode.js b/lib/runCode.js index faa57837f6..1a432431db 100644 --- a/lib/runCode.js +++ b/lib/runCode.js @@ -15,10 +15,10 @@ const Buffer = require('safe-buffer').Buffer const async = require('async') const utils = require('ethereumjs-util') const Block = require('ethereumjs-block') -const lookupOpInfo = require('./vm/opcodes.js') -const opFns = require('./vm/opFns.js') -const Memory = require('./vm/memory') -const Stack = require('./vm/stack') +const lookupOpInfo = require('./evm/opcodes.js') +const opFns = require('./evm/opFns.js') +const Memory = require('./evm/memory') +const Stack = require('./evm/stack') const exceptions = require('./exceptions.js') const { StorageReader } = require('./state') const setImmediate = require('timers').setImmediate diff --git a/tests/api/vm/memory.js b/tests/api/evm/memory.js similarity index 95% rename from tests/api/vm/memory.js rename to tests/api/evm/memory.js index 5b65be5351..dee7805846 100644 --- a/tests/api/vm/memory.js +++ b/tests/api/evm/memory.js @@ -1,5 +1,5 @@ const tape = require('tape') -const Memory = require('../../../lib/vm/memory') +const Memory = require('../../../lib/evm/memory') tape('Memory', t => { const m = new Memory() diff --git a/tests/api/vm/stack.js b/tests/api/evm/stack.js similarity index 98% rename from tests/api/vm/stack.js rename to tests/api/evm/stack.js index 60704ae996..ad8cc71ab0 100644 --- a/tests/api/vm/stack.js +++ b/tests/api/evm/stack.js @@ -1,6 +1,6 @@ const tape = require('tape') const BN = require('bn.js') -const Stack = require('../../../lib/vm/stack') +const Stack = require('../../../lib/evm/stack') tape('Stack', t => { t.test('should be empty initially', st => {