Use a variable-length integer for many serialization wrappers
[rust-lightning] / lightning / src / util / test_utils.rs
index 5b101e345e22aa8e889f67a8e700c2155305a21b..a72af12d4db4dacf4eb26fe82fa62e724e1e6c8f 100644 (file)
@@ -24,6 +24,7 @@ use crate::ln::script::ShutdownScript;
 use crate::routing::gossip::NetworkGraph;
 use crate::routing::router::{find_route, InFlightHtlcs, Route, RouteHop, RouteParameters, Router, ScorerAccountingForInFlightHtlcs};
 use crate::routing::scoring::FixedPenaltyScorer;
+use crate::util::config::UserConfig;
 use crate::util::enforcing_trait_impls::{EnforcingSigner, EnforcementState};
 use crate::util::events;
 use crate::util::logger::{Logger, Level, Record};
@@ -140,9 +141,6 @@ impl SignerProvider for OnlyReadsKeysInterface {
        fn get_shutdown_scriptpubkey(&self) -> ShutdownScript { unreachable!(); }
 }
 
-impl keysinterface::KeysInterface for OnlyReadsKeysInterface {
-}
-
 pub struct TestChainMonitor<'a> {
        pub added_monitors: Mutex<Vec<(OutPoint, channelmonitor::ChannelMonitor<EnforcingSigner>)>>,
        pub monitor_updates: Mutex<HashMap<[u8; 32], Vec<channelmonitor::ChannelMonitorUpdate>>>,
@@ -178,7 +176,7 @@ impl<'a> chain::Watch<EnforcingSigner> for TestChainMonitor<'a> {
                let mut w = TestVecWriter(Vec::new());
                monitor.write(&mut w).unwrap();
                let new_monitor = <(BlockHash, channelmonitor::ChannelMonitor<EnforcingSigner>)>::read(
-                       &mut io::Cursor::new(&w.0), self.keys_manager).unwrap().1;
+                       &mut io::Cursor::new(&w.0), (self.keys_manager, self.keys_manager)).unwrap().1;
                assert!(new_monitor == monitor);
                self.latest_monitor_update_id.lock().unwrap().insert(funding_txo.to_channel_id(),
                        (funding_txo, monitor.get_latest_update_id(), MonitorUpdateId::from_new_monitor(&monitor)));
@@ -212,7 +210,7 @@ impl<'a> chain::Watch<EnforcingSigner> for TestChainMonitor<'a> {
                w.0.clear();
                monitor.write(&mut w).unwrap();
                let new_monitor = <(BlockHash, channelmonitor::ChannelMonitor<EnforcingSigner>)>::read(
-                       &mut io::Cursor::new(&w.0), self.keys_manager).unwrap().1;
+                       &mut io::Cursor::new(&w.0), (self.keys_manager, self.keys_manager)).unwrap().1;
                assert!(new_monitor == *monitor);
                self.added_monitors.lock().unwrap().push((funding_txo, new_monitor));
                update_res
@@ -400,10 +398,10 @@ impl msgs::ChannelMessageHandler for TestChannelMessageHandler {
                self.received_msg(wire::Message::Error(msg.clone()));
        }
        fn provided_node_features(&self) -> NodeFeatures {
-               channelmanager::provided_node_features()
+               channelmanager::provided_node_features(&UserConfig::default())
        }
        fn provided_init_features(&self, _their_init_features: &PublicKey) -> InitFeatures {
-               channelmanager::provided_init_features()
+               channelmanager::provided_init_features(&UserConfig::default())
        }
 }
 
@@ -713,8 +711,6 @@ impl SignerProvider for TestKeysInterface {
        }
 }
 
-impl keysinterface::KeysInterface for TestKeysInterface {}
-
 impl TestKeysInterface {
        pub fn new(seed: &[u8; 32], network: Network) -> Self {
                let now = Duration::from_secs(genesis_block(network).header.time as u64);