Skip to content

0.0.123 Backports #3042

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
d690072
Remove unnecessary PaymentPreimage clone
jkczyz Apr 22, 2024
520fecf
Optional OfferContents::signing_pubkey
jkczyz Apr 23, 2024
94d5af6
Allow parsing Offer without signing_pubkey
jkczyz Apr 24, 2024
61e4fce
Add InvoiceRequestTlvStream::paths
jkczyz Apr 23, 2024
b7635c4
Bolt12Invoice for Offer without signing_pubkey
jkczyz Apr 23, 2024
48cba29
Don't require Offer::description in API
jkczyz Apr 24, 2024
db7e696
Don't require Refund::description in API
jkczyz Apr 24, 2024
8e562be
Remove PaymentContext from OnionPayload
jkczyz Apr 26, 2024
7b86442
Remove InvoiceRequestFields::amount_msats
jkczyz Apr 26, 2024
33b6162
Remove InvoiceRequestFields::features
jkczyz Apr 26, 2024
d00e550
Merge pull request #3028 from jkczyz/2024-04-offer-id-followups
TheBlueMatt Apr 29, 2024
2b14cc4
Merge pull request #3017 from jkczyz/2024-04-optional-pubkey
TheBlueMatt Apr 29, 2024
6960210
Close channels when `find_funding_output` fails to find an output
TheBlueMatt Apr 29, 2024
b811cba
Send peers error messages for failures due to invalid batch funding
TheBlueMatt Apr 29, 2024
c6ae928
Fix overflow in lightning-invoice amount_pico_btc.
valentinewallace Apr 30, 2024
c8ddf36
Fix new rustc `#[macro_export]` warning in doctests
TheBlueMatt Apr 30, 2024
c903698
Merge pull request #3031 from TheBlueMatt/2024-04-new-rustc-warning
valentinewallace Apr 30, 2024
b403411
Merge pull request #3032 from valentinewallace/2024-04-pico-btc-overflow
TheBlueMatt May 1, 2024
89a67e5
Rename and expose message-specific `NextHop`
TheBlueMatt Apr 23, 2024
84070e1
Add derives where they make sense and the bindings require them
TheBlueMatt May 1, 2024
8084cec
Add bindings no-export tags to doc test types
TheBlueMatt May 1, 2024
e818c4b
Move `[u8; 32]` wrapper types to a common module
TheBlueMatt May 1, 2024
376df87
Update documentation on `[u8; 32]` wrappers for clarity
TheBlueMatt May 1, 2024
021979b
Wake `background-processor` from `ChainMonitor` on new blocks
TheBlueMatt Apr 30, 2024
bd3cc00
Merge pull request #3033 from TheBlueMatt/2024-04-notify-bp-on-blocks
TheBlueMatt May 1, 2024
2937000
Unify `get_{inbound,outbound}_pending_htlc_stats`
TheBlueMatt Mar 27, 2024
0e831b4
Correct indentation in `get_pending_htlc_stats`
TheBlueMatt Mar 27, 2024
11c3d70
Swap `UserConfig::default()` for `test_default_channel_config`
TheBlueMatt May 1, 2024
e61001f
Only require description when offer has an amount
jkczyz May 2, 2024
3d5a691
Merge pull request #3029 from TheBlueMatt/2024-04-fix-batch-funding-f…
TheBlueMatt May 3, 2024
a27088d
Merge pull request #3018 from jkczyz/2024-04-optional-description
TheBlueMatt May 3, 2024
37c431a
Merge pull request #3035 from TheBlueMatt/2024-04-upstream-123-bindings
TheBlueMatt May 4, 2024
0ea58d0
Fix overflow in invoice amount setter.
valentinewallace Apr 30, 2024
be21ab0
Merge pull request #3028 from jkczyz/2024-04-offer-id-followups
TheBlueMatt May 6, 2024
c0986f2
Merge pull request #3017 from jkczyz/2024-04-optional-pubkey
TheBlueMatt May 6, 2024
ff1827a
Merge pull request #3031 from TheBlueMatt/2024-04-new-rustc-warning
TheBlueMatt May 6, 2024
1b33b36
Merge pull request #3032 from valentinewallace/2024-04-pico-btc-overflow
TheBlueMatt May 6, 2024
1b816fe
Merge pull request #3033 from TheBlueMatt/2024-04-notify-bp-on-blocks
TheBlueMatt May 6, 2024
8554320
Merge pull request #3029 from TheBlueMatt/2024-04-fix-batch-funding-f…
TheBlueMatt May 6, 2024
72870aa
Merge pull request #3018 from jkczyz/2024-04-optional-description
TheBlueMatt May 6, 2024
71649d4
Merge pull request #3035 from TheBlueMatt/2024-04-upstream-123-bindings
TheBlueMatt May 6, 2024
50da8a2
Merge pull request #3039 from valentinewallace/2024-04-invoice-amt-ms…
TheBlueMatt May 6, 2024
51bf78d
Include excess commitment transaction fees in dust exposure
TheBlueMatt Apr 30, 2024
f0b3708
Update default dust exposure limit and the documentation thereof
TheBlueMatt May 5, 2024
5091c1f
Add a simple test of the new excess-fees-are-dust behavior
TheBlueMatt May 5, 2024
5cb2089
Merge pull request #3045 from TheBlueMatt/2024-03-fees-are-dust
TheBlueMatt May 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lightning-background-processor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ mod tests {
use lightning::chain::transaction::OutPoint;
use lightning::events::{Event, PathFailure, MessageSendEventsProvider, MessageSendEvent};
use lightning::{get_event_msg, get_event};
use lightning::ln::{PaymentHash, ChannelId};
use lightning::ln::types::{PaymentHash, ChannelId};
use lightning::ln::channelmanager;
use lightning::ln::channelmanager::{BREAKDOWN_TIMEOUT, ChainParameters, MIN_CLTV_EXPIRY_DELTA, PaymentId};
use lightning::ln::features::{ChannelFeatures, NodeFeatures};
Expand Down
3 changes: 1 addition & 2 deletions lightning-custom-message/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
//! `Foo` and `Bar` messages, and further composing it with a handler for `Baz` messages.
//!
//!```
//! # fn main() {} // Avoid #[macro_export] generating an in-function warning
//! # extern crate bitcoin;
//! extern crate lightning;
//! #[macro_use]
Expand Down Expand Up @@ -167,7 +168,6 @@
//! # }
//! }
//!
//! # fn main() {
//! // The first crate may define a handler composing `FooHandler` and `BarHandler` and export the
//! // corresponding message type ids as a macro to use in further composition.
//!
Expand Down Expand Up @@ -207,7 +207,6 @@
//! macro_rules! foo_bar_baz_type_ids {
//! () => { foo_bar_type_ids!() | baz_type_id!() }
//! }
//! # }
//!```
//!
//! [BOLT 1]: https://github.com/lightning/bolts/blob/master/01-messaging.md
Expand Down
2 changes: 1 addition & 1 deletion lightning-invoice/src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use bitcoin::address::WitnessVersion;
use bitcoin::hashes::Hash;
use bitcoin::hashes::sha256;
use crate::prelude::*;
use lightning::ln::PaymentSecret;
use lightning::ln::types::PaymentSecret;
use lightning::routing::gossip::RoutingFees;
use lightning::routing::router::{RouteHint, RouteHintHop};

Expand Down
19 changes: 13 additions & 6 deletions lightning-invoice/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ use core::str;
use serde::{Deserialize, Deserializer,Serialize, Serializer, de::Error};

#[doc(no_inline)]
pub use lightning::ln::PaymentSecret;
pub use lightning::ln::types::PaymentSecret;
#[doc(no_inline)]
pub use lightning::routing::router::{RouteHint, RouteHintHop};
#[doc(no_inline)]
Expand Down Expand Up @@ -162,7 +162,7 @@ pub const DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA: u64 = 18;
/// use secp256k1::Secp256k1;
/// use secp256k1::SecretKey;
///
/// use lightning::ln::PaymentSecret;
/// use lightning::ln::types::PaymentSecret;
///
/// use lightning_invoice::{Currency, InvoiceBuilder};
///
Expand Down Expand Up @@ -577,7 +577,13 @@ impl<D: tb::Bool, H: tb::Bool, T: tb::Bool, C: tb::Bool, S: tb::Bool, M: tb::Boo

/// Sets the amount in millisatoshis. The optimal SI prefix is chosen automatically.
pub fn amount_milli_satoshis(mut self, amount_msat: u64) -> Self {
let amount = amount_msat * 10; // Invoices are denominated in "pico BTC"
let amount = match amount_msat.checked_mul(10) { // Invoices are denominated in "pico BTC"
Some(amt) => amt,
None => {
self.error = Some(CreationError::InvalidAmount);
return self
}
};
let biggest_possible_si_prefix = SiPrefix::values_desc()
.iter()
.find(|prefix| amount % prefix.multiplier() == 0)
Expand Down Expand Up @@ -1068,9 +1074,10 @@ impl RawBolt11Invoice {
find_all_extract!(self.known_tagged_fields(), TaggedField::PrivateRoute(ref x), x).collect()
}

/// Returns `None` if no amount is set or on overflow.
pub fn amount_pico_btc(&self) -> Option<u64> {
self.hrp.raw_amount.map(|v| {
v * self.hrp.si_prefix.as_ref().map_or(1_000_000_000_000, |si| { si.multiplier() })
self.hrp.raw_amount.and_then(|v| {
v.checked_mul(self.hrp.si_prefix.as_ref().map_or(1_000_000_000_000, |si| { si.multiplier() }))
})
}

Expand Down Expand Up @@ -1876,7 +1883,7 @@ mod test {
Bolt11SemanticError};

let private_key = SecretKey::from_slice(&[42; 32]).unwrap();
let payment_secret = lightning::ln::PaymentSecret([21; 32]);
let payment_secret = lightning::ln::types::PaymentSecret([21; 32]);
let invoice_template = RawBolt11Invoice {
hrp: RawHrp {
currency: Currency::Bitcoin,
Expand Down
4 changes: 2 additions & 2 deletions lightning-invoice/src/payment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use crate::Bolt11Invoice;
use bitcoin::hashes::Hash;

use lightning::ln::PaymentHash;
use lightning::ln::types::PaymentHash;
use lightning::ln::channelmanager::RecipientOnionFields;
use lightning::routing::router::{PaymentParameters, RouteParameters};

Expand Down Expand Up @@ -85,7 +85,7 @@ mod tests {
use super::*;
use crate::{InvoiceBuilder, Currency};
use bitcoin::hashes::sha256::Hash as Sha256;
use lightning::ln::PaymentSecret;
use lightning::ln::types::PaymentSecret;
use lightning::routing::router::Payee;
use secp256k1::{SecretKey, PublicKey, Secp256k1};
use core::time::Duration;
Expand Down
6 changes: 3 additions & 3 deletions lightning-invoice/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use bitcoin::hashes::Hash;
use lightning::chain;
use lightning::chain::chaininterface::{BroadcasterInterface, FeeEstimator};
use lightning::sign::{Recipient, NodeSigner, SignerProvider, EntropySource};
use lightning::ln::{PaymentHash, PaymentSecret};
use lightning::ln::types::{PaymentHash, PaymentSecret};
use lightning::ln::channelmanager::{ChannelDetails, ChannelManager, MIN_FINAL_CLTV_EXPIRY_DELTA};
use lightning::ln::channelmanager::{PhantomRouteHints, MIN_CLTV_EXPIRY_DELTA};
use lightning::ln::inbound_payment::{create, create_from_hash, ExpandedKey};
Expand Down Expand Up @@ -824,9 +824,9 @@ mod test {
use bitcoin::hashes::sha256::Hash as Sha256;
use lightning::sign::PhantomKeysManager;
use lightning::events::{MessageSendEvent, MessageSendEventsProvider};
use lightning::ln::PaymentHash;
use lightning::ln::types::PaymentHash;
#[cfg(feature = "std")]
use lightning::ln::PaymentPreimage;
use lightning::ln::types::PaymentPreimage;
use lightning::ln::channelmanager::{PhantomRouteHints, MIN_FINAL_CLTV_EXPIRY_DELTA, PaymentId, RecipientOnionFields, Retry};
use lightning::ln::functional_test_utils::*;
use lightning::ln::msgs::ChannelMessageHandler;
Expand Down
23 changes: 7 additions & 16 deletions lightning/src/blinded_path/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use bitcoin::secp256k1::{self, PublicKey, Secp256k1, SecretKey};
#[allow(unused_imports)]
use crate::prelude::*;

use crate::blinded_path::{BlindedHop, BlindedPath, IntroductionNode, NodeIdLookUp};
use crate::blinded_path::{BlindedHop, BlindedPath, IntroductionNode, NextMessageHop, NodeIdLookUp};
use crate::blinded_path::utils;
use crate::io;
use crate::io::Cursor;
Expand All @@ -20,7 +20,7 @@ use core::ops::Deref;
/// route, they are encoded into [`BlindedHop::encrypted_payload`].
pub(crate) struct ForwardTlvs {
/// The next hop in the onion message's path.
pub(crate) next_hop: NextHop,
pub(crate) next_hop: NextMessageHop,
/// Senders to a blinded path use this value to concatenate the route they find to the
/// introduction node with the blinded path.
pub(crate) next_blinding_override: Option<PublicKey>,
Expand All @@ -34,20 +34,11 @@ pub(crate) struct ReceiveTlvs {
pub(crate) path_id: Option<[u8; 32]>,
}

/// The next hop to forward the onion message along its path.
#[derive(Debug)]
pub enum NextHop {
/// The node id of the next hop.
NodeId(PublicKey),
/// The short channel id leading to the next hop.
ShortChannelId(u64),
}

impl Writeable for ForwardTlvs {
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), io::Error> {
let (next_node_id, short_channel_id) = match self.next_hop {
NextHop::NodeId(pubkey) => (Some(pubkey), None),
NextHop::ShortChannelId(scid) => (None, Some(scid)),
NextMessageHop::NodeId(pubkey) => (Some(pubkey), None),
NextMessageHop::ShortChannelId(scid) => (None, Some(scid)),
};
// TODO: write padding
encode_tlv_stream!(writer, {
Expand Down Expand Up @@ -75,7 +66,7 @@ pub(super) fn blinded_hops<T: secp256k1::Signing + secp256k1::Verification>(
) -> Result<Vec<BlindedHop>, secp256k1::Error> {
let blinded_tlvs = unblinded_path.iter()
.skip(1) // The first node's TLVs contains the next node's pubkey
.map(|pk| ForwardTlvs { next_hop: NextHop::NodeId(*pk), next_blinding_override: None })
.map(|pk| ForwardTlvs { next_hop: NextMessageHop::NodeId(*pk), next_blinding_override: None })
.map(|tlvs| ControlTlvs::Forward(tlvs))
.chain(core::iter::once(ControlTlvs::Receive(ReceiveTlvs { path_id: None })));

Expand All @@ -102,8 +93,8 @@ where
readable: ControlTlvs::Forward(ForwardTlvs { next_hop, next_blinding_override })
}) => {
let next_node_id = match next_hop {
NextHop::NodeId(pubkey) => pubkey,
NextHop::ShortChannelId(scid) => match node_id_lookup.next_node_id(scid) {
NextMessageHop::NodeId(pubkey) => pubkey,
NextMessageHop::ShortChannelId(scid) => match node_id_lookup.next_node_id(scid) {
Some(pubkey) => pubkey,
None => return Err(()),
},
Expand Down
11 changes: 11 additions & 0 deletions lightning/src/blinded_path/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ use crate::util::ser::{Readable, Writeable, Writer};
use crate::io;
use crate::prelude::*;

/// The next hop to forward an onion message along its path.
///
/// Note that payment blinded paths always specify their next hop using an explicit node id.
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
pub enum NextMessageHop {
/// The node id of the next hop.
NodeId(PublicKey),
/// The short channel id leading to the next hop.
ShortChannelId(u64),
}

/// Onion messages and payments can be sent and received to blinded paths, which serve to hide the
/// identity of the recipient.
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
Expand Down
4 changes: 2 additions & 2 deletions lightning/src/blinded_path/payment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use bitcoin::secp256k1::{self, PublicKey, Secp256k1, SecretKey};
use crate::blinded_path::BlindedHop;
use crate::blinded_path::utils;
use crate::io;
use crate::ln::PaymentSecret;
use crate::ln::types::PaymentSecret;
use crate::ln::channelmanager::CounterpartyForwardingInfo;
use crate::ln::features::BlindedHopFeatures;
use crate::ln::msgs::DecodeError;
Expand Down Expand Up @@ -425,7 +425,7 @@ impl_writeable_tlv_based!(Bolt12RefundContext, {});
mod tests {
use bitcoin::secp256k1::PublicKey;
use crate::blinded_path::payment::{ForwardNode, ForwardTlvs, ReceiveTlvs, PaymentConstraints, PaymentContext, PaymentRelay};
use crate::ln::PaymentSecret;
use crate::ln::types::PaymentSecret;
use crate::ln::features::BlindedHopFeatures;
use crate::ln::functional_test_utils::TEST_FINAL_CLTV;

Expand Down
10 changes: 9 additions & 1 deletion lightning/src/chain/chainmonitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use crate::chain::{ChannelMonitorUpdateStatus, Filter, WatchedOutput};
use crate::chain::chaininterface::{BroadcasterInterface, FeeEstimator};
use crate::chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, Balance, MonitorEvent, TransactionOutputs, WithChannelMonitor, LATENCY_GRACE_PERIOD_BLOCKS};
use crate::chain::transaction::{OutPoint, TransactionData};
use crate::ln::ChannelId;
use crate::ln::types::ChannelId;
use crate::sign::ecdsa::WriteableEcdsaChannelSigner;
use crate::events;
use crate::events::{Event, EventHandler};
Expand Down Expand Up @@ -296,6 +296,8 @@ pub struct ChainMonitor<ChannelSigner: WriteableEcdsaChannelSigner, C: Deref, T:
/// The best block height seen, used as a proxy for the passage of time.
highest_chain_height: AtomicUsize,

/// A [`Notifier`] used to wake up the background processor in case we have any [`Event`]s for
/// it to give to users (or [`MonitorEvent`]s for `ChannelManager` to process).
event_notifier: Notifier,
}

Expand Down Expand Up @@ -738,6 +740,8 @@ where
monitor.block_connected(
header, txdata, height, &*self.broadcaster, &*self.fee_estimator, &self.logger)
});
// Assume we may have some new events and wake the event processor
self.event_notifier.notify();
}

fn block_disconnected(&self, header: &Header, height: u32) {
Expand Down Expand Up @@ -765,6 +769,8 @@ where
monitor.transactions_confirmed(
header, txdata, height, &*self.broadcaster, &*self.fee_estimator, &self.logger)
});
// Assume we may have some new events and wake the event processor
self.event_notifier.notify();
}

fn transaction_unconfirmed(&self, txid: &Txid) {
Expand All @@ -785,6 +791,8 @@ where
header, height, &*self.broadcaster, &*self.fee_estimator, &self.logger
)
});
// Assume we may have some new events and wake the event processor
self.event_notifier.notify();
}

fn get_relevant_txids(&self) -> Vec<(Txid, u32, Option<BlockHash>)> {
Expand Down
4 changes: 2 additions & 2 deletions lightning/src/chain/channelmonitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use bitcoin::secp256k1;
use bitcoin::sighash::EcdsaSighashType;

use crate::ln::channel::INITIAL_COMMITMENT_NUMBER;
use crate::ln::{PaymentHash, PaymentPreimage, ChannelId};
use crate::ln::types::{PaymentHash, PaymentPreimage, ChannelId};
use crate::ln::msgs::DecodeError;
use crate::ln::channel_keys::{DelayedPaymentKey, DelayedPaymentBasepoint, HtlcBasepoint, HtlcKey, RevocationKey, RevocationBasepoint};
use crate::ln::chan_utils::{self,CommitmentTransaction, CounterpartyCommitmentSecrets, HTLCOutputInCommitment, HTLCClaim, ChannelTransactionParameters, HolderCommitmentTransaction, TxCreationKeys};
Expand Down Expand Up @@ -4811,7 +4811,7 @@ mod tests {
use crate::chain::package::{weight_offered_htlc, weight_received_htlc, weight_revoked_offered_htlc, weight_revoked_received_htlc, WEIGHT_REVOKED_OUTPUT};
use crate::chain::transaction::OutPoint;
use crate::sign::InMemorySigner;
use crate::ln::{PaymentPreimage, PaymentHash, ChannelId};
use crate::ln::types::{PaymentPreimage, PaymentHash, ChannelId};
use crate::ln::channel_keys::{DelayedPaymentBasepoint, DelayedPaymentKey, HtlcBasepoint, RevocationBasepoint, RevocationKey};
use crate::ln::chan_utils::{self,HTLCOutputInCommitment, ChannelPublicKeys, ChannelTransactionParameters, HolderCommitmentTransaction, CounterpartyChannelTransactionParameters};
use crate::ln::channelmanager::{PaymentSendFailure, PaymentId, RecipientOnionFields};
Expand Down
2 changes: 1 addition & 1 deletion lightning/src/chain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use bitcoin::network::constants::Network;
use bitcoin::secp256k1::PublicKey;

use crate::chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, MonitorEvent};
use crate::ln::ChannelId;
use crate::ln::types::ChannelId;
use crate::sign::ecdsa::WriteableEcdsaChannelSigner;
use crate::chain::transaction::{OutPoint, TransactionData};
use crate::impl_writeable_tlv_based;
Expand Down
2 changes: 1 addition & 1 deletion lightning/src/chain/onchaintx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use bitcoin::secp256k1;
use crate::chain::chaininterface::compute_feerate_sat_per_1000_weight;
use crate::sign::{ChannelDerivationParameters, HTLCDescriptor, ChannelSigner, EntropySource, SignerProvider, ecdsa::WriteableEcdsaChannelSigner};
use crate::ln::msgs::DecodeError;
use crate::ln::PaymentPreimage;
use crate::ln::types::PaymentPreimage;
use crate::ln::chan_utils::{self, ChannelTransactionParameters, HTLCOutputInCommitment, HolderCommitmentTransaction};
use crate::chain::ClaimId;
use crate::chain::chaininterface::{ConfirmationTarget, FeeEstimator, BroadcasterInterface, LowerBoundedFeeEstimator};
Expand Down
4 changes: 2 additions & 2 deletions lightning/src/chain/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use bitcoin::hash_types::Txid;
use bitcoin::secp256k1::{SecretKey,PublicKey};
use bitcoin::sighash::EcdsaSighashType;

use crate::ln::PaymentPreimage;
use crate::ln::types::PaymentPreimage;
use crate::ln::chan_utils::{self, TxCreationKeys, HTLCOutputInCommitment};
use crate::ln::features::ChannelTypeFeatures;
use crate::ln::channel_keys::{DelayedPaymentBasepoint, HtlcBasepoint};
Expand Down Expand Up @@ -1195,7 +1195,7 @@ mod tests {
use crate::chain::package::{CounterpartyOfferedHTLCOutput, CounterpartyReceivedHTLCOutput, HolderHTLCOutput, PackageTemplate, PackageSolvingData, RevokedOutput, WEIGHT_REVOKED_OUTPUT, weight_offered_htlc, weight_received_htlc};
use crate::chain::Txid;
use crate::ln::chan_utils::HTLCOutputInCommitment;
use crate::ln::{PaymentPreimage, PaymentHash};
use crate::ln::types::{PaymentPreimage, PaymentHash};
use crate::ln::channel_keys::{DelayedPaymentBasepoint, HtlcBasepoint};

use bitcoin::blockdata::constants::WITNESS_SCALE_FACTOR;
Expand Down
2 changes: 1 addition & 1 deletion lightning/src/chain/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl MaybeSignedTransaction {
#[cfg(test)]
mod tests {
use crate::chain::transaction::OutPoint;
use crate::ln::ChannelId;
use crate::ln::types::ChannelId;

use bitcoin::blockdata::transaction::Transaction;
use bitcoin::consensus::encode;
Expand Down
2 changes: 1 addition & 1 deletion lightning/src/events/bump_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::chain::chaininterface::{BroadcasterInterface, fee_for_weight};
use crate::chain::ClaimId;
use crate::io_extras::sink;
use crate::ln::channel::ANCHOR_OUTPUT_VALUE_SATOSHI;
use crate::ln::ChannelId;
use crate::ln::types::ChannelId;
use crate::ln::chan_utils;
use crate::ln::chan_utils::{
ANCHOR_INPUT_WITNESS_WEIGHT, HTLC_SUCCESS_INPUT_ANCHOR_WITNESS_WEIGHT,
Expand Down
2 changes: 1 addition & 1 deletion lightning/src/events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use crate::ln::channelmanager::{InterceptId, PaymentId, RecipientOnionFields};
use crate::ln::channel::FUNDING_CONF_DEADLINE_BLOCKS;
use crate::ln::features::ChannelTypeFeatures;
use crate::ln::msgs;
use crate::ln::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
use crate::chain::transaction;
use crate::routing::gossip::NetworkUpdate;
use crate::util::errors::APIError;
Expand Down
2 changes: 1 addition & 1 deletion lightning/src/ln/blinded_payment_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
use crate::blinded_path::BlindedPath;
use crate::blinded_path::payment::{ForwardNode, ForwardTlvs, PaymentConstraints, PaymentContext, PaymentRelay, ReceiveTlvs};
use crate::events::{Event, HTLCDestination, MessageSendEvent, MessageSendEventsProvider, PaymentFailureReason};
use crate::ln::PaymentSecret;
use crate::ln::types::PaymentSecret;
use crate::ln::channelmanager;
use crate::ln::channelmanager::{PaymentId, RecipientOnionFields};
use crate::ln::features::BlindedHopFeatures;
Expand Down
4 changes: 2 additions & 2 deletions lightning/src/ln/chan_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use bitcoin::hash_types::{Txid, PubkeyHash, WPubkeyHash};
use crate::chain::chaininterface::fee_for_weight;
use crate::chain::package::WEIGHT_REVOKED_OUTPUT;
use crate::sign::EntropySource;
use crate::ln::{PaymentHash, PaymentPreimage};
use crate::ln::types::{PaymentHash, PaymentPreimage};
use crate::ln::msgs::DecodeError;
use crate::util::ser::{Readable, RequiredWrapper, Writeable, Writer};
use crate::util::transaction_utils;
Expand Down Expand Up @@ -1826,7 +1826,7 @@ mod tests {
use bitcoin::{Network, Txid, ScriptBuf};
use bitcoin::hashes::Hash;
use bitcoin::hashes::hex::FromHex;
use crate::ln::PaymentHash;
use crate::ln::types::PaymentHash;
use bitcoin::address::Payload;
use bitcoin::PublicKey as BitcoinPublicKey;
use crate::ln::features::ChannelTypeFeatures;
Expand Down
3 changes: 2 additions & 1 deletion lightning/src/ln/chanmon_update_fail_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ use crate::chain::{ChannelMonitorUpdateStatus, Listen, Watch};
use crate::events::{Event, MessageSendEvent, MessageSendEventsProvider, PaymentPurpose, ClosureReason, HTLCDestination};
use crate::ln::channelmanager::{RAACommitmentOrder, PaymentSendFailure, PaymentId, RecipientOnionFields};
use crate::ln::channel::{AnnouncementSigsState, ChannelPhase};
use crate::ln::{msgs, ChannelId};
use crate::ln::msgs;
use crate::ln::types::ChannelId;
use crate::ln::msgs::{ChannelMessageHandler, RoutingMessageHandler};
use crate::util::test_channel_signer::TestChannelSigner;
use crate::util::errors::APIError;
Expand Down
Loading