aboutsummaryrefslogtreecommitdiffstats
path: root/les
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 /les
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 'les')
-rw-r--r--les/api_backend.go14
1 files changed, 5 insertions, 9 deletions
diff --git a/les/api_backend.go b/les/api_backend.go
index f1ac8ed5a..07601c242 100644
--- a/les/api_backend.go
+++ b/les/api_backend.go
@@ -74,7 +74,11 @@ func (b *LesApiBackend) BlockByNumber(ctx context.Context, number rpc.BlockNumbe
if header == nil || err != nil {
return nil, err
}
- return b.GetBlock(ctx, header.Hash())
+ return b.BlockByHash(ctx, header.Hash())
+}
+
+func (b *LesApiBackend) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) {
+ return b.eth.blockchain.GetBlockByHash(ctx, hash)
}
func (b *LesApiBackend) StateAndHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*state.StateDB, *types.Header, error) {
@@ -88,14 +92,6 @@ func (b *LesApiBackend) StateAndHeaderByNumber(ctx context.Context, number rpc.B
return light.NewState(ctx, header, b.eth.odr), header, nil
}
-func (b *LesApiBackend) GetHeader(ctx context.Context, hash common.Hash) *types.Header {
- return b.eth.blockchain.GetHeaderByHash(hash)
-}
-
-func (b *LesApiBackend) GetBlock(ctx context.Context, hash common.Hash) (*types.Block, error) {
- return b.eth.blockchain.GetBlockByHash(ctx, hash)
-}
-
func (b *LesApiBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error) {
if number := rawdb.ReadHeaderNumber(b.eth.chainDb, hash); number != nil {
return light.GetBlockReceipts(ctx, b.eth.odr, hash, *number)