Add test coverage ChannelClosed event fields
[rust-lightning] / lightning / src / ln / peer_handler.rs
index f5c6341bb3ebde548c907636336d3edf90606cc0..1a39bbb3ae408e7047159e6d9f3f63267188b61f 100644 (file)
@@ -119,11 +119,11 @@ impl OnionMessageHandler for IgnoringMessageHandler {
        }
 }
 impl OffersMessageHandler for IgnoringMessageHandler {
-       fn handle_message(&self, _msg: OffersMessage) {}
+       fn handle_message(&self, _msg: OffersMessage) -> Option<OffersMessage> { None }
 }
 impl CustomOnionMessageHandler for IgnoringMessageHandler {
        type CustomMessage = Infallible;
-       fn handle_custom_message(&self, _msg: Infallible) {
+       fn handle_custom_message(&self, _msg: Infallible) -> Option<Infallible> {
                // Since we always return `None` in the read the handle method should never be called.
                unreachable!();
        }
@@ -607,7 +607,15 @@ impl Peer {
 /// issues such as overly long function definitions.
 ///
 /// This is not exported to bindings users as `Arc`s don't make sense in bindings.
-pub type SimpleArcPeerManager<SD, M, T, F, C, L> = PeerManager<SD, Arc<SimpleArcChannelManager<M, T, F, L>>, Arc<P2PGossipSync<Arc<NetworkGraph<Arc<L>>>, Arc<C>, Arc<L>>>, Arc<SimpleArcOnionMessenger<L>>, Arc<L>, IgnoringMessageHandler, Arc<KeysManager>>;
+pub type SimpleArcPeerManager<SD, M, T, F, C, L> = PeerManager<
+       SD,
+       Arc<SimpleArcChannelManager<M, T, F, L>>,
+       Arc<P2PGossipSync<Arc<NetworkGraph<Arc<L>>>, Arc<C>, Arc<L>>>,
+       Arc<SimpleArcOnionMessenger<L>>,
+       Arc<L>,
+       IgnoringMessageHandler,
+       Arc<KeysManager>
+>;
 
 /// SimpleRefPeerManager is a type alias for a PeerManager reference, and is the reference
 /// counterpart to the SimpleArcPeerManager type alias. Use this type by default when you don't
@@ -617,12 +625,25 @@ pub type SimpleArcPeerManager<SD, M, T, F, C, L> = PeerManager<SD, Arc<SimpleArc
 /// helps with issues such as long function definitions.
 ///
 /// This is not exported to bindings users as general type aliases don't make sense in bindings.
-pub type SimpleRefPeerManager<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, SD, M, T, F, C, L> = PeerManager<SD, SimpleRefChannelManager<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'm, M, T, F, L>, &'f P2PGossipSync<&'g NetworkGraph<&'f L>, &'h C, &'f L>, &'i SimpleRefOnionMessenger<'j, 'k, L>, &'f L, IgnoringMessageHandler, &'c KeysManager>;
+pub type SimpleRefPeerManager<
+       'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, SD, M, T, F, C, L
+> = PeerManager<
+       SD,
+       &'n SimpleRefChannelManager<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'm, M, T, F, L>,
+       &'f P2PGossipSync<&'g NetworkGraph<&'f L>, &'h C, &'f L>,
+       &'i SimpleRefOnionMessenger<'g, 'm, 'n, L>,
+       &'f L,
+       IgnoringMessageHandler,
+       &'c KeysManager
+>;
 
 
 /// A generic trait which is implemented for all [`PeerManager`]s. This makes bounding functions or
 /// structs on any [`PeerManager`] much simpler as only this trait is needed as a bound, rather
 /// than the full set of bounds on [`PeerManager`] itself.
+///
+/// This is not exported to bindings users as general cover traits aren't useful in other
+/// languages.
 #[allow(missing_docs)]
 pub trait APeerManager {
        type Descriptor: SocketDescriptor;