Handle incoming shutdown messages
[rust-lightning] / src / util / test_utils.rs
1 use chain::chaininterface;
2 use chain::chaininterface::ConfirmationTarget;
3 use ln::channelmonitor;
4 use ln::msgs::HandleError;
5
6 use bitcoin::blockdata::transaction::Transaction;
7 use bitcoin::util::hash::Sha256dHash;
8
9 pub struct TestFeeEstimator {
10         pub sat_per_vbyte: u64,
11 }
12 impl chaininterface::FeeEstimator for TestFeeEstimator {
13         fn get_est_sat_per_vbyte(&self, _confirmation_target: ConfirmationTarget) -> u64 {
14                 self.sat_per_vbyte
15         }
16 }
17
18 pub struct TestChannelMonitor {
19
20 }
21 impl channelmonitor::ManyChannelMonitor for TestChannelMonitor {
22         fn add_update_monitor(&self, _funding_txo: (Sha256dHash, u16), _monitor: channelmonitor::ChannelMonitor) -> Result<(), HandleError> {
23                 //TODO!
24                 Ok(())
25         }
26 }
27
28 pub struct TestBroadcaster {
29
30 }
31 impl chaininterface::BroadcasterInterface for TestBroadcaster {
32         fn broadcast_transaction(&self, _tx: &Transaction) {
33                 //TODO
34         }
35 }