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

VM: fix selectHardforkByBlockNumber default value #967

Merged
merged 2 commits into from
Nov 27, 2020
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
4 changes: 2 additions & 2 deletions packages/vm/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export interface VMOpts {
/**
* Select hardfork based upon block number. This automatically switches to the right hard fork based upon the block number.
*
* Default: `true`
* Default: `false`
*/
selectHardforkByBlockNumber?: boolean
}
Expand Down Expand Up @@ -211,7 +211,7 @@ export default class VM extends AsyncEventEmitter {

this._allowUnlimitedContractSize = opts.allowUnlimitedContractSize || false

this._selectHardforkByBlockNumber = opts.selectHardforkByBlockNumber ?? true
this._selectHardforkByBlockNumber = opts.selectHardforkByBlockNumber ?? false

if (this._common.eips().includes(2537)) {
if (IS_BROWSER) {
Expand Down
1 change: 0 additions & 1 deletion packages/vm/tests/BlockchainTestsRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export default async function runBlockchainTest(options: any, testData: any, t:
state,
blockchain,
common,
selectHardforkByBlockNumber: false,
})

// set up pre-state
Expand Down
4 changes: 2 additions & 2 deletions packages/vm/tests/api/runBlock.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ tape('should correctly use the selectHardforkByBlockNumber option', async (t) =>
)
}

const vm = new VM({ common: common1 })
const vm_noSelect = new VM({ common: common2, selectHardforkByBlockNumber: false })
const vm = new VM({ common: common1, selectHardforkByBlockNumber: true })
const vm_noSelect = new VM({ common: common2 })
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This checks that the default value is indeed false? @holgerd77


const txResultMuirGlacier = await vm.runBlock({
block: getBlock(common1),
Expand Down
1 change: 0 additions & 1 deletion packages/vm/tests/api/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export function setupVM(opts: VMOpts & { genesisBlock?: Block } = {}) {
})
}
return new VM({
selectHardforkByBlockNumber: false,
...opts,
})
}