Skip to content

Commit 8812c4d

Browse files
rjl493456442karalabe
authored andcommitted
eth, graphql, internal/ethapi, les: polish and improve graphql (#19886)
1 parent e4232c1 commit 8812c4d

File tree

5 files changed

+49
-96
lines changed

5 files changed

+49
-96
lines changed

eth/api_backend.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ func (b *EthAPIBackend) BlockByNumber(ctx context.Context, number rpc.BlockNumbe
8989
return b.eth.blockchain.GetBlockByNumber(uint64(number)), nil
9090
}
9191

92+
func (b *EthAPIBackend) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) {
93+
return b.eth.blockchain.GetBlockByHash(hash), nil
94+
}
95+
9296
func (b *EthAPIBackend) StateAndHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*state.StateDB, *types.Header, error) {
9397
// Pending state is only known by the miner
9498
if number == rpc.PendingBlockNumber {
@@ -107,14 +111,6 @@ func (b *EthAPIBackend) StateAndHeaderByNumber(ctx context.Context, number rpc.B
107111
return stateDb, header, err
108112
}
109113

110-
func (b *EthAPIBackend) GetHeader(ctx context.Context, hash common.Hash) *types.Header {
111-
return b.eth.blockchain.GetHeaderByHash(hash)
112-
}
113-
114-
func (b *EthAPIBackend) GetBlock(ctx context.Context, hash common.Hash) (*types.Block, error) {
115-
return b.eth.blockchain.GetBlockByHash(hash), nil
116-
}
117-
118114
func (b *EthAPIBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error) {
119115
return b.eth.blockchain.GetReceiptsByHash(hash), nil
120116
}

0 commit comments

Comments
 (0)