Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.origState._getStorageTrie(addr, (err: Error, trie: any) => {
if (err) return cb(err, null)
if (trie.root.equals(ethUtil.KECCAK256_RLP)) {
return cb(null, value)
}
SecureTrie.prove(trie, key, (err: Error, proof: Buffer[]) => {
if (err) return cb(err, null)
for (const n of proof) {
const h = ethUtil.keccak256(n)
this.proofNodes.set(h.toString('hex'), n)
}
})
})
super.getAccount(addr, (err: Error, res: Account) => {
if (!err && !this.seenKeys.has(addr.toString('hex'))) {
this.seenKeys.add(addr.toString('hex'))
const trie = this.origState._trie.copy()
SecureTrie.prove(trie, addr, (err: Error, proof: Buffer[]) => {
if (err) {
return cb(err, null)
}
for (const n of proof) {
const h = ethUtil.keccak256(n)
this.proofNodes.set(h.toString('hex'), n)
}
cb(null, res)
})
} else {
cb(err, res)
}
})
}