mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 01:43:47 +00:00
api test: fixes the testBackend with the missing method
This commit is contained in:
parent
488cbc658e
commit
036ff656f4
1 changed files with 4 additions and 0 deletions
|
|
@ -98,6 +98,10 @@ func (b *testBackend) HeaderByHash(ctx context.Context, hash common.Hash) (*type
|
||||||
return b.chain.GetHeaderByHash(hash), nil
|
return b.chain.GetHeaderByHash(hash), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (b *testBackend) BlockChain() *core.BlockChain {
|
||||||
|
return b.chain
|
||||||
|
}
|
||||||
|
|
||||||
func (b *testBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error) {
|
func (b *testBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error) {
|
||||||
if number == rpc.PendingBlockNumber || number == rpc.LatestBlockNumber {
|
if number == rpc.PendingBlockNumber || number == rpc.LatestBlockNumber {
|
||||||
return b.chain.CurrentHeader(), nil
|
return b.chain.CurrentHeader(), nil
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue