@@ -18,6 +18,7 @@ import (
1818 "github.com/lightninglabs/loop/sweep"
1919 "github.com/lightninglabs/loop/sweepbatcher"
2020 "github.com/lightninglabs/loop/test"
21+ "github.com/lightningnetwork/lnd/clock"
2122 "github.com/lightningnetwork/lnd/lnrpc"
2223 "github.com/lightningnetwork/lnd/lntypes"
2324 "github.com/lightningnetwork/lnd/lnwallet/chainfee"
@@ -57,11 +58,13 @@ func testLoopOutPaymentParameters(t *testing.T) {
5758 }
5859
5960 height := int32 (600 )
61+ startTime := time .Unix (123 , 0 )
6062
6163 cfg := & swapConfig {
6264 lnd : & lnd .LndServices ,
6365 store : store ,
6466 server : server ,
67+ clock : clock .NewTestClock (startTime ),
6568 }
6669
6770 sweeper := & sweep.Sweeper {Lnd : & lnd .LndServices }
@@ -82,6 +85,7 @@ func testLoopOutPaymentParameters(t *testing.T) {
8285 )
8386 require .NoError (t , err )
8487 swap := initResult .swap
88+ require .Equal (t , startTime , swap .InitiationTime )
8589
8690 // Execute the swap in its own goroutine.
8791 errChan := make (chan error )
@@ -193,7 +197,10 @@ func testLateHtlcPublish(t *testing.T) {
193197
194198 height := int32 (600 )
195199
196- cfg := newSwapConfig (& lnd .LndServices , store , server , nil )
200+ cfg := newSwapConfig (
201+ & lnd .LndServices , store , server , nil ,
202+ clock .NewTestClock (time .Now ()),
203+ )
197204
198205 testRequest .Expiry = height + testLoopOutMinOnChainCltvDelta
199206
@@ -296,6 +303,7 @@ func testCustomSweepConfTarget(t *testing.T) {
296303
297304 cfg := newSwapConfig (
298305 & lnd .LndServices , loopdb .NewStoreMock (t ), server , nil ,
306+ clock .NewTestClock (time .Now ()),
299307 )
300308
301309 initResult , err := newLoopOutSwap (
@@ -536,6 +544,7 @@ func testPreimagePush(t *testing.T) {
536544
537545 cfg := newSwapConfig (
538546 & lnd .LndServices , loopdb .NewStoreMock (t ), server , nil ,
547+ clock .NewTestClock (time .Now ()),
539548 )
540549
541550 initResult , err := newLoopOutSwap (
@@ -794,6 +803,7 @@ func testFailedOffChainCancelation(t *testing.T) {
794803
795804 cfg := newSwapConfig (
796805 & lnd .LndServices , loopdb .NewStoreMock (t ), server , nil ,
806+ clock .NewTestClock (time .Now ()),
797807 )
798808
799809 initResult , err := newLoopOutSwap (
@@ -948,6 +958,7 @@ func TestLoopOutMuSig2Sweep(t *testing.T) {
948958
949959 cfg := newSwapConfig (
950960 & lnd .LndServices , loopdb .NewStoreMock (t ), server , nil ,
961+ clock .NewTestClock (time .Now ()),
951962 )
952963
953964 initResult , err := newLoopOutSwap (
0 commit comments