@@ -98,24 +98,29 @@ fn spk_txout_sent_and_received_txouts() {
9898 script_pubkey: spk1. clone( ) ,
9999 } ] ,
100100 } ;
101-
102101 let ( sent_txouts, received_txouts) = index. sent_and_received_txouts ( & tx1, ..) ;
103102 assert ! ( sent_txouts. is_empty( ) ) ;
104103 assert_eq ! (
105104 received_txouts,
106- vec![ TxOut {
107- value: Amount :: from_sat( 42_000 ) ,
108- script_pubkey: spk1. clone( ) ,
109- } ]
105+ vec![ (
106+ 0 ,
107+ TxOut {
108+ value: Amount :: from_sat( 42_000 ) ,
109+ script_pubkey: spk1. clone( ) ,
110+ }
111+ ) ]
110112 ) ;
111113 let ( sent_txouts, received_txouts) = index. sent_and_received_txouts ( & tx1, ..1 ) ;
112114 assert ! ( sent_txouts. is_empty( ) ) ;
113115 assert_eq ! (
114116 received_txouts,
115- vec![ TxOut {
116- value: Amount :: from_sat( 42_000 ) ,
117- script_pubkey: spk1. clone( ) ,
118- } ]
117+ vec![ (
118+ 0 ,
119+ TxOut {
120+ value: Amount :: from_sat( 42_000 ) ,
121+ script_pubkey: spk1. clone( ) ,
122+ }
123+ ) ]
119124 ) ;
120125 let ( sent_txouts, received_txouts) = index. sent_and_received_txouts ( & tx1, 1 ..) ;
121126 assert ! ( sent_txouts. is_empty( ) && received_txouts. is_empty( ) ) ;
@@ -147,49 +152,67 @@ fn spk_txout_sent_and_received_txouts() {
147152 let ( sent_txouts, received_txouts) = index. sent_and_received_txouts ( & tx2, ..) ;
148153 assert_eq ! (
149154 sent_txouts,
150- vec![ TxOut {
151- value: Amount :: from_sat( 42_000 ) ,
152- script_pubkey: spk1. clone( ) ,
153- } ]
155+ vec![ (
156+ 0 ,
157+ TxOut {
158+ value: Amount :: from_sat( 42_000 ) ,
159+ script_pubkey: spk1. clone( ) ,
160+ }
161+ ) ]
154162 ) ;
155163 assert_eq ! (
156164 received_txouts,
157165 vec![
158- TxOut {
159- value: Amount :: from_sat( 20_000 ) ,
160- script_pubkey: spk2. clone( ) ,
161- } ,
162- TxOut {
163- value: Amount :: from_sat( 30_000 ) ,
164- script_pubkey: spk1. clone( ) ,
165- }
166+ (
167+ 0 ,
168+ TxOut {
169+ value: Amount :: from_sat( 20_000 ) ,
170+ script_pubkey: spk2. clone( ) ,
171+ }
172+ ) ,
173+ (
174+ 1 ,
175+ TxOut {
176+ value: Amount :: from_sat( 30_000 ) ,
177+ script_pubkey: spk1. clone( ) ,
178+ }
179+ )
166180 ]
167181 ) ;
168182
169183 let ( sent_txouts, received_txouts) = index. sent_and_received_txouts ( & tx2, ..1 ) ;
170184 assert_eq ! (
171185 sent_txouts,
172- vec![ TxOut {
173- value: Amount :: from_sat( 42_000 ) ,
174- script_pubkey: spk1. clone( ) ,
175- } ]
186+ vec![ (
187+ 0 ,
188+ TxOut {
189+ value: Amount :: from_sat( 42_000 ) ,
190+ script_pubkey: spk1. clone( ) ,
191+ }
192+ ) ]
176193 ) ;
177194 assert_eq ! (
178195 received_txouts,
179- vec![ TxOut {
180- value: Amount :: from_sat( 30_000 ) ,
181- script_pubkey: spk1. clone( ) ,
182- } ]
196+ vec![ (
197+ 1 ,
198+ TxOut {
199+ value: Amount :: from_sat( 30_000 ) ,
200+ script_pubkey: spk1. clone( ) ,
201+ }
202+ ) ]
183203 ) ;
184204
185205 let ( sent_txouts, received_txouts) = index. sent_and_received_txouts ( & tx2, 1 ..) ;
186206 assert ! ( sent_txouts. is_empty( ) ) ;
187207 assert_eq ! (
188208 received_txouts,
189- vec![ TxOut {
190- value: Amount :: from_sat( 20_000 ) ,
191- script_pubkey: spk2. clone( ) ,
192- } ]
209+ vec![ (
210+ 0 ,
211+ TxOut {
212+ value: Amount :: from_sat( 20_000 ) ,
213+ script_pubkey: spk2. clone( ) ,
214+ }
215+ ) ]
193216 ) ;
194217}
195218
0 commit comments