@@ -225,20 +225,22 @@ func TestCustomSweepConfTarget(t *testing.T) {
225
225
226
226
// Use the highest sweep confirmation target before we attempt to use
227
227
// the default.
228
- testRequest .SweepConfTarget = testLoopOutOnChainCltvDelta -
228
+ testReq := * testRequest
229
+
230
+ testReq .SweepConfTarget = testLoopOutOnChainCltvDelta -
229
231
DefaultSweepConfTargetDelta - 1
230
232
231
233
// Set up custom fee estimates such that the lower confirmation target
232
234
// yields a much higher fee rate.
233
- ctx .Lnd .SetFeeEstimate (testRequest .SweepConfTarget , 250 )
235
+ ctx .Lnd .SetFeeEstimate (testReq .SweepConfTarget , 250 )
234
236
ctx .Lnd .SetFeeEstimate (DefaultSweepConfTarget , 10000 )
235
237
236
238
cfg := newSwapConfig (
237
239
& lnd .LndServices , newStoreMock (t ), server ,
238
240
)
239
241
240
242
initResult , err := newLoopOutSwap (
241
- context .Background (), cfg , ctx .Lnd .Height , testRequest ,
243
+ context .Background (), cfg , ctx .Lnd .Height , & testReq ,
242
244
)
243
245
if err != nil {
244
246
t .Fatal (err )
@@ -357,7 +359,7 @@ func TestCustomSweepConfTarget(t *testing.T) {
357
359
358
360
// The sweep should have a fee that corresponds to the custom
359
361
// confirmation target.
360
- _ = assertSweepTx (testRequest .SweepConfTarget )
362
+ _ = assertSweepTx (testReq .SweepConfTarget )
361
363
362
364
// Once we have published an on chain sweep, we expect a preimage to
363
365
// have been pushed to our server.
@@ -424,15 +426,16 @@ func TestPreimagePush(t *testing.T) {
424
426
425
427
// Start with a high confirmation delta which will have a very high fee
426
428
// attached to it.
427
- testRequest .SweepConfTarget = testLoopOutOnChainCltvDelta -
429
+ testReq := * testRequest
430
+ testReq .SweepConfTarget = testLoopOutOnChainCltvDelta -
428
431
DefaultSweepConfTargetDelta - 1
429
432
430
433
// We set our mock fee estimate for our target sweep confs to be our
431
434
// max miner fee *2, so that our fee will definitely be above what we
432
435
// are willing to pay, and we will not sweep.
433
436
ctx .Lnd .SetFeeEstimate (
434
- testRequest .SweepConfTarget , chainfee .SatPerKWeight (
435
- testRequest .MaxMinerFee * 2 ,
437
+ testReq .SweepConfTarget , chainfee .SatPerKWeight (
438
+ testReq .MaxMinerFee * 2 ,
436
439
),
437
440
)
438
441
@@ -446,7 +449,7 @@ func TestPreimagePush(t *testing.T) {
446
449
)
447
450
448
451
initResult , err := newLoopOutSwap (
449
- context .Background (), cfg , ctx .Lnd .Height , testRequest ,
452
+ context .Background (), cfg , ctx .Lnd .Height , & testReq ,
450
453
)
451
454
require .NoError (t , err )
452
455
swap := initResult .swap
0 commit comments