Skip to content

Commit 38432bd

Browse files
committed
Update trie to v3.0.0, use v3 for StatelessRunner
1 parent 005b8ea commit 38432bd

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"testStateByzantium": "npm run build:dist && node ./tests/tester -s --fork='Byzantium' --dist",
1919
"testStateConstantinople": "npm run build:dist && node ./tests/tester -s --fork='Constantinople' --dist",
2020
"testStatePetersburg": "npm run build:dist && node ./tests/tester -s --fork='Petersburg' --dist",
21+
"testStateless": "npm run build:dist && node ./tests/tester --stateless --fork='Petersburg' --dist",
2122
"testBuildIntegrity": "npm run build:dist && node ./tests/tester -s --dist --test='stackOverflow'",
2223
"testBlockchain": "npm run build:dist && node --stack-size=1500 ./tests/tester -b --fork='Petersburg' --dist --excludeDir='GeneralStateTests'",
2324
"testBlockchainGeneralStateTests": "npm run build:dist && node --stack-size=1500 ./tests/tester -b --dist --dir='GeneralStateTests'",
@@ -58,7 +59,7 @@
5859
"ethereumjs-util": "^6.1.0",
5960
"fake-merkle-patricia-tree": "^1.0.1",
6061
"functional-red-black-tree": "^1.0.1",
61-
"merkle-patricia-tree": "^2.3.2",
62+
"merkle-patricia-tree": "^3.0.0",
6263
"rustbn.js": "~0.2.0",
6364
"safe-buffer": "^5.1.1",
6465
"util.promisify": "^1.0.0"

tests/StatelessRunner.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async function runTestCase (options, testData, t) {
4444
// Determine set of all node hashes in the database
4545
// before running the tx.
4646
const existingKeys = new Set()
47-
const it = stateManager._trie.db._leveldb.iterator()
47+
const it = stateManager._trie.db.iterator()
4848
const next = promisify(it.next.bind(it))
4949
while (true) {
5050
const key = await next()
@@ -56,8 +56,8 @@ async function runTestCase (options, testData, t) {
5656
// to a bag of proof nodes, under the condition that this node existed
5757
// before execution.
5858
const proofNodes = new Map()
59-
const getFunc = stateManager._trie.db._leveldb.get.bind(stateManager._trie.db._leveldb)
60-
stateManager._trie.db._leveldb.get = (key, opts, cb) => {
59+
const getFunc = stateManager._trie.db.get.bind(stateManager._trie.db)
60+
stateManager._trie.db.get = (key, opts, cb) => {
6161
getFunc(key, opts, (err, v) => {
6262
if (!err && v) {
6363
if (existingKeys.has(key.toString('hex'))) {

0 commit comments

Comments
 (0)