mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
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:
parent
66a17f47e6
commit
b702aebbf4
8 changed files with 63 additions and 19 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue