From b34eb9814fd7906991578d812cdcafdb0e54531b Mon Sep 17 00:00:00 2001 From: Aditya Vyas Date: Tue, 28 May 2024 12:46:56 -0400 Subject: [PATCH] Change txInfo Status to string --- cmd/soroban-rpc/internal/methods/get_transactions.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/soroban-rpc/internal/methods/get_transactions.go b/cmd/soroban-rpc/internal/methods/get_transactions.go index f8c38dd8..baea5a72 100644 --- a/cmd/soroban-rpc/internal/methods/get_transactions.go +++ b/cmd/soroban-rpc/internal/methods/get_transactions.go @@ -48,8 +48,8 @@ func (req GetTransactionsRequest) isValid(maxLimit uint, ledgerRange ledgerbucke } type TransactionInfo struct { - // Successful indicates whether the transaction was successful or not - Successful bool `json:"status"` + // Status is one of: TransactionSuccess, TransactionFailed. + Status string `json:"status"` // ApplicationOrder is the index of the transaction among all the transactions // for that ledger. ApplicationOrder int32 `json:"applicationOrder"` @@ -198,7 +198,6 @@ LedgerLoop: } txInfo := TransactionInfo{ - Successful: tx.Successful, ApplicationOrder: tx.ApplicationOrder, FeeBump: tx.FeeBump, ResultXdr: base64.StdEncoding.EncodeToString(tx.Result), @@ -208,6 +207,11 @@ LedgerLoop: Ledger: tx.Ledger.Sequence, LedgerCloseTime: tx.Ledger.CloseTime, } + txInfo.Status = TransactionStatusFailed + if tx.Successful { + txInfo.Status = TransactionStatusSuccess + } + txns = append(txns, txInfo) if len(txns) >= int(limit) { break LedgerLoop