1 use chain::chaininterface;
2 use chain::chaininterface::ConfirmationTarget;
3 use ln::channelmonitor;
4 use ln::msgs::HandleError;
6 use bitcoin::util::hash::Sha256dHash;
7 use bitcoin::blockdata::transaction::Transaction;
8 use bitcoin::blockdata::script::Script;
12 pub struct TestFeeEstimator {
13 pub sat_per_vbyte: u64,
15 impl chaininterface::FeeEstimator for TestFeeEstimator {
16 fn get_est_sat_per_vbyte(&self, _confirmation_target: ConfirmationTarget) -> u64 {
21 pub struct TestWatchInterface {
22 pub watch_util: chaininterface::ChainWatchInterfaceUtil,
24 impl chaininterface::ChainWatchInterface for TestWatchInterface {
25 fn install_watch_script(&self, _script_pub_key: Script) {
28 fn install_watch_outpoint(&self, _outpoint: (Sha256dHash, u32)) {
31 fn watch_all_txn(&self) {
34 fn register_listener(&self, listener: Weak<chaininterface::ChainListener>) {
35 self.watch_util.register_listener(listener);
38 impl TestWatchInterface {
39 pub fn new() -> TestWatchInterface {
41 watch_util: chaininterface::ChainWatchInterfaceUtil::new(),
46 pub struct TestChannelMonitor {
49 impl channelmonitor::ManyChannelMonitor for TestChannelMonitor {
50 fn add_update_monitor(&self, _funding_txo: (Sha256dHash, u16), _monitor: channelmonitor::ChannelMonitor) -> Result<(), HandleError> {