From 47da5b888678ed7006547b9140dc253db758288c Mon Sep 17 00:00:00 2001 From: Zsolt Felfoldi Date: Wed, 8 May 2019 15:41:11 +0200 Subject: [PATCH] les, eth, internal/ethapi: renamed GetCanonicalTransaction to GetTransaction --- eth/api_backend.go | 2 +- internal/ethapi/api.go | 4 ++-- internal/ethapi/backend.go | 2 +- les/api_backend.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eth/api_backend.go b/eth/api_backend.go index cd2cdb41c0..4d86380707 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -175,7 +175,7 @@ func (b *EthAPIBackend) GetPoolTransaction(hash common.Hash) *types.Transaction return b.eth.txPool.Get(hash) } -func (b *EthAPIBackend) GetCanonicalTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error) { +func (b *EthAPIBackend) GetTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error) { tx, blockHash, blockNumber, index := rawdb.ReadTransaction(b.eth.ChainDb(), txHash) return tx, blockHash, blockNumber, index, nil } diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 5f4da51672..2b9c9f2a9d 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1154,7 +1154,7 @@ func (s *PublicTransactionPoolAPI) GetTransactionCount(ctx context.Context, addr // GetTransactionByHash returns the transaction for the given hash func (s *PublicTransactionPoolAPI) GetTransactionByHash(ctx context.Context, hash common.Hash) (*RPCTransaction, error) { // Try to return an already finalized transaction - tx, blockHash, blockNumber, index, err := s.b.GetCanonicalTransaction(ctx, hash) + tx, blockHash, blockNumber, index, err := s.b.GetTransaction(ctx, hash) if err != nil { return nil, err } @@ -1173,7 +1173,7 @@ func (s *PublicTransactionPoolAPI) GetTransactionByHash(ctx context.Context, has // GetRawTransactionByHash returns the bytes of the transaction for the given hash. func (s *PublicTransactionPoolAPI) GetRawTransactionByHash(ctx context.Context, hash common.Hash) (hexutil.Bytes, error) { // Retrieve a finalized transaction, or a pooled otherwise - tx, _, _, _, err := s.b.GetCanonicalTransaction(ctx, hash) + tx, _, _, _, err := s.b.GetTransaction(ctx, hash) if err != nil { return nil, err } diff --git a/internal/ethapi/backend.go b/internal/ethapi/backend.go index e2e364cf00..9229ccfb64 100644 --- a/internal/ethapi/backend.go +++ b/internal/ethapi/backend.go @@ -62,7 +62,7 @@ type Backend interface { // TxPool API SendTx(ctx context.Context, signedTx *types.Transaction) error - GetCanonicalTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error) + GetTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error) GetPoolTransactions() (types.Transactions, error) GetPoolTransaction(txHash common.Hash) *types.Transaction GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error) diff --git a/les/api_backend.go b/les/api_backend.go index a18009e2fb..d216cbc978 100644 --- a/les/api_backend.go +++ b/les/api_backend.go @@ -128,7 +128,7 @@ func (b *LesApiBackend) GetPoolTransaction(txHash common.Hash) *types.Transactio return b.eth.txPool.GetTransaction(txHash) } -func (b *LesApiBackend) GetCanonicalTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error) { +func (b *LesApiBackend) GetTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error) { return light.GetTransaction(ctx, b.eth.odr, txHash) }