api test: fixes the testBackend with the missing method

This commit is contained in:
R-Niagra 2024-12-24 21:18:07 -05:00
parent 488cbc658e
commit 036ff656f4

View file

@ -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