File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import Account from 'ethereumjs-account'
4
4
import * as utils from 'ethereumjs-util'
5
5
import { promisify } from 'util'
6
6
import PStateManager from '../../lib/state/promisified'
7
- import { toBuffer } from 'ethereumjs-util'
8
7
9
8
const Block = require ( 'ethereumjs-block' )
10
9
const Blockchain = require ( 'ethereumjs-blockchain' )
@@ -55,6 +54,9 @@ function setEthashCache(blockchain: any) {
55
54
56
55
async function setupPreConditions ( vm : VM , testData : any ) {
57
56
const psm = new PStateManager ( vm . stateManager )
57
+
58
+ await psm . checkpoint ( )
59
+
58
60
for ( const address of Object . keys ( testData . pre ) ) {
59
61
const addressBuf = utils . toBuffer ( address )
60
62
@@ -78,8 +80,7 @@ async function setupPreConditions(vm: VM, testData: any) {
78
80
await psm . putContractCode ( addressBuf , codeBuf )
79
81
}
80
82
81
- // This forces a cache flush, which is necessary here
82
- await psm . getStateRoot ( )
83
+ await psm . commit ( )
83
84
}
84
85
85
86
async function setGenesisBlock ( blockchain : any , hardfork : string ) {
You can’t perform that action at this time.
0 commit comments