Skip to content

Commit

Permalink
Update lib/ code to support petersburg hardfork
Browse files Browse the repository at this point in the history
  • Loading branch information
danjm committed Feb 1, 2019
1 parent e8f7d72 commit 0e77f8a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ function VM (opts = {}) {
let hardfork = opts.hardfork ? opts.hardfork : 'byzantium'
let supportedHardforks = [
'byzantium',
'constantinople'
'constantinople',
'petersburg'
]
this._common = new Common(chain, hardfork, supportedHardforks)

Expand Down
4 changes: 2 additions & 2 deletions lib/vm/opFns.js
Original file line number Diff line number Diff line change
Expand Up @@ -1082,15 +1082,15 @@ function isCreateOpCode (opName) {
}

function getContractStorage (runState, address, key, cb) {
if (runState._common.gteHardfork('constantinople')) {
if (runState._common.activeHardfork() === 'constantinople') {
runState.storageReader.getContractStorage(address, key, cb)
} else {
runState.stateManager.getContractStorage(address, key, cb)
}
}

function updateSstoreGas (runState, found, value) {
if (runState._common.gteHardfork('constantinople')) {
if (runState._common.activeHardfork() === 'constantinople') {
var original = found.original
var current = found.current
if (current.equals(value)) {
Expand Down

0 comments on commit 0e77f8a

Please sign in to comment.