internal/ethapi: support block number or hash on state-related methods (#19491)

This change adds support for EIP-1898.
This commit is contained in:
Ryan Schneider
2019-09-26 01:47:31 -07:00
committed by Felix Lange
parent 62391ddbeb
commit ad03d9801c
10 changed files with 408 additions and 166 deletions

View File

@ -2139,6 +2139,11 @@ func (bc *BlockChain) HasHeader(hash common.Hash, number uint64) bool {
return bc.hc.HasHeader(hash, number)
}
// GetCanonicalHash returns the canonical hash for a given block number
func (bc *BlockChain) GetCanonicalHash(number uint64) common.Hash {
return bc.hc.GetCanonicalHash(number)
}
// GetBlockHashesFromHash retrieves a number of block hashes starting at a given
// hash, fetching towards the genesis block.
func (bc *BlockChain) GetBlockHashesFromHash(hash common.Hash, max uint64) []common.Hash {