@@ -20,6 +20,19 @@ const (
20
20
NetworkPassphrase string = "passphrase"
21
21
)
22
22
23
+ var expectedTransactionInfo = TransactionInfo {
24
+ Status : "SUCCESS" ,
25
+ TransactionHash : "b0d0b35dcaed0152d62fbbaa28ed3fa4991c87e7e169a8fca2687b17ee26ca2d" ,
26
+ ApplicationOrder : 1 ,
27
+ FeeBump : false ,
28
+ Ledger : 1 ,
29
+ LedgerCloseTime : 125 ,
30
+ EnvelopeXDR : "AAAAAgAAAQCAAAAAAAAAAD8MNL+TrQ2ZcdBMzJD3BVEcg4qtlzSkovsNegP8f+iaAAAAAQAAAAD///+dAAAAAAAAAAAAAAAAAAAAAAAAAAA=" , //nolint:lll
31
+ ResultMetaXDR : "AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAA" ,
32
+ ResultXDR : "AAAAAAAAAGQAAAAAAAAAAAAAAAA=" ,
33
+ DiagnosticEventsXDR : []string {},
34
+ }
35
+
23
36
// createTestLedger Creates a test ledger with 2 transactions
24
37
func createTestLedger (sequence uint32 ) xdr.LedgerCloseMeta {
25
38
sequence -= 100
@@ -70,6 +83,9 @@ func TestGetTransactions_DefaultLimit(t *testing.T) {
70
83
71
84
// assert transactions result
72
85
assert .Len (t , response .Transactions , 10 )
86
+
87
+ // assert the transaction structure. We will match only 1 tx for sanity purposes.
88
+ assert .Equal (t , expectedTransactionInfo , response .Transactions [0 ])
73
89
}
74
90
75
91
func TestGetTransactions_DefaultLimitExceedsLatestLedger (t * testing.T ) {
@@ -104,6 +120,9 @@ func TestGetTransactions_DefaultLimitExceedsLatestLedger(t *testing.T) {
104
120
105
121
// assert transactions result
106
122
assert .Len (t , response .Transactions , 6 )
123
+
124
+ // assert the transaction structure. We will match only 1 tx for sanity purposes.
125
+ assert .Equal (t , expectedTransactionInfo , response .Transactions [0 ])
107
126
}
108
127
109
128
func TestGetTransactions_CustomLimit (t * testing.T ) {
@@ -143,6 +162,9 @@ func TestGetTransactions_CustomLimit(t *testing.T) {
143
162
assert .Len (t , response .Transactions , 2 )
144
163
assert .Equal (t , uint32 (1 ), response .Transactions [0 ].Ledger )
145
164
assert .Equal (t , uint32 (1 ), response .Transactions [1 ].Ledger )
165
+
166
+ // assert the transaction structure. We will match only 1 tx for sanity purposes.
167
+ assert .Equal (t , expectedTransactionInfo , response .Transactions [0 ])
146
168
}
147
169
148
170
func TestGetTransactions_CustomLimitAndCursor (t * testing.T ) {
0 commit comments