Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private constructor(
private readonly _vm: VM,
localAccounts: Buffer[],
private readonly _blockGasLimit: BN,
genesisBlock: Block,
private readonly _throwOnTransactionFailures: boolean,
private readonly _throwOnCallFailures: boolean,
stackTracesOptions?: SolidityTracerOptions
) {
const config = getUserConfigPath();
this._stateManager = new PStateManager(this._vm.stateManager);
this._common = this._vm._common as any; // TODO: There's a version mismatch, that's why we cast
this._initLocalAccounts(localAccounts);
this._blockHashToTotalDifficulty.set(
bufferToHex(genesisBlock.hash()),
this._computeTotalDifficulty(genesisBlock)
);
this._getLatestBlock = promisify(
this._vm.blockchain.getLatestBlock.bind(this._vm.blockchain)
);
this._getBlock = promisify(
this._vm.blockchain.getBlock.bind(this._vm.blockchain)
);