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

@ -448,6 +448,10 @@ func (hc *HeaderChain) GetHeaderByNumber(number uint64) *types.Header {
return hc.GetHeader(hash, number)
}
func (hc *HeaderChain) GetCanonicalHash(number uint64) common.Hash {
return rawdb.ReadCanonicalHash(hc.chainDb, number)
}
// CurrentHeader retrieves the current head header of the canonical chain. The
// header is retrieved from the HeaderChain's internal cache.
func (hc *HeaderChain) CurrentHeader() *types.Header {