Skip to content

Commit 94df32b

Browse files
committed
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.
1 parent 57ac2ec commit 94df32b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lightning/src/ln/functional_test_utils.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ impl<'a, 'b, 'c> Drop for Node<'a, 'b, 'c> {
102102
let network_graph_ser = self.net_graph_msg_handler.network_graph.read().unwrap();
103103
network_graph_ser.write(&mut w).unwrap();
104104
let network_graph_deser = <NetworkGraph>::read(&mut ::std::io::Cursor::new(&w.0)).unwrap();
105+
assert!(network_graph_deser == *self.net_graph_msg_handler.network_graph.read().unwrap());
105106
let net_graph_msg_handler = NetGraphMsgHandler::from_net_graph(
106107
Arc::clone(&self.chain_monitor) as Arc<chaininterface::ChainWatchInterface>,
107108
Arc::clone(&self.logger) as Arc<Logger>, RwLock::new(network_graph_deser)

0 commit comments

Comments
 (0)