Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async get(address: Address, blockNumber: Buffer | Tag = Tag.LATEST): Promise {
const blockchain = this.blockchain;
const block = await blockchain.blocks.get(blockNumber);
const trieCopy = new Trie((blockchain as any).database.trie, block.value.header.stateRoot);
return new Promise((resolve, reject) => {
trieCopy.get(address.toBuffer(), (err, data)=>{
if(err) return reject(err);
resolve(new Account(data));
});
});
}
}