X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Frouting%2Ftest_utils.rs;h=6337adfb81c09088a653102f7f01bc12c04daedc;hb=15fa0d8f2084d0ad9f9223e5b185ee0543e9e365;hp=3c0ef85fd7e3815696a669bc34203d411535f337;hpb=ec928d55b480254f2ce3457a5c219ed115fdf9ef;p=rust-lightning diff --git a/lightning/src/routing/test_utils.rs b/lightning/src/routing/test_utils.rs index 3c0ef85f..6337adfb 100644 --- a/lightning/src/routing/test_utils.rs +++ b/lightning/src/routing/test_utils.rs @@ -9,8 +9,7 @@ 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}; +use crate::ln::msgs::{ChannelAnnouncement, ChannelUpdate, MAX_VALUE_MSAT, NodeAnnouncement, RoutingMessageHandler, SocketAddress, UnsignedChannelAnnouncement, UnsignedChannelUpdate, UnsignedNodeAnnouncement}; use crate::util::test_utils; use crate::util::ser::Writeable; @@ -18,17 +17,18 @@ use bitcoin::blockdata::constants::ChainHash; use bitcoin::hashes::sha256d::Hash as Sha256dHash; use bitcoin::hashes::Hash; use bitcoin::hashes::hex::FromHex; -use bitcoin::network::constants::Network; +use bitcoin::network::Network; use bitcoin::secp256k1::{PublicKey,SecretKey}; use bitcoin::secp256k1::{Secp256k1, All}; +#[allow(unused)] use crate::prelude::*; use crate::sync::{self, Arc}; use crate::routing::gossip::NodeId; // Using the same keys for LN and BTC ids -pub(super) fn add_channel( +pub(crate) fn add_channel( gossip_sync: &P2PGossipSync>>, Arc, Arc>, secp_ctx: &Secp256k1, node_1_privkey: &SecretKey, node_2_privkey: &SecretKey, features: ChannelFeatures, short_channel_id: u64 ) { @@ -60,7 +60,7 @@ pub(super) fn add_channel( }; } -pub(super) fn add_or_update_node( +pub(crate) fn add_or_update_node( gossip_sync: &P2PGossipSync>>, Arc, Arc>, secp_ctx: &Secp256k1, node_privkey: &SecretKey, features: NodeFeatures, timestamp: u32 ) { @@ -71,7 +71,7 @@ pub(super) fn add_or_update_node( node_id, rgb: [0; 3], alias: NodeAlias([0; 32]), - addresses: Vec::new(), + addresses: vec![SocketAddress::TcpIpV4 { addr: [127, 0, 0, 1], port: 1000 }], excess_address_data: Vec::new(), excess_data: Vec::new(), }; @@ -87,7 +87,7 @@ pub(super) fn add_or_update_node( }; } -pub(super) fn update_channel( +pub(crate) fn update_channel( gossip_sync: &P2PGossipSync>>, Arc, Arc>, secp_ctx: &Secp256k1, node_privkey: &SecretKey, update: UnsignedChannelUpdate ) {