From c12b68acf72f9c9f106d36dd4b9c4fcfa965a650 Mon Sep 17 00:00:00 2001 From: Jeremy Wei Date: Mon, 23 Sep 2024 09:14:57 -0400 Subject: [PATCH] revert tx.go changes --- evmrpc/tx.go | 8 -------- evmrpc/tx_sei.go | 29 ----------------------------- evmrpc/tx_sei_test.go | 14 -------------- 3 files changed, 51 deletions(-) delete mode 100644 evmrpc/tx_sei.go delete mode 100644 evmrpc/tx_sei_test.go diff --git a/evmrpc/tx.go b/evmrpc/tx.go index f361d9cc3..9d773c872 100644 --- a/evmrpc/tx.go +++ b/evmrpc/tx.go @@ -43,10 +43,6 @@ func NewTransactionAPI(tmClient rpcclient.Client, k *keeper.Keeper, ctxProvider func (t *TransactionAPI) GetTransactionReceipt(ctx context.Context, hash common.Hash) (result map[string]interface{}, returnErr error) { startTime := time.Now() defer recordMetrics("eth_getTransactionReceipt", t.connectionType, startTime, returnErr == nil) - return t.getTransactionReceipt(ctx, hash) -} - -func (t *TransactionAPI) getTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error) { sdkctx := t.ctxProvider(LatestCtxHeight) receipt, err := t.keeper.GetReceipt(sdkctx, hash) if err != nil { @@ -105,10 +101,6 @@ func (t *TransactionAPI) GetTransactionByBlockHashAndIndex(ctx context.Context, func (t *TransactionAPI) GetTransactionByHash(ctx context.Context, hash common.Hash) (result *ethapi.RPCTransaction, returnErr error) { startTime := time.Now() defer recordMetrics("eth_getTransactionByHash", t.connectionType, startTime, returnErr == nil) - return t.getTransactionByHash(ctx, hash, false) -} - -func (t *TransactionAPI) getTransactionByHash(ctx context.Context, hash common.Hash, includeSynthetic bool) (*ethapi.RPCTransaction, error) { sdkCtx := t.ctxProvider(LatestCtxHeight) // first try get from mempool for page := 1; page <= UnconfirmedTxQueryMaxPage; page++ { diff --git a/evmrpc/tx_sei.go b/evmrpc/tx_sei.go deleted file mode 100644 index b45602244..000000000 --- a/evmrpc/tx_sei.go +++ /dev/null @@ -1,29 +0,0 @@ -package evmrpc - -import ( - "context" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/lib/ethapi" -) - -type SeiTransactionAPI struct { - *TransactionAPI -} - -func NewSeiTransactionAPI(t *TransactionAPI) *SeiTransactionAPI { - return &SeiTransactionAPI{t} -} - -func (t *SeiTransactionAPI) GetTransactionByHash(ctx context.Context, hash common.Hash) (result *ethapi.RPCTransaction, returnErr error) { - startTime := time.Now() - defer recordMetrics("sei_getTransactionByHash", t.connectionType, startTime, returnErr == nil) - return t.getTransactionByHash(ctx, hash, true) -} - -func (t *SeiTransactionAPI) GetTransactionReceipt(ctx context.Context, hash common.Hash) (result map[string]interface{}, returnErr error) { - startTime := time.Now() - defer recordMetrics("sei_getTransactionReceipt", t.connectionType, startTime, returnErr == nil) - return t.getTransactionReceipt(ctx, hash) -} diff --git a/evmrpc/tx_sei_test.go b/evmrpc/tx_sei_test.go deleted file mode 100644 index 29db0fc74..000000000 --- a/evmrpc/tx_sei_test.go +++ /dev/null @@ -1,14 +0,0 @@ -package evmrpc_test - -import ( - // "fmt" - "testing" -) - -func TestGetSeiTxReceipt(t *testing.T) { - testGetTxReceipt(t, "sei") -} - -func TestSeiGetTransaction(t *testing.T) { - testGetTransaction(t, "sei") -}