X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=lightning%2Fsrc%2Futil%2Ftest_utils.rs;fp=lightning%2Fsrc%2Futil%2Ftest_utils.rs;h=2b3dea9369303b5345c7c59dc0d07f8141aced88;hb=3670dd086ca43295d186d3b957fa99a9d1c458f0;hp=ad416edef2799782a421073d04f1ecfc19a6ddd5;hpb=f952cc27d6d1c3e356ea46a5f63beec1f4105db9;p=rust-lightning diff --git a/lightning/src/util/test_utils.rs b/lightning/src/util/test_utils.rs index ad416ede..2b3dea93 100644 --- a/lightning/src/util/test_utils.rs +++ b/lightning/src/util/test_utils.rs @@ -45,13 +45,13 @@ impl chaininterface::FeeEstimator for TestFeeEstimator { } } -pub struct TestChannelMonitor { +pub struct TestChannelMonitor<'a> { pub added_monitors: Mutex)>>, - pub simple_monitor: channelmonitor::SimpleManyChannelMonitor, + pub simple_monitor: channelmonitor::SimpleManyChannelMonitor, pub update_ret: Mutex>, } -impl TestChannelMonitor { - pub fn new(chain_monitor: Arc, broadcaster: Arc, logger: Arc, fee_estimator: Arc) -> Self { +impl<'a> TestChannelMonitor<'a> { + pub fn new(chain_monitor: Arc, broadcaster: &'a chaininterface::BroadcasterInterface, logger: Arc, fee_estimator: Arc) -> Self { Self { added_monitors: Mutex::new(Vec::new()), simple_monitor: channelmonitor::SimpleManyChannelMonitor::new(chain_monitor, broadcaster, logger, fee_estimator), @@ -59,7 +59,7 @@ impl TestChannelMonitor { } } } -impl channelmonitor::ManyChannelMonitor for TestChannelMonitor { +impl<'a> channelmonitor::ManyChannelMonitor for TestChannelMonitor<'a> { 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...