Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
nonce: "0x42",
extraData: "0x1234",
stateRoot: bufferToHex(stateTrie.root)
}
},
hardfork
);
const stateManager = new StateManager({
common: common as any, // TS error because of a version mismatch
trie: stateTrie
});
const blockchain = new Blockchain();
const vm = new VM({
common: common as any, // TS error because of a version mismatch
activatePrecompiles: true,
stateManager,
blockchain: blockchain as any
});
const genesisBlock = new Block(null, { common });
genesisBlock.setGenesisParams();
await new Promise(resolve => {
blockchain.putBlock(genesisBlock, () => resolve());
});
const node = new BuidlerNode(
vm,
genesisAccounts.map(acc => toBuffer(acc.privateKey)),