multi: inject clocks into swap lifecycle and update tests

Inject clock.Clock into swapConfig so that swap initiation times
are deterministic and testable. Update all swap tests to use
TestClock with a fixed time, and assert that InitiationTime
matches the clock value.
This commit is contained in:
Slyghtning 2026-03-13 08:58:56 +01:00
parent 66a17f47e6
commit b702aebbf4
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF
8 changed files with 63 additions and 19 deletions

View file

@ -1005,7 +1005,8 @@ func (d *Daemon) initialize(withMacaroonService bool) error {
}
loop.Resume(
d.mainCtx, notificationManager, swapClient.Store, d.impl.Conn, d.lnd,
d.mainCtx, notificationManager, swapClient.Store,
d.impl.Conn, d.lnd, clock.NewDefaultClock(),
)
// Last, start our internal error handler. This will return exactly one