From 94df32b108db0b95d9ab0e0abd212b956f18bc13 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 11 May 2020 21:08:35 -0400 Subject: [PATCH] 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. --- lightning/src/ln/functional_test_utils.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/lightning/src/ln/functional_test_utils.rs b/lightning/src/ln/functional_test_utils.rs index 28197d670..e4009cbf2 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) -- 2.39.5