projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move the public path for `channel_state` types to their new path
[rust-lightning]
/
lightning
/
src
/
ln
/
onion_payment.rs
diff --git
a/lightning/src/ln/onion_payment.rs
b/lightning/src/ln/onion_payment.rs
index db8c4cd033708fd36413aaf4b8c30ec05e4075e8..f62ca5d84e637bc4d95bb48d679f00151a756d0e 100644
(file)
--- a/
lightning/src/ln/onion_payment.rs
+++ b/
lightning/src/ln/onion_payment.rs
@@
-11,7
+11,7
@@
use bitcoin::secp256k1::{self, PublicKey, Scalar, Secp256k1};
use crate::blinded_path;
use crate::blinded_path::payment::{PaymentConstraints, PaymentRelay};
use crate::chain::channelmonitor::{HTLC_FAIL_BACK_BUFFER, LATENCY_GRACE_PERIOD_BLOCKS};
use crate::blinded_path;
use crate::blinded_path::payment::{PaymentConstraints, PaymentRelay};
use crate::chain::channelmonitor::{HTLC_FAIL_BACK_BUFFER, LATENCY_GRACE_PERIOD_BLOCKS};
-use crate::ln::PaymentHash;
+use crate::ln::
types::
PaymentHash;
use crate::ln::channelmanager::{BlindedFailure, BlindedForward, CLTV_FAR_FAR_AWAY, HTLCFailureMsg, MIN_CLTV_EXPIRY_DELTA, PendingHTLCInfo, PendingHTLCRouting};
use crate::ln::features::BlindedHopFeatures;
use crate::ln::msgs;
use crate::ln::channelmanager::{BlindedFailure, BlindedForward, CLTV_FAR_FAR_AWAY, HTLCFailureMsg, MIN_CLTV_EXPIRY_DELTA, PendingHTLCInfo, PendingHTLCRouting};
use crate::ln::features::BlindedHopFeatures;
use crate::ln::msgs;
@@
-26,7
+26,7
@@
use crate::prelude::*;
use core::ops::Deref;
/// Invalid inbound onion payment.
use core::ops::Deref;
/// Invalid inbound onion payment.
-#[derive(
Debug
)]
+#[derive(
Clone, Debug, Hash, PartialEq, Eq
)]
pub struct InboundHTLCErr {
/// BOLT 4 error code.
pub err_code: u16,
pub struct InboundHTLCErr {
/// BOLT 4 error code.
pub err_code: u16,
@@
-504,8
+504,7
@@
mod tests {
use bitcoin::hashes::Hash;
use bitcoin::hashes::sha256::Hash as Sha256;
use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
use bitcoin::hashes::Hash;
use bitcoin::hashes::sha256::Hash as Sha256;
use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
- use crate::ln::{PaymentPreimage, PaymentHash, PaymentSecret};
- use crate::ln::ChannelId;
+ use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
use crate::ln::channelmanager::RecipientOnionFields;
use crate::ln::features::{ChannelFeatures, NodeFeatures};
use crate::ln::msgs;
use crate::ln::channelmanager::RecipientOnionFields;
use crate::ln::features::{ChannelFeatures, NodeFeatures};
use crate::ln::msgs;
@@
-537,7
+536,7
@@
mod tests {
let path = Path { hops, blinded_tail: None, };
let onion_keys = super::onion_utils::construct_onion_keys(&secp_ctx, &path, &session_priv).unwrap();
let (onion_payloads, ..) = super::onion_utils::build_onion_payloads(
let path = Path { hops, blinded_tail: None, };
let onion_keys = super::onion_utils::construct_onion_keys(&secp_ctx, &path, &session_priv).unwrap();
let (onion_payloads, ..) = super::onion_utils::build_onion_payloads(
- &path, total_amt_msat, recipient_onion, cur_height + 1, &Some(keysend_preimage)
+ &path, total_amt_msat,
&
recipient_onion, cur_height + 1, &Some(keysend_preimage)
).unwrap();
assert!(super::onion_utils::construct_onion_packet(
).unwrap();
assert!(super::onion_utils::construct_onion_packet(
@@
-564,8
+563,8
@@
mod tests {
};
let (onion, amount_msat, cltv_expiry) = create_payment_onion(
};
let (onion, amount_msat, cltv_expiry) = create_payment_onion(
- &secp_ctx, &path, &session_priv, total_amt_msat,
recipient_onion, cur_height
,
- &payment_hash, &Some(preimage), prng_seed
+ &secp_ctx, &path, &session_priv, total_amt_msat,
&recipient_onion
,
+
cur_height,
&payment_hash, &Some(preimage), prng_seed
).unwrap();
let msg = make_update_add_msg(amount_msat, cltv_expiry, payment_hash, onion);
).unwrap();
let msg = make_update_add_msg(amount_msat, cltv_expiry, payment_hash, onion);