X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Frouting%2Ftest_utils.rs;h=d0e44eb214cf4fe3d43a5a8c52b6b6e340a9f2b9;hb=a8eef297fceacc0ca984c28cd5114b1ec08d8b7e;hp=b737bab352441a1b2a9289cc143e078ba6384c97;hpb=f71daed02d159e051e065802155d3ad77edbc124;p=rust-lightning diff --git a/lightning/src/routing/test_utils.rs b/lightning/src/routing/test_utils.rs index b737bab3..d0e44eb2 100644 --- a/lightning/src/routing/test_utils.rs +++ b/lightning/src/routing/test_utils.rs @@ -7,7 +7,7 @@ // You may not use this file except in accordance with one or both of these // licenses. -use crate::routing::gossip::{NetworkGraph, P2PGossipSync}; +use crate::routing::gossip::{NetworkGraph, NodeAlias, P2PGossipSync}; use crate::ln::features::{ChannelFeatures, NodeFeatures}; use crate::ln::msgs::{UnsignedChannelAnnouncement, ChannelAnnouncement, RoutingMessageHandler, NodeAnnouncement, UnsignedNodeAnnouncement, ChannelUpdate, UnsignedChannelUpdate, MAX_VALUE_MSAT}; @@ -72,7 +72,7 @@ pub(super) fn add_or_update_node( timestamp, node_id, rgb: [0; 3], - alias: [0; 32], + alias: NodeAlias([0; 32]), addresses: Vec::new(), excess_address_data: Vec::new(), excess_data: Vec::new(), @@ -141,8 +141,7 @@ pub(super) fn build_line_graph() -> ( let secp_ctx = Secp256k1::new(); let logger = Arc::new(test_utils::TestLogger::new()); let chain_monitor = Arc::new(test_utils::TestChainSource::new(Network::Testnet)); - let genesis_hash = genesis_block(Network::Testnet).header.block_hash(); - let network_graph = Arc::new(NetworkGraph::new(genesis_hash, Arc::clone(&logger))); + let network_graph = Arc::new(NetworkGraph::new(Network::Testnet, Arc::clone(&logger))); let gossip_sync = P2PGossipSync::new(Arc::clone(&network_graph), None, Arc::clone(&logger)); // Build network from our_id to node 19: @@ -195,8 +194,7 @@ pub(super) fn build_graph() -> ( let secp_ctx = Secp256k1::new(); let logger = Arc::new(test_utils::TestLogger::new()); let chain_monitor = Arc::new(test_utils::TestChainSource::new(Network::Testnet)); - let genesis_hash = genesis_block(Network::Testnet).header.block_hash(); - let network_graph = Arc::new(NetworkGraph::new(genesis_hash, Arc::clone(&logger))); + let network_graph = Arc::new(NetworkGraph::new(Network::Testnet, Arc::clone(&logger))); let gossip_sync = P2PGossipSync::new(Arc::clone(&network_graph), None, Arc::clone(&logger)); // Build network from our_id to node6: //