Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lightning/src/util/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,8 @@ impl<'a> TestChainMonitor<'a> {
blocker.recv().unwrap();
}

// At every point where we get a monitor update, we should be able to send a useful monitor
// to a watchtower and disk...
// Test that a monitor survives a round-trip, and use the round-tripped monitor in the
// underlying `ChainMonitor`.
let mut w = TestVecWriter(Vec::new());
monitor.write(&mut w).unwrap();
let new_monitor = <(BlockHash, ChannelMonitor<TestChannelSigner>)>::read(
Expand All @@ -536,7 +536,8 @@ impl<'a> TestChainMonitor<'a> {
.1;
// Note that a ChannelMonitor might not round-trip exactly here as we have tests that were
// serialized prior to LDK 0.1 and re-serializing them will flip the "written after LDK
// 0.1" flag.
// 0.1" flag. Thus, unlike the code in `watch_channel` below, we do not assert that the
// monitor is the same after a serialization round-trip.
self.latest_monitor_update_id
.lock()
.unwrap()
Expand All @@ -555,7 +556,8 @@ impl<'a> chain::Watch<TestChannelSigner> for TestChainMonitor<'a> {
}

// At every point where we get a monitor update, we should be able to send a useful monitor
// to a watchtower and disk...
// to a watchtower and disk. At a minimum, this means we should be able to round-trip the
// monitor to a serialized copy and get he same one back.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a small typo in this comment: "get he same one back" should be "get the same one back".

Suggested change
// monitor to a serialized copy and get he same one back.
// monitor to a serialized copy and get the same one back.

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

let mut w = TestVecWriter(Vec::new());
monitor.write(&mut w).unwrap();
let new_monitor = <(BlockHash, ChannelMonitor<TestChannelSigner>)>::read(
Expand Down
Loading