Skip to content

Commit f182e4b

Browse files
committed
trie -> new CP mechanism: minor fixes, removed ScratchDB related src files and tests
1 parent 1d757e5 commit f182e4b

File tree

8 files changed

+0
-164
lines changed

8 files changed

+0
-164
lines changed

packages/trie/src/checkpointTrie.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export class CheckpointTrie extends BaseTrie {
4949
}
5050

5151
await this.lock.wait()
52-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
5352
this.root = await this.db.revert()
5453
this.lock.signal()
5554
}

packages/trie/src/db.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,6 @@ export class DB {
166166
if (this.isCheckpoint) {
167167
for (const op of opStack) {
168168
if (op.type === 'put') {
169-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
170-
if (!op.value) {
171-
continue
172-
}
173169
await this.put(op.key, op.value)
174170
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
175171
} else if (op.type === 'del') {

packages/trie/src/scratch.ts

Lines changed: 0 additions & 56 deletions
This file was deleted.

packages/trie/src/scratchReadStream.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.

packages/trie/test/db.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ tape('DB tests', (t) => {
88
const v = Buffer.from('v1')
99
const k2 = Buffer.from('k2')
1010
const v2 = Buffer.from('v2')
11-
//const k3 = Buffer.from('k3')
1211
const v3 = Buffer.from('v3')
1312

1413
t.test('Operations: puts and gets value', async (st) => {

packages/trie/test/scratch.spec.ts

Lines changed: 0 additions & 45 deletions
This file was deleted.

packages/trie/test/stream.spec.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -156,31 +156,9 @@ tape('db stream test', function (tester) {
156156
},
157157
] as BatchDBOp[]
158158

159-
/*const expectedNodes = {
160-
'3c38d9aa6ad288c8e27da701e17fe99a5b67c8b12fd0469651c80494d36bc4c1': true,
161-
d5f61e1ff2b918d1c2a2c4b1732a3c68bd7e3fd64f35019f2f084896d4546298: true,
162-
e64329dadee2fb8a113b4c88cfe973aeaa9b523d4dc8510b84ca23f9d5bfbd90: true,
163-
c916d458bfb5f27603c5bd93b00f022266712514a59cde749f19220daffc743f: true,
164-
'2386bfb0de9cf93902a110f5ab07b917ffc0b9ea599cb7f4f8bb6fd1123c866c': true,
165-
} as any*/
166-
167159
it('should populate trie', async function (t) {
168160
trie.checkpoint()
169161
await trie.batch(ops)
170162
t.end()
171163
})
172-
173-
/*it('should only fetch nodes in the current trie', function (t) {
174-
const stream = trie._createScratchReadStream()
175-
stream.on('data', (d: any) => {
176-
const key = d.key.toString('hex')
177-
t.ok(!!expectedNodes[key])
178-
delete expectedNodes[key]
179-
})
180-
stream.on('end', () => {
181-
const keys = Object.keys(expectedNodes)
182-
t.equal(keys.length, 0)
183-
t.end()
184-
})
185-
})*/
186164
})

packages/vm/lib/state/stateManager.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ export default class DefaultStateManager implements StateManager {
161161
const account = await this.getAccount(address)
162162
const storageTrie = this._trie.copy(false)
163163
storageTrie.root = account.stateRoot
164-
//@ts-ignore
165164
storageTrie.db.checkpoints = []
166165
return storageTrie
167166
}

0 commit comments

Comments
 (0)