ethereumjs-vm
Advanced tools
Comparing version 1.2.2 to 1.3.0
@@ -23,3 +23,3 @@ const util = require('util') | ||
*/ | ||
function VM (trie, blockchain) { | ||
function VM (trie, blockchain, opts) { | ||
this.stateManager = new StateManager({ | ||
@@ -34,2 +34,3 @@ trie: trie, | ||
this.trie = this.stateManager.trie | ||
this.opts = opts || {} | ||
@@ -36,0 +37,0 @@ // precompiled contracts |
@@ -45,2 +45,3 @@ const async = require('async') | ||
var suicides = opts.suicides | ||
var enableHomestead = this.opts.enableHomestead === undefined ? block.isHomestead() : this.opts.enableHomestead | ||
@@ -154,3 +155,3 @@ txValue = new BN(txValue) | ||
results.return = new Buffer([]) | ||
if (opts.block.isHomestead()) { | ||
if (enableHomestead) { | ||
results.exception = 0 | ||
@@ -157,0 +158,0 @@ err = results.exceptionError = ERROR.OUT_OF_GAS |
@@ -44,2 +44,4 @@ /* | ||
var block = opts.block || new Block(); | ||
// VM internal state | ||
@@ -67,3 +69,3 @@ var runState = { | ||
suicides: opts.suicides || {}, | ||
block: opts.block || new Block(), | ||
block: block, | ||
callValue: opts.value || new BN(0), | ||
@@ -75,3 +77,4 @@ address: opts.address || utils.zeros(32), | ||
code: opts.code, | ||
populateCache: opts.populateCache === undefined ? true : opts.populateCache | ||
populateCache: opts.populateCache === undefined ? true : opts.populateCache, | ||
enableHomestead: this.opts.enableHomestead === undefined ? block.isHomestead() : this.opts.enableHomestead // this == vm | ||
} | ||
@@ -83,3 +86,3 @@ | ||
if (!runState.block.isHomestead()) { | ||
if (!runState.enableHomestead) { | ||
delete opFns.DELEGATECALL | ||
@@ -86,0 +89,0 @@ } else { |
{ | ||
"name": "ethereumjs-vm", | ||
"version": "1.2.2", | ||
"version": "1.3.0", | ||
"description": "an ethereum VM implementation", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
2604880
81207
1