Skip to content

Commit

Permalink
Add txHash field to getTransaction after upstream merge (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic authored Oct 29, 2024
1 parent 5932852 commit bb6c594
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/soroban-rpc/internal/methods/get_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func GetTransaction(
OldestLedger: storeRange.FirstLedger.Sequence,
OldestLedgerCloseTime: storeRange.FirstLedger.CloseTime,
}
response.TransactionHash = request.Hash
if errors.Is(err, db.ErrNoTransaction) {
response.Status = TransactionStatusNotFound
return response, nil
Expand Down
7 changes: 6 additions & 1 deletion cmd/soroban-rpc/internal/methods/get_transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ func TestGetTransaction(t *testing.T) {
require.NoError(t, err)
require.Equal(t, GetTransactionResponse{
TransactionDetails: TransactionDetails{
Status: TransactionStatusNotFound,
Status: TransactionStatusNotFound,
TransactionHash: hash,
},
}, tx)

Expand All @@ -64,6 +65,7 @@ func TestGetTransaction(t *testing.T) {
Status: TransactionStatusSuccess,
ApplicationOrder: 1,
FeeBump: false,
TransactionHash: hash,
EnvelopeXDR: expectedEnvelope,
ResultXDR: expectedTxResult,
ResultMetaXDR: expectedTxMeta,
Expand All @@ -88,6 +90,7 @@ func TestGetTransaction(t *testing.T) {
TransactionDetails: TransactionDetails{
Status: TransactionStatusSuccess,
ApplicationOrder: 1,
TransactionHash: hash,
FeeBump: false,
EnvelopeXDR: expectedEnvelope,
ResultXDR: expectedTxResult,
Expand Down Expand Up @@ -120,6 +123,7 @@ func TestGetTransaction(t *testing.T) {
Status: TransactionStatusFailed,
ApplicationOrder: 1,
FeeBump: false,
TransactionHash: hash,
EnvelopeXDR: expectedEnvelope,
ResultXDR: expectedTxResult,
ResultMetaXDR: expectedTxMeta,
Expand Down Expand Up @@ -155,6 +159,7 @@ func TestGetTransaction(t *testing.T) {
Status: TransactionStatusSuccess,
ApplicationOrder: 1,
FeeBump: false,
TransactionHash: hash,
EnvelopeXDR: expectedEnvelope,
ResultXDR: expectedTxResult,
ResultMetaXDR: expectedTxMeta,
Expand Down

0 comments on commit bb6c594

Please sign in to comment.