X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Futil%2Ftest_utils.rs;h=6647020f6b3d266d9b683796e9c76e1d75f13333;hb=ac941e19c96b59c4da75227403816d8377ab5ef7;hp=658758328626cbf18f4b5c4e6c902e1559a6ed25;hpb=d0e9137bc5f8f31cc5e9c63b94f1450bdb18b524;p=rust-lightning diff --git a/src/util/test_utils.rs b/src/util/test_utils.rs index 65875832..6647020f 100644 --- a/src/util/test_utils.rs +++ b/src/util/test_utils.rs @@ -30,6 +30,10 @@ impl TestChannelMonitor { } impl channelmonitor::ManyChannelMonitor for TestChannelMonitor { fn add_update_monitor(&self, funding_txo: OutPoint, monitor: channelmonitor::ChannelMonitor) -> Result<(), channelmonitor::ChannelMonitorUpdateErr> { + // At every point where we get a monitor update, we should be able to send a useful monitor + // to a watchtower and disk... + assert!(channelmonitor::ChannelMonitor::deserialize(&monitor.serialize_for_disk()[..]).unwrap() == monitor); + monitor.serialize_for_watchtower(); // This at least shouldn't crash... self.added_monitors.lock().unwrap().push((funding_txo, monitor.clone())); self.simple_monitor.add_update_monitor(funding_txo, monitor) }