@@ -204,6 +204,29 @@ def run_test(self):
204
204
assert_equal (success , True )
205
205
assert_equal (use_aps , None )
206
206
207
+ self .log .info ("Change position is -1 if no change is created with APS when APS was initially not used" )
208
+ # We should have 2 tracepoints in the order:
209
+ # 1. selected_coins (type 1)
210
+ # 2. normal_create_tx_internal (type 2)
211
+ # 3. attempting_aps_create_tx (type 3)
212
+ # 4. selected_coins (type 1)
213
+ # 5. aps_create_tx_internal (type 4)
214
+ wallet .sendtoaddress (address = wallet .getnewaddress (), amount = wallet .getbalance (), subtractfeefromamount = True , avoid_reuse = False )
215
+ events = self .get_tracepoints ([1 , 2 , 3 , 1 , 4 ])
216
+ success , use_aps , algo , waste , change_pos = self .determine_selection_from_usdt (events )
217
+ assert_equal (success , True )
218
+ assert_equal (change_pos , - 1 )
219
+
220
+ self .log .info ("Change position is -1 if no change is created normally and APS is not used" )
221
+ # We should have 2 tracepoints in the order:
222
+ # 1. selected_coins (type 1)
223
+ # 2. normal_create_tx_internal (type 2)
224
+ wallet .sendtoaddress (address = wallet .getnewaddress (), amount = wallet .getbalance (), subtractfeefromamount = True )
225
+ events = self .get_tracepoints ([1 , 2 ])
226
+ success , use_aps , algo , waste , change_pos = self .determine_selection_from_usdt (events )
227
+ assert_equal (success , True )
228
+ assert_equal (change_pos , - 1 )
229
+
207
230
self .bpf .cleanup ()
208
231
209
232
0 commit comments