Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
psheth9 committed Feb 8, 2024
1 parent d94be33 commit ffb9d90
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/soroban-rpc/internal/methods/get_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 3 additions & 0 deletions cmd/soroban-rpc/internal/methods/get_transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ func TestGetTransaction(t *testing.T) {
ResultMetaXdr: expectedTxMeta,
Ledger: 101,
LedgerCloseTime: 2625,
DiagnosticEventsXDR: []string{},
}, tx)

// ingest another (failed) transaction
Expand All @@ -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
Expand Down Expand Up @@ -206,5 +208,6 @@ func TestGetTransaction(t *testing.T) {
ResultMetaXdr: expectedTxMeta,
Ledger: 102,
LedgerCloseTime: 2650,
DiagnosticEventsXDR: []string{},
}, tx)
}

0 comments on commit ffb9d90

Please sign in to comment.