From 6063490a0a435df5c848fac898d748956bdaf6ed Mon Sep 17 00:00:00 2001 From: Aditya Vyas Date: Thu, 18 Jan 2024 13:29:36 -0500 Subject: [PATCH] undo changes - 2 --- cmd/soroban-rpc/internal/methods/get_transaction.go | 4 ++-- cmd/soroban-rpc/internal/methods/send_transaction.go | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/cmd/soroban-rpc/internal/methods/get_transaction.go b/cmd/soroban-rpc/internal/methods/get_transaction.go index 9367cf515..52df47552 100644 --- a/cmd/soroban-rpc/internal/methods/get_transaction.go +++ b/cmd/soroban-rpc/internal/methods/get_transaction.go @@ -63,7 +63,7 @@ type GetTransactionRequest struct { } type transactionGetter interface { - GetTransaction(hash xdr.Hash) (transactions.Transaction, bool, transactions.StoreRange, error) + GetTransaction(hash xdr.Hash) (transactions.Transaction, bool, transactions.StoreRange) } func GetTransaction(getter transactionGetter, request GetTransactionRequest) (GetTransactionResponse, error) { @@ -84,7 +84,7 @@ func GetTransaction(getter transactionGetter, request GetTransactionRequest) (Ge } } - tx, found, storeRange, err := getter.GetTransaction(txHash) + tx, found, storeRange := getter.GetTransaction(txHash) if err != nil { return GetTransactionResponse{}, err } diff --git a/cmd/soroban-rpc/internal/methods/send_transaction.go b/cmd/soroban-rpc/internal/methods/send_transaction.go index f24ded8f8..9fe1ae2da 100644 --- a/cmd/soroban-rpc/internal/methods/send_transaction.go +++ b/cmd/soroban-rpc/internal/methods/send_transaction.go @@ -48,7 +48,7 @@ type SendTransactionRequest struct { // LatestLedgerStore is a store which returns the latest ingested ledger. type LatestLedgerStore interface { // GetLatestLedger returns the latest ingested ledger. - GetLatestLedger() (transactions.LedgerInfo, error) + GetLatestLedger() transactions.LedgerInfo } // NewSendTransactionHandler returns a submit transaction json rpc handler @@ -74,10 +74,7 @@ func NewSendTransactionHandler(daemon interfaces.Daemon, logger *log.Entry, stor } txHash := hex.EncodeToString(hash[:]) - ledgerInfo, err := store.GetLatestLedger() - if err != nil { - return SendTransactionResponse{}, err - } + ledgerInfo := store.GetLatestLedger() resp, err := submitter.SubmitTransaction(ctx, request.Transaction) if err != nil {