Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { promisify } from 'util'
import * as assert from 'assert'
import * as ethUtil from 'ethereumjs-util'
import Account from 'ethereumjs-account'
import VM from './index'
import { default as StateManager, StateManagerOpts } from './state/stateManager'
import runTx from './runTx'
const SecureTrie = require('merkle-patricia-tree/secure')
const verifyProof = promisify(SecureTrie.verifyProof)
export class HookedStateManager extends StateManager {
seenKeys: Set
origState: StateManager
proofNodes: Map
constructor(opts: StateManagerOpts) {
super(opts)
this.seenKeys = new Set()
this.origState = new StateManager()
this.proofNodes = new Map()
}
getAccount(addr: Buffer, cb: Function) {
super.getAccount(addr, (err: Error, res: Account) => {
if (!err && !this.seenKeys.has(addr.toString('hex'))) {