Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename vm to evm, move precompiles to evm module #481

Merged
merged 2 commits into from
Mar 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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')
Expand Down
Original file line number Diff line number Diff line change
@@ -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')

Expand Down
Original file line number Diff line number Diff line change
@@ -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')
Expand Down
File renamed without changes.
16 changes: 8 additions & 8 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions lib/runCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/api/vm/memory.js → tests/api/evm/memory.js
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
2 changes: 1 addition & 1 deletion tests/api/vm/stack.js → tests/api/evm/stack.js
Original file line number Diff line number Diff line change
@@ -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 => {
Expand Down