internal/ethapi: add more testcases for block/header rpc (#27325)
Signed-off-by: jsvisa <delweng@gmail.com> Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
This commit is contained in:
@@ -731,8 +731,10 @@ func decodeHash(s string) (common.Hash, error) {
|
||||
}
|
||||
|
||||
// GetHeaderByNumber returns the requested canonical block header.
|
||||
// * When blockNr is -1 the chain head is returned.
|
||||
// * When blockNr is -2 the pending chain head is returned.
|
||||
// - When blockNr is -1 the chain pending header is returned.
|
||||
// - When blockNr is -2 the chain latest header is returned.
|
||||
// - When blockNr is -3 the chain finalized header is returned.
|
||||
// - When blockNr is -4 the chain safe header is returned.
|
||||
func (s *BlockChainAPI) GetHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (map[string]interface{}, error) {
|
||||
header, err := s.b.HeaderByNumber(ctx, number)
|
||||
if header != nil && err == nil {
|
||||
@@ -758,8 +760,10 @@ func (s *BlockChainAPI) GetHeaderByHash(ctx context.Context, hash common.Hash) m
|
||||
}
|
||||
|
||||
// GetBlockByNumber returns the requested canonical block.
|
||||
// - When blockNr is -1 the chain head is returned.
|
||||
// - When blockNr is -2 the pending chain head is returned.
|
||||
// - When blockNr is -1 the chain pending block is returned.
|
||||
// - When blockNr is -2 the chain latest block is returned.
|
||||
// - When blockNr is -3 the chain finalized block is returned.
|
||||
// - When blockNr is -4 the chain safe block is returned.
|
||||
// - When fullTx is true all transactions in the block are returned, otherwise
|
||||
// only the transaction hash is returned.
|
||||
func (s *BlockChainAPI) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, fullTx bool) (map[string]interface{}, error) {
|
||||
|
||||
Reference in New Issue
Block a user