@@ -351,8 +351,15 @@ func TestStoreRecord(t *testing.T) {
351
351
op : 0 ,
352
352
}
353
353
354
+ // Create a sweepTxCtx.
355
+ sweepCtx := & sweepTxCtx {
356
+ tx : tx ,
357
+ fee : fee ,
358
+ outpointToTxIndex : utxoIndex ,
359
+ }
360
+
354
361
// Call the method under test.
355
- tp .storeRecord (initialCounter , tx , req , feeFunc , fee , utxoIndex )
362
+ tp .storeRecord (initialCounter , sweepCtx , req , feeFunc )
356
363
357
364
// Read the saved record and compare.
358
365
record , ok := tp .records .Load (initialCounter )
@@ -698,7 +705,15 @@ func TestTxPublisherBroadcast(t *testing.T) {
698
705
// Create a testing record and put it in the map.
699
706
fee := btcutil .Amount (1000 )
700
707
requestID := uint64 (1 )
701
- tp .storeRecord (requestID , tx , req , m .feeFunc , fee , utxoIndex )
708
+
709
+ // Create a sweepTxCtx.
710
+ sweepCtx := & sweepTxCtx {
711
+ tx : tx ,
712
+ fee : fee ,
713
+ outpointToTxIndex : utxoIndex ,
714
+ }
715
+
716
+ tp .storeRecord (requestID , sweepCtx , req , m .feeFunc )
702
717
703
718
// Quickly check when the requestID cannot be found, an error is
704
719
// returned.
@@ -796,6 +811,13 @@ func TestRemoveResult(t *testing.T) {
796
811
// Create a test request ID counter.
797
812
requestCounter := atomic.Uint64 {}
798
813
814
+ // Create a sweepTxCtx.
815
+ sweepCtx := & sweepTxCtx {
816
+ tx : tx ,
817
+ fee : fee ,
818
+ outpointToTxIndex : utxoIndex ,
819
+ }
820
+
799
821
testCases := []struct {
800
822
name string
801
823
setupRecord func () uint64
@@ -808,9 +830,7 @@ func TestRemoveResult(t *testing.T) {
808
830
name : "remove on TxConfirmed" ,
809
831
setupRecord : func () uint64 {
810
832
rid := requestCounter .Add (1 )
811
- tp .storeRecord (
812
- rid , tx , req , m .feeFunc , fee , utxoIndex ,
813
- )
833
+ tp .storeRecord (rid , sweepCtx , req , m .feeFunc )
814
834
tp .subscriberChans .Store (rid , nil )
815
835
816
836
return rid
@@ -826,9 +846,7 @@ func TestRemoveResult(t *testing.T) {
826
846
name : "remove on TxFailed" ,
827
847
setupRecord : func () uint64 {
828
848
rid := requestCounter .Add (1 )
829
- tp .storeRecord (
830
- rid , tx , req , m .feeFunc , fee , utxoIndex ,
831
- )
849
+ tp .storeRecord (rid , sweepCtx , req , m .feeFunc )
832
850
tp .subscriberChans .Store (rid , nil )
833
851
834
852
return rid
@@ -845,9 +863,7 @@ func TestRemoveResult(t *testing.T) {
845
863
name : "noop when tx is not confirmed or failed" ,
846
864
setupRecord : func () uint64 {
847
865
rid := requestCounter .Add (1 )
848
- tp .storeRecord (
849
- rid , tx , req , m .feeFunc , fee , utxoIndex ,
850
- )
866
+ tp .storeRecord (rid , sweepCtx , req , m .feeFunc )
851
867
tp .subscriberChans .Store (rid , nil )
852
868
853
869
return rid
@@ -906,7 +922,15 @@ func TestNotifyResult(t *testing.T) {
906
922
// Create a testing record and put it in the map.
907
923
fee := btcutil .Amount (1000 )
908
924
requestID := uint64 (1 )
909
- tp .storeRecord (requestID , tx , req , m .feeFunc , fee , utxoIndex )
925
+
926
+ // Create a sweepTxCtx.
927
+ sweepCtx := & sweepTxCtx {
928
+ tx : tx ,
929
+ fee : fee ,
930
+ outpointToTxIndex : utxoIndex ,
931
+ }
932
+
933
+ tp .storeRecord (requestID , sweepCtx , req , m .feeFunc )
910
934
911
935
// Create a subscription to the event.
912
936
subscriber := make (chan * BumpResult , 1 )
@@ -1208,7 +1232,15 @@ func TestHandleTxConfirmed(t *testing.T) {
1208
1232
// Create a testing record and put it in the map.
1209
1233
fee := btcutil .Amount (1000 )
1210
1234
requestID := uint64 (1 )
1211
- tp .storeRecord (requestID , tx , req , m .feeFunc , fee , utxoIndex )
1235
+
1236
+ // Create a sweepTxCtx.
1237
+ sweepCtx := & sweepTxCtx {
1238
+ tx : tx ,
1239
+ fee : fee ,
1240
+ outpointToTxIndex : utxoIndex ,
1241
+ }
1242
+
1243
+ tp .storeRecord (requestID , sweepCtx , req , m .feeFunc )
1212
1244
record , ok := tp .records .Load (requestID )
1213
1245
require .True (t , ok )
1214
1246
@@ -1289,7 +1321,15 @@ func TestHandleFeeBumpTx(t *testing.T) {
1289
1321
// Create a testing record and put it in the map.
1290
1322
fee := btcutil .Amount (1000 )
1291
1323
requestID := uint64 (1 )
1292
- tp .storeRecord (requestID , tx , req , m .feeFunc , fee , utxoIndex )
1324
+
1325
+ // Create a sweepTxCtx.
1326
+ sweepCtx := & sweepTxCtx {
1327
+ tx : tx ,
1328
+ fee : fee ,
1329
+ outpointToTxIndex : utxoIndex ,
1330
+ }
1331
+
1332
+ tp .storeRecord (requestID , sweepCtx , req , m .feeFunc )
1293
1333
1294
1334
// Create a subscription to the event.
1295
1335
subscriber := make (chan * BumpResult , 1 )
0 commit comments