X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Frouting%2Ftest_utils.rs;h=b737bab352441a1b2a9289cc143e078ba6384c97;hb=10e06331f3f392a5dd38f20601f728a072870d69;hp=f1a853f0a3e0930aace913782d187353d63e76fe;hpb=4cd990142780233d163b68f21ada293656ca6b54;p=rust-lightning diff --git a/lightning/src/routing/test_utils.rs b/lightning/src/routing/test_utils.rs index f1a853f0..b737bab3 100644 --- a/lightning/src/routing/test_utils.rs +++ b/lightning/src/routing/test_utils.rs @@ -7,12 +7,12 @@ // You may not use this file except in accordance with one or both of these // licenses. -use routing::gossip::{NetworkGraph, P2PGossipSync}; -use ln::features::{ChannelFeatures, NodeFeatures}; -use ln::msgs::{UnsignedChannelAnnouncement, ChannelAnnouncement, RoutingMessageHandler, +use crate::routing::gossip::{NetworkGraph, P2PGossipSync}; +use crate::ln::features::{ChannelFeatures, NodeFeatures}; +use crate::ln::msgs::{UnsignedChannelAnnouncement, ChannelAnnouncement, RoutingMessageHandler, NodeAnnouncement, UnsignedNodeAnnouncement, ChannelUpdate, UnsignedChannelUpdate, MAX_VALUE_MSAT}; -use util::test_utils; -use util::ser::Writeable; +use crate::util::test_utils; +use crate::util::ser::Writeable; use bitcoin::hashes::sha256d::Hash as Sha256dHash; use bitcoin::hashes::Hash; @@ -24,16 +24,18 @@ use hex; use bitcoin::secp256k1::{PublicKey,SecretKey}; use bitcoin::secp256k1::{Secp256k1, All}; -use prelude::*; -use sync::{self, Arc}; +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( gossip_sync: &P2PGossipSync>>, Arc, Arc>, secp_ctx: &Secp256k1, node_1_privkey: &SecretKey, node_2_privkey: &SecretKey, features: ChannelFeatures, short_channel_id: u64 ) { - let node_id_1 = PublicKey::from_secret_key(&secp_ctx, node_1_privkey); - let node_id_2 = PublicKey::from_secret_key(&secp_ctx, node_2_privkey); + let node_id_1 = NodeId::from_pubkey(&PublicKey::from_secret_key(&secp_ctx, node_1_privkey)); + let node_id_2 = NodeId::from_pubkey(&PublicKey::from_secret_key(&secp_ctx, node_2_privkey)); let unsigned_announcement = UnsignedChannelAnnouncement { features, @@ -64,7 +66,7 @@ pub(super) fn add_or_update_node( gossip_sync: &P2PGossipSync>>, Arc, Arc>, secp_ctx: &Secp256k1, node_privkey: &SecretKey, features: NodeFeatures, timestamp: u32 ) { - let node_id = PublicKey::from_secret_key(&secp_ctx, node_privkey); + let node_id = NodeId::from_pubkey(&PublicKey::from_secret_key(&secp_ctx, node_privkey)); let unsigned_announcement = UnsignedNodeAnnouncement { features, timestamp,