htlcswitch: use mock clock in TestMailBoxAddExpiry

This commit replaces the clock used in the unit test
`TestMailBoxAddExpiry`. Previously the `TestClock` is used, resulting in
the unit test being not so "unit" as the maintainer needs to know the
detailed implementation of `clock.Clock`, resulting in debugging a
failed unit test more difficult as the cognitive cost is high.
Re-implement `clock.Clock` also means we need to maintain more. This is
now solved by using mock clock so we can ignore the implementation
details and care only the returned results.
This commit is contained in:
yyforyongyu committed 2023-01-12 22:08:15 +08:00
1 parent 5e6f10c9b8
commit a1cac6d54b
2 files changed
+61 -17

No files matched your search

@@ -205,6 +205,9 @@ certain large transactions](https://github.com/lightningnetwork/lnd/pull/7100).
* [Code style cleanup](https://github.com/lightningnetwork/lnd/pull/7308) in the
funding package.
* [Fixed a flake in the TestMailBoxAddExpiry unit
test](https://github.com/lightningnetwork/lnd/pull/7314).
## `lncli`
* [Add an `insecure` flag to skip tls auth as well as a `metadata` string slice