From 8812c4d3f9f57edff6706608b93a1c5567e57d9f Mon Sep 17 00:00:00 2001 From: gary rong Date: Thu, 25 Jul 2019 14:29:53 +0800 Subject: eth, graphql, internal/ethapi, les: polish and improve graphql (#19886) --- eth/api_backend.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'eth') diff --git a/eth/api_backend.go b/eth/api_backend.go index 708e5afaf..69904a70f 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -89,6 +89,10 @@ func (b *EthAPIBackend) BlockByNumber(ctx context.Context, number rpc.BlockNumbe return b.eth.blockchain.GetBlockByNumber(uint64(number)), nil } +func (b *EthAPIBackend) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) { + return b.eth.blockchain.GetBlockByHash(hash), nil +} + func (b *EthAPIBackend) StateAndHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*state.StateDB, *types.Header, error) { // Pending state is only known by the miner if number == rpc.PendingBlockNumber { @@ -107,14 +111,6 @@ func (b *EthAPIBackend) StateAndHeaderByNumber(ctx context.Context, number rpc.B return stateDb, header, err } -func (b *EthAPIBackend) GetHeader(ctx context.Context, hash common.Hash) *types.Header { - return b.eth.blockchain.GetHeaderByHash(hash) -} - -func (b *EthAPIBackend) GetBlock(ctx context.Context, hash common.Hash) (*types.Block, error) { - return b.eth.blockchain.GetBlockByHash(hash), nil -} - func (b *EthAPIBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error) { return b.eth.blockchain.GetReceiptsByHash(hash), nil } -- cgit v1.2.3