From: Matt Corallo Date: Tue, 12 May 2020 01:08:35 +0000 (-0400) Subject: Add assertion since we now have a pub field that is PartialEq X-Git-Tag: v0.0.12~66^2~2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=rust-lightning;a=commitdiff_plain;h=94df32b108db0b95d9ab0e0abd212b956f18bc13 Add assertion since we now have a pub field that is PartialEq We previously were only able to assert that the route graph serialization roundtrips were good by comparing the network messages returned from them, but we can now do better as the graph is exposed publicly via a simple datastructure that implements PartialEq. --- diff --git a/lightning/src/ln/functional_test_utils.rs b/lightning/src/ln/functional_test_utils.rs index 28197d67..e4009cbf 100644 --- a/lightning/src/ln/functional_test_utils.rs +++ b/lightning/src/ln/functional_test_utils.rs @@ -102,6 +102,7 @@ impl<'a, 'b, 'c> Drop for Node<'a, 'b, 'c> { let network_graph_ser = self.net_graph_msg_handler.network_graph.read().unwrap(); network_graph_ser.write(&mut w).unwrap(); let network_graph_deser = ::read(&mut ::std::io::Cursor::new(&w.0)).unwrap(); + assert!(network_graph_deser == *self.net_graph_msg_handler.network_graph.read().unwrap()); let net_graph_msg_handler = NetGraphMsgHandler::from_net_graph( Arc::clone(&self.chain_monitor) as Arc, Arc::clone(&self.logger) as Arc, RwLock::new(network_graph_deser)