+
+pub trait NodeHolder {
+ type CM: AChannelManager;
+ fn node(&self) -> &ChannelManager<
+ <Self::CM as AChannelManager>::M,
+ <Self::CM as AChannelManager>::T,
+ <Self::CM as AChannelManager>::ES,
+ <Self::CM as AChannelManager>::NS,
+ <Self::CM as AChannelManager>::SP,
+ <Self::CM as AChannelManager>::F,
+ <Self::CM as AChannelManager>::R,
+ <Self::CM as AChannelManager>::L>;
+ fn chain_monitor(&self) -> Option<&test_utils::TestChainMonitor>;
+}
+impl<H: NodeHolder> NodeHolder for &H {
+ type CM = H::CM;
+ fn node(&self) -> &ChannelManager<
+ <Self::CM as AChannelManager>::M,
+ <Self::CM as AChannelManager>::T,
+ <Self::CM as AChannelManager>::ES,
+ <Self::CM as AChannelManager>::NS,
+ <Self::CM as AChannelManager>::SP,
+ <Self::CM as AChannelManager>::F,
+ <Self::CM as AChannelManager>::R,
+ <Self::CM as AChannelManager>::L> { (*self).node() }
+ fn chain_monitor(&self) -> Option<&test_utils::TestChainMonitor> { (*self).chain_monitor() }
+}
+impl<'a, 'b: 'a, 'c: 'b> NodeHolder for Node<'a, 'b, 'c> {
+ type CM = TestChannelManager<'a, 'b, 'c>;
+ fn node(&self) -> &TestChannelManager<'a, 'b, 'c> { &self.node }
+ fn chain_monitor(&self) -> Option<&test_utils::TestChainMonitor> { Some(self.chain_monitor) }
+}
+