]> git.bitcoin.ninja Git - rust-lightning/commit
Simplify `Instant` mocking in outbound payments
authorMatt Corallo <git@bluematt.me>
Fri, 16 Aug 2024 22:36:30 +0000 (22:36 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 21 Aug 2024 14:11:01 +0000 (14:11 +0000)
commitd89a487d5b87f8f8f7308be50d14e29d85f66e6d
treec7ce325ff5a40522f5da131f89cec5387070dec0
parent1c83e612adcde38f1d92d3e97885ad2793676167
Simplify `Instant` mocking in outbound payments

To handle `std` and `no-std` concepts of time in scoring, we'd
originally written a generic `Time` trait which we could use to
fetch the current time, observe real (not wall-clock) elapsed time,
and serialize the time.

Eventually, scoring stopped using this `Time` trait but outbound
payment retry expiry started using it instead to mock time in
tests.

Since scoring no longer uses the full features which required the
`Time` trait, we can substantially simplify by just having the
mocking option.
lightning/src/ln/outbound_payment.rs
lightning/src/ln/payment_tests.rs
lightning/src/util/mod.rs
lightning/src/util/time.rs