X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Frouting%2Ftest_utils.rs;h=9f03b4451eff025665517769934b9a62fd09be47;hb=fb3a86f498f971dc01fdd58b166031793ff1bc1a;hp=0cc6676e5e686faf376368ebb91105b0c3834790;hpb=22c9da3cfb6f624883286c84569db6639856768e;p=rust-lightning diff --git a/lightning/src/routing/test_utils.rs b/lightning/src/routing/test_utils.rs index 0cc6676e..9f03b445 100644 --- a/lightning/src/routing/test_utils.rs +++ b/lightning/src/routing/test_utils.rs @@ -9,7 +9,7 @@ use crate::routing::gossip::{NetworkGraph, NodeAlias, P2PGossipSync}; use crate::ln::features::{ChannelFeatures, NodeFeatures}; -use crate::ln::msgs::{ChannelAnnouncement, ChannelUpdate, MAX_VALUE_MSAT, NodeAnnouncement, RoutingMessageHandler, UnsignedChannelAnnouncement, UnsignedChannelUpdate, UnsignedNodeAnnouncement}; +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; @@ -27,7 +27,7 @@ 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 ) { @@ -59,7 +59,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 ) { @@ -70,7 +70,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(), }; @@ -86,7 +86,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 ) {