X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Frouting%2Fscoring.rs;h=7504e0840d2683125cf75144fd445b070c6f08da;hb=10e06331f3f392a5dd38f20601f728a072870d69;hp=5cc9f2965763dc98b64b0c4a6be8dec07c7685eb;hpb=3f32f60ae7e75a4be96d3d5adc8d18b53445e5e5;p=rust-lightning diff --git a/lightning/src/routing/scoring.rs b/lightning/src/routing/scoring.rs index 5cc9f296..7504e084 100644 --- a/lightning/src/routing/scoring.rs +++ b/lightning/src/routing/scoring.rs @@ -260,7 +260,7 @@ impl<'a, S: Writeable> Writeable for MutexGuard<'a, S> { } /// Proposed use of a channel passed as a parameter to [`Score::channel_penalty_msat`]. -#[derive(Clone, Copy, Debug)] +#[derive(Clone, Copy, Debug, PartialEq)] pub struct ChannelUsage { /// The amount to send through the channel, denominated in millisatoshis. pub amount_msat: u64, @@ -1779,10 +1779,10 @@ mod tests { features: channelmanager::provided_channel_features(&UserConfig::default()), chain_hash: genesis_hash, short_channel_id, - node_id_1: PublicKey::from_secret_key(&secp_ctx, &node_1_key), - node_id_2: PublicKey::from_secret_key(&secp_ctx, &node_2_key), - bitcoin_key_1: PublicKey::from_secret_key(&secp_ctx, &node_1_secret), - bitcoin_key_2: PublicKey::from_secret_key(&secp_ctx, &node_2_secret), + node_id_1: NodeId::from_pubkey(&PublicKey::from_secret_key(&secp_ctx, &node_1_key)), + node_id_2: NodeId::from_pubkey(&PublicKey::from_secret_key(&secp_ctx, &node_2_key)), + bitcoin_key_1: NodeId::from_pubkey(&PublicKey::from_secret_key(&secp_ctx, &node_1_secret)), + bitcoin_key_2: NodeId::from_pubkey(&PublicKey::from_secret_key(&secp_ctx, &node_2_secret)), excess_data: Vec::new(), }; let msghash = hash_to_message!(&Sha256dHash::hash(&unsigned_announcement.encode()[..])[..]);