Skip to content

Commit

Permalink
Update tests to cover petersburg hardfork
Browse files Browse the repository at this point in the history
  • Loading branch information
danjm committed Feb 1, 2019
1 parent 0e77f8a commit 270ff43
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"testVM": "node ./tests/tester -v",
"testStateByzantium": "npm run build:dist && node ./tests/tester -s --fork='Byzantium' --dist",
"testStateConstantinople": "npm run build:dist && node ./tests/tester -s --fork='Constantinople' --dist",
"testStatePetersburg": "npm run build:dist && node ./tests/tester -s --fork='Petersburg' --dist",
"testBuildIntegrity": "npm run build:dist && node ./tests/tester -s --dist --test='stackOverflow'",
"testBlockchain": "npm run build:dist && node --stack-size=1500 ./tests/tester -b --fork='Constantinople' --dist --excludeDir='GeneralStateTests'",
"testBlockchainGeneralStateTests": "npm run build:dist && node --stack-size=1500 ./tests/tester -b --dist --dir='GeneralStateTests'",
Expand Down
6 changes: 5 additions & 1 deletion tests/GeneralStateTestsRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ function runTestCase (options, testData, t, cb) {

module.exports = function runStateTest (options, testData, t, cb) {
try {
const testCases = parseTestCases(options.forkConfig, testData, options.data, options.gasLimit, options.value)
let aliasForkConfig
if (options.forkConfig === 'Petersburg') {
aliasForkConfig = 'ConstantinopleFix'
}
const testCases = parseTestCases(aliasForkConfig || options.forkConfig, testData, options.data, options.gasLimit, options.value)
if (testCases.length > 0) {
async.eachSeries(testCases,
(testCase, done) => runTestCase(options, testCase, t, done),
Expand Down
2 changes: 1 addition & 1 deletion tests/tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ function runTests (name, runnerArgs, cb) {
testGetterArgs.skipTests = getSkipTests(argv.skip, argv.runSkipped ? 'NONE' : 'ALL')
testGetterArgs.runSkipped = getSkipTests(argv.runSkipped, 'NONE')
testGetterArgs.skipVM = skipVM
testGetterArgs.forkConfig = FORK_CONFIG
testGetterArgs.forkConfig = FORK_CONFIG === 'Petersburg' ? 'ConstantinopleFix' : FORK_CONFIG
testGetterArgs.file = argv.file
testGetterArgs.test = argv.test
testGetterArgs.dir = argv.dir
Expand Down

0 comments on commit 270ff43

Please sign in to comment.