[bindings] update generated code
[rust-lightning] / lightning / src / util / test_utils.rs
index 6cdfb7f9d63cb5708f414472189ec23af5ef63ad..0370c0e1a402150bbdd749d892e10f895573a1a6 100644 (file)
 use chain;
 use chain::chaininterface;
 use chain::chaininterface::ConfirmationTarget;
+use chain::chainmonitor;
+use chain::channelmonitor;
+use chain::channelmonitor::MonitorEvent;
 use chain::transaction::OutPoint;
 use chain::keysinterface;
-use ln::channelmonitor;
 use ln::features::{ChannelFeatures, InitFeatures};
 use ln::msgs;
 use ln::msgs::OptionalField;
-use ln::channelmonitor::MonitorEvent;
 use util::enforcing_trait_impls::EnforcingChannelKeys;
 use util::events;
 use util::logger::{Logger, Level, Record};
@@ -62,7 +63,7 @@ impl chaininterface::FeeEstimator for TestFeeEstimator {
 pub struct TestChainMonitor<'a> {
        pub added_monitors: Mutex<Vec<(OutPoint, channelmonitor::ChannelMonitor<EnforcingChannelKeys>)>>,
        pub latest_monitor_update_id: Mutex<HashMap<[u8; 32], (OutPoint, u64)>>,
-       pub chain_monitor: channelmonitor::ChainMonitor<EnforcingChannelKeys, &'a TestChainSource, &'a chaininterface::BroadcasterInterface, &'a TestFeeEstimator, &'a TestLogger>,
+       pub chain_monitor: chainmonitor::ChainMonitor<EnforcingChannelKeys, &'a TestChainSource, &'a chaininterface::BroadcasterInterface, &'a TestFeeEstimator, &'a TestLogger>,
        pub update_ret: Mutex<Result<(), channelmonitor::ChannelMonitorUpdateErr>>,
        // If this is set to Some(), after the next return, we'll always return this until update_ret
        // is changed:
@@ -73,7 +74,7 @@ impl<'a> TestChainMonitor<'a> {
                Self {
                        added_monitors: Mutex::new(Vec::new()),
                        latest_monitor_update_id: Mutex::new(HashMap::new()),
-                       chain_monitor: channelmonitor::ChainMonitor::new(chain_source, broadcaster, logger, fee_estimator),
+                       chain_monitor: chainmonitor::ChainMonitor::new(chain_source, broadcaster, logger, fee_estimator),
                        update_ret: Mutex::new(Ok(())),
                        next_update_ret: Mutex::new(None),
                }
@@ -423,11 +424,11 @@ impl chain::Access for TestChainSource {
 }
 
 impl chain::Filter for TestChainSource {
-       fn register_tx(&self, txid: Txid, script_pubkey: Script) {
-               self.watched_txn.lock().unwrap().insert((txid, script_pubkey));
+       fn register_tx(&self, txid: &Txid, script_pubkey: &Script) {
+               self.watched_txn.lock().unwrap().insert((*txid, script_pubkey.clone()));
        }
 
-       fn register_output(&self, outpoint: OutPoint, script_pubkey: Script) {
-               self.watched_outputs.lock().unwrap().insert((outpoint, script_pubkey));
+       fn register_output(&self, outpoint: &OutPoint, script_pubkey: &Script) {
+               self.watched_outputs.lock().unwrap().insert((*outpoint, script_pubkey.clone()));
        }
 }