From ffb9d9024f024177baf969a48c7a67e1c2646f71 Mon Sep 17 00:00:00 2001
From: pritsheth <prit.sheth@stellar.org>
Date: Wed, 7 Feb 2024 17:07:06 -0800
Subject: [PATCH] Fix tests

---
 cmd/soroban-rpc/internal/methods/get_transaction.go      | 3 ++-
 cmd/soroban-rpc/internal/methods/get_transaction_test.go | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/cmd/soroban-rpc/internal/methods/get_transaction.go b/cmd/soroban-rpc/internal/methods/get_transaction.go
index 8187d3f0..de58be64 100644
--- a/cmd/soroban-rpc/internal/methods/get_transaction.go
+++ b/cmd/soroban-rpc/internal/methods/get_transaction.go
@@ -108,11 +108,12 @@ func GetTransaction(getter transactionGetter, request GetTransactionRequest) (Ge
 	response.ResultXdr = base64.StdEncoding.EncodeToString(tx.Result)
 	response.EnvelopeXdr = base64.StdEncoding.EncodeToString(tx.Envelope)
 	response.ResultMetaXdr = base64.StdEncoding.EncodeToString(tx.Meta)
+	response.DiagnosticEventsXDR = base64EncodeSlice(tx.Events)
+
 	if tx.Successful {
 		response.Status = TransactionStatusSuccess
 	} else {
 		response.Status = TransactionStatusFailed
-		response.DiagnosticEventsXDR = base64EncodeSlice(tx.Events)
 	}
 	return response, nil
 }
diff --git a/cmd/soroban-rpc/internal/methods/get_transaction_test.go b/cmd/soroban-rpc/internal/methods/get_transaction_test.go
index 85847f00..dd5f9637 100644
--- a/cmd/soroban-rpc/internal/methods/get_transaction_test.go
+++ b/cmd/soroban-rpc/internal/methods/get_transaction_test.go
@@ -154,6 +154,7 @@ func TestGetTransaction(t *testing.T) {
 		ResultMetaXdr:         expectedTxMeta,
 		Ledger:                101,
 		LedgerCloseTime:       2625,
+		DiagnosticEventsXDR:   []string{},
 	}, tx)
 
 	// ingest another (failed) transaction
@@ -177,6 +178,7 @@ func TestGetTransaction(t *testing.T) {
 		ResultMetaXdr:         expectedTxMeta,
 		Ledger:                101,
 		LedgerCloseTime:       2625,
+		DiagnosticEventsXDR:   []string{},
 	}, tx)
 
 	// the new transaction should also be there
@@ -206,5 +208,6 @@ func TestGetTransaction(t *testing.T) {
 		ResultMetaXdr:         expectedTxMeta,
 		Ledger:                102,
 		LedgerCloseTime:       2650,
+		DiagnosticEventsXDR:   []string{},
 	}, tx)
 }