@@ -113,7 +113,7 @@ func (h *mockPresignedHelper) DestPkScript(ctx context.Context,
113113}
114114
115115// SignTx tries to sign the transaction. If all the inputs are online, it signs
116- // the exact transaction passed and adds it to presignedBatches. Otherwise it
116+ // the exact transaction passed and adds it to presignedBatches. Otherwise, it
117117// looks for a transaction in presignedBatches satisfying the criteria.
118118func (h * mockPresignedHelper ) SignTx (ctx context.Context ,
119119 primarySweepID wire.OutPoint , tx * wire.MsgTx , inputAmt btcutil.Amount ,
@@ -273,7 +273,7 @@ func testPresigned_forgotten_presign(t *testing.T,
273273 presignedHelper .SetOutpointOnline (op1 , false )
274274 err := batcher .PresignSweepsGroup (
275275 ctx , []Input {{Outpoint : op1 , Value : 1_000_000 }},
276- sweepTimeout , destAddr ,
276+ sweepTimeout , destAddr , nil ,
277277 )
278278 require .Error (t , err )
279279 require .ErrorContains (t , err , "offline" )
@@ -350,7 +350,7 @@ func testPresigned_input1_offline_then_input2(t *testing.T,
350350 presignedHelper .SetOutpointOnline (op1 , true )
351351 err = batcher .PresignSweepsGroup (
352352 ctx , []Input {{Outpoint : op1 , Value : 1_000_000 }},
353- sweepTimeout , destAddr ,
353+ sweepTimeout , destAddr , nil ,
354354 )
355355 require .NoError (t , err )
356356
@@ -413,7 +413,7 @@ func testPresigned_input1_offline_then_input2(t *testing.T,
413413 presignedHelper .SetOutpointOnline (op2 , true )
414414 err = batcher .PresignSweepsGroup (
415415 ctx , []Input {{Outpoint : op2 , Value : 2_000_000 }},
416- sweepTimeout , destAddr ,
416+ sweepTimeout , destAddr , nil ,
417417 )
418418 require .NoError (t , err )
419419
@@ -520,7 +520,7 @@ func testPresigned_min_relay_fee(t *testing.T,
520520 presignedHelper .SetOutpointOnline (op1 , true )
521521 err := batcher .PresignSweepsGroup (
522522 ctx , []Input {{Outpoint : op1 , Value : inputAmt }},
523- sweepTimeout , destAddr ,
523+ sweepTimeout , destAddr , nil ,
524524 )
525525 require .NoError (t , err )
526526
@@ -644,7 +644,7 @@ func testPresigned_two_inputs_one_goes_offline(t *testing.T,
644644 presignedHelper .SetOutpointOnline (op1 , true )
645645 err = batcher .PresignSweepsGroup (
646646 ctx , []Input {{Outpoint : op1 , Value : 1_000_000 }},
647- sweepTimeout , destAddr ,
647+ sweepTimeout , destAddr , nil ,
648648 )
649649 require .NoError (t , err )
650650 require .NoError (t , batcher .AddSweep (ctx , & sweepReq1 ))
@@ -670,7 +670,7 @@ func testPresigned_two_inputs_one_goes_offline(t *testing.T,
670670 presignedHelper .SetOutpointOnline (op2 , true )
671671 err = batcher .PresignSweepsGroup (
672672 ctx , []Input {{Outpoint : op2 , Value : 2_000_000 }},
673- sweepTimeout , destAddr ,
673+ sweepTimeout , destAddr , nil ,
674674 )
675675 require .NoError (t , err )
676676 require .NoError (t , batcher .AddSweep (ctx , & sweepReq2 ))
@@ -780,7 +780,7 @@ func testPresigned_first_publish_fails(t *testing.T,
780780 presignedHelper .SetOutpointOnline (op1 , true )
781781 err = batcher .PresignSweepsGroup (
782782 ctx , []Input {{Outpoint : op1 , Value : 1_000_000 }},
783- sweepTimeout , destAddr ,
783+ sweepTimeout , destAddr , nil ,
784784 )
785785 require .NoError (t , err )
786786 presignedHelper .SetOutpointOnline (op1 , false )
@@ -903,7 +903,7 @@ func testPresigned_locktime(t *testing.T,
903903 presignedHelper .SetOutpointOnline (op1 , true )
904904 err = batcher .PresignSweepsGroup (
905905 ctx , []Input {{Outpoint : op1 , Value : 1_000_000 }},
906- sweepTimeout , destAddr ,
906+ sweepTimeout , destAddr , nil ,
907907 )
908908 require .NoError (t , err )
909909 presignedHelper .SetOutpointOnline (op1 , false )
@@ -994,14 +994,18 @@ func testPresigned_presigned_group(t *testing.T,
994994 presignedHelper .SetOutpointOnline (op2 , false )
995995
996996 // An attempt to presign must fail.
997- err = batcher .PresignSweepsGroup (ctx , group1 , sweepTimeout , destAddr )
997+ err = batcher .PresignSweepsGroup (
998+ ctx , group1 , sweepTimeout , destAddr , nil ,
999+ )
9981000 require .ErrorContains (t , err , "some outpoint is offline" )
9991001
10001002 // Enable both outpoints.
10011003 presignedHelper .SetOutpointOnline (op2 , true )
10021004
10031005 // An attempt to presign must succeed.
1004- err = batcher .PresignSweepsGroup (ctx , group1 , sweepTimeout , destAddr )
1006+ err = batcher .PresignSweepsGroup (
1007+ ctx , group1 , sweepTimeout , destAddr , nil ,
1008+ )
10051009 require .NoError (t , err )
10061010
10071011 // Add the sweep, triggering the publish attempt.
@@ -1053,7 +1057,9 @@ func testPresigned_presigned_group(t *testing.T,
10531057 presignedHelper .SetOutpointOnline (op4 , true )
10541058
10551059 // An attempt to presign must succeed.
1056- err = batcher .PresignSweepsGroup (ctx , group2 , sweepTimeout , destAddr )
1060+ err = batcher .PresignSweepsGroup (
1061+ ctx , group2 , sweepTimeout , destAddr , nil ,
1062+ )
10571063 require .NoError (t , err )
10581064
10591065 // Add the sweep. It should go to the same batch.
@@ -1107,7 +1113,9 @@ func testPresigned_presigned_group(t *testing.T,
11071113 presignedHelper .SetOutpointOnline (op6 , true )
11081114
11091115 // An attempt to presign must succeed.
1110- err = batcher .PresignSweepsGroup (ctx , group3 , sweepTimeout , destAddr )
1116+ err = batcher .PresignSweepsGroup (
1117+ ctx , group3 , sweepTimeout , destAddr , nil ,
1118+ )
11111119 require .NoError (t , err )
11121120
11131121 // Add the sweep. It should go to the same batch.
@@ -1215,9 +1223,9 @@ func testPresigned_presigned_and_regular_sweeps(t *testing.T, store testStore,
12151223
12161224 setFeeRate (feeRateLow )
12171225
1218- /////////////////////////////////////
1226+ // ///////////////////////////////////
12191227 // Create the first regular sweep. //
1220- /////////////////////////////////////
1228+ // ///////////////////////////////////
12211229 swapHash1 := lntypes.Hash {1 , 1 , 1 }
12221230 op1 := wire.OutPoint {
12231231 Hash : chainhash.Hash {1 , 1 },
@@ -1264,9 +1272,9 @@ func testPresigned_presigned_and_regular_sweeps(t *testing.T, store testStore,
12641272 require .Len (t , tx1 .TxIn , 1 )
12651273 require .Len (t , tx1 .TxOut , 1 )
12661274
1267- ///////////////////////////////////////
1275+ // /////////////////////////////////////
12681276 // Create the first presigned sweep. //
1269- ///////////////////////////////////////
1277+ // /////////////////////////////////////
12701278 swapHash2 := lntypes.Hash {2 , 2 , 2 }
12711279 op2 := wire.OutPoint {
12721280 Hash : chainhash.Hash {2 , 2 },
@@ -1304,7 +1312,7 @@ func testPresigned_presigned_and_regular_sweeps(t *testing.T, store testStore,
13041312 presignedHelper .SetOutpointOnline (op2 , true )
13051313 err = batcher .PresignSweepsGroup (
13061314 ctx , []Input {{Outpoint : op2 , Value : 2_000_000 }},
1307- sweepTimeout , destAddr ,
1315+ sweepTimeout , destAddr , nil ,
13081316 )
13091317 require .NoError (t , err )
13101318 require .NoError (t , batcher .AddSweep (ctx , & sweepReq2 ))
@@ -1319,9 +1327,9 @@ func testPresigned_presigned_and_regular_sweeps(t *testing.T, store testStore,
13191327 require .Len (t , tx2 .TxOut , 1 )
13201328 require .Equal (t , op2 , tx2 .TxIn [0 ].PreviousOutPoint )
13211329
1322- //////////////////////////////////////
1330+ // ////////////////////////////////////
13231331 // Create the second regular sweep. //
1324- //////////////////////////////////////
1332+ // ////////////////////////////////////
13251333 swapHash3 := lntypes.Hash {3 , 3 , 3 }
13261334 op3 := wire.OutPoint {
13271335 Hash : chainhash.Hash {3 , 3 },
@@ -1359,9 +1367,9 @@ func testPresigned_presigned_and_regular_sweeps(t *testing.T, store testStore,
13591367 // Deliver sweep request to batcher.
13601368 require .NoError (t , batcher .AddSweep (ctx , & sweepReq3 ))
13611369
1362- ////////////////////////////////////////
1370+ // //////////////////////////////////////
13631371 // Create the second presigned sweep. //
1364- ////////////////////////////////////////
1372+ // //////////////////////////////////////
13651373 swapHash4 := lntypes.Hash {4 , 4 , 4 }
13661374 op4 := wire.OutPoint {
13671375 Hash : chainhash.Hash {4 , 4 },
@@ -1399,7 +1407,7 @@ func testPresigned_presigned_and_regular_sweeps(t *testing.T, store testStore,
13991407 presignedHelper .SetOutpointOnline (op4 , true )
14001408 err = batcher .PresignSweepsGroup (
14011409 ctx , []Input {{Outpoint : op4 , Value : 3_000_000 }},
1402- sweepTimeout , destAddr ,
1410+ sweepTimeout , destAddr , nil ,
14031411 )
14041412 require .NoError (t , err )
14051413 require .NoError (t , batcher .AddSweep (ctx , & sweepReq4 ))
@@ -1520,7 +1528,7 @@ func testPresigned_purging(t *testing.T, numSwaps, numConfirmedSwaps int,
15201528
15211529 // An attempt to presign must succeed.
15221530 err := batcher .PresignSweepsGroup (
1523- ctx , group , sweepTimeout , destAddr ,
1531+ ctx , group , sweepTimeout , destAddr , nil ,
15241532 )
15251533 require .NoError (t , err )
15261534
@@ -1584,11 +1592,11 @@ func testPresigned_purging(t *testing.T, numSwaps, numConfirmedSwaps int,
15841592
15851593 // An attempt to presign must succeed.
15861594 err := batcher .PresignSweepsGroup (
1587- ctx , group , sweepTimeout , destAddr ,
1595+ ctx , group , sweepTimeout , destAddr , nil ,
15881596 )
15891597 require .NoError (t , err )
15901598
1591- // Add the sweep, triggering the publish attempt.
1599+ // Add the sweep, triggering the publishing attempt.
15921600 require .NoError (t , batcher .AddSweep (ctx , & SweepRequest {
15931601 SwapHash : swapHash ,
15941602 Inputs : group ,
0 commit comments