aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorgary rong <garyrong0905@gmail.com>2019-07-25 14:29:53 +0800
committerPéter Szilágyi <peterke@gmail.com>2019-07-25 14:29:53 +0800
commit8812c4d3f9f57edff6706608b93a1c5567e57d9f (patch)
tree55928862d34e89c8e0048065b926bad5b8f03aeb /eth
parente4232c153ba93a71a3e39a74dbe5f1d7c1ad46ac (diff)
downloadgo-tangerine-8812c4d3f9f57edff6706608b93a1c5567e57d9f.tar
go-tangerine-8812c4d3f9f57edff6706608b93a1c5567e57d9f.tar.gz
go-tangerine-8812c4d3f9f57edff6706608b93a1c5567e57d9f.tar.bz2
go-tangerine-8812c4d3f9f57edff6706608b93a1c5567e57d9f.tar.lz
go-tangerine-8812c4d3f9f57edff6706608b93a1c5567e57d9f.tar.xz
go-tangerine-8812c4d3f9f57edff6706608b93a1c5567e57d9f.tar.zst
go-tangerine-8812c4d3f9f57edff6706608b93a1c5567e57d9f.zip
eth, graphql, internal/ethapi, les: polish and improve graphql (#19886)
Diffstat (limited to 'eth')
-rw-r--r--eth/api_backend.go12
1 files changed, 4 insertions, 8 deletions
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
}