Skip to content

Commit 37c431a

Browse files
authored
Merge pull request #3035 from TheBlueMatt/2024-04-upstream-123-bindings
2 parents a27088d + 376df87 commit 37c431a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+199
-183
lines changed

lightning-background-processor/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ mod tests {
932932
use lightning::chain::transaction::OutPoint;
933933
use lightning::events::{Event, PathFailure, MessageSendEventsProvider, MessageSendEvent};
934934
use lightning::{get_event_msg, get_event};
935-
use lightning::ln::{PaymentHash, ChannelId};
935+
use lightning::ln::types::{PaymentHash, ChannelId};
936936
use lightning::ln::channelmanager;
937937
use lightning::ln::channelmanager::{BREAKDOWN_TIMEOUT, ChainParameters, MIN_CLTV_EXPIRY_DELTA, PaymentId};
938938
use lightning::ln::features::{ChannelFeatures, NodeFeatures};

lightning-invoice/src/de.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use bitcoin::address::WitnessVersion;
1515
use bitcoin::hashes::Hash;
1616
use bitcoin::hashes::sha256;
1717
use crate::prelude::*;
18-
use lightning::ln::PaymentSecret;
18+
use lightning::ln::types::PaymentSecret;
1919
use lightning::routing::gossip::RoutingFees;
2020
use lightning::routing::router::{RouteHint, RouteHintHop};
2121

lightning-invoice/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ use core::str;
6565
use serde::{Deserialize, Deserializer,Serialize, Serializer, de::Error};
6666

6767
#[doc(no_inline)]
68-
pub use lightning::ln::PaymentSecret;
68+
pub use lightning::ln::types::PaymentSecret;
6969
#[doc(no_inline)]
7070
pub use lightning::routing::router::{RouteHint, RouteHintHop};
7171
#[doc(no_inline)]
@@ -162,7 +162,7 @@ pub const DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA: u64 = 18;
162162
/// use secp256k1::Secp256k1;
163163
/// use secp256k1::SecretKey;
164164
///
165-
/// use lightning::ln::PaymentSecret;
165+
/// use lightning::ln::types::PaymentSecret;
166166
///
167167
/// use lightning_invoice::{Currency, InvoiceBuilder};
168168
///
@@ -1877,7 +1877,7 @@ mod test {
18771877
Bolt11SemanticError};
18781878

18791879
let private_key = SecretKey::from_slice(&[42; 32]).unwrap();
1880-
let payment_secret = lightning::ln::PaymentSecret([21; 32]);
1880+
let payment_secret = lightning::ln::types::PaymentSecret([21; 32]);
18811881
let invoice_template = RawBolt11Invoice {
18821882
hrp: RawHrp {
18831883
currency: Currency::Bitcoin,

lightning-invoice/src/payment.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use crate::Bolt11Invoice;
1313
use bitcoin::hashes::Hash;
1414

15-
use lightning::ln::PaymentHash;
15+
use lightning::ln::types::PaymentHash;
1616
use lightning::ln::channelmanager::RecipientOnionFields;
1717
use lightning::routing::router::{PaymentParameters, RouteParameters};
1818

@@ -85,7 +85,7 @@ mod tests {
8585
use super::*;
8686
use crate::{InvoiceBuilder, Currency};
8787
use bitcoin::hashes::sha256::Hash as Sha256;
88-
use lightning::ln::PaymentSecret;
88+
use lightning::ln::types::PaymentSecret;
8989
use lightning::routing::router::Payee;
9090
use secp256k1::{SecretKey, PublicKey, Secp256k1};
9191
use core::time::Duration;

lightning-invoice/src/utils.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use bitcoin::hashes::Hash;
88
use lightning::chain;
99
use lightning::chain::chaininterface::{BroadcasterInterface, FeeEstimator};
1010
use lightning::sign::{Recipient, NodeSigner, SignerProvider, EntropySource};
11-
use lightning::ln::{PaymentHash, PaymentSecret};
11+
use lightning::ln::types::{PaymentHash, PaymentSecret};
1212
use lightning::ln::channelmanager::{ChannelDetails, ChannelManager, MIN_FINAL_CLTV_EXPIRY_DELTA};
1313
use lightning::ln::channelmanager::{PhantomRouteHints, MIN_CLTV_EXPIRY_DELTA};
1414
use lightning::ln::inbound_payment::{create, create_from_hash, ExpandedKey};
@@ -824,9 +824,9 @@ mod test {
824824
use bitcoin::hashes::sha256::Hash as Sha256;
825825
use lightning::sign::PhantomKeysManager;
826826
use lightning::events::{MessageSendEvent, MessageSendEventsProvider};
827-
use lightning::ln::PaymentHash;
827+
use lightning::ln::types::PaymentHash;
828828
#[cfg(feature = "std")]
829-
use lightning::ln::PaymentPreimage;
829+
use lightning::ln::types::PaymentPreimage;
830830
use lightning::ln::channelmanager::{PhantomRouteHints, MIN_FINAL_CLTV_EXPIRY_DELTA, PaymentId, RecipientOnionFields, Retry};
831831
use lightning::ln::functional_test_utils::*;
832832
use lightning::ln::msgs::ChannelMessageHandler;

lightning/src/blinded_path/message.rs

+7-16
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use bitcoin::secp256k1::{self, PublicKey, Secp256k1, SecretKey};
33
#[allow(unused_imports)]
44
use crate::prelude::*;
55

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

37-
/// The next hop to forward the onion message along its path.
38-
#[derive(Debug)]
39-
pub enum NextHop {
40-
/// The node id of the next hop.
41-
NodeId(PublicKey),
42-
/// The short channel id leading to the next hop.
43-
ShortChannelId(u64),
44-
}
45-
4637
impl Writeable for ForwardTlvs {
4738
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), io::Error> {
4839
let (next_node_id, short_channel_id) = match self.next_hop {
49-
NextHop::NodeId(pubkey) => (Some(pubkey), None),
50-
NextHop::ShortChannelId(scid) => (None, Some(scid)),
40+
NextMessageHop::NodeId(pubkey) => (Some(pubkey), None),
41+
NextMessageHop::ShortChannelId(scid) => (None, Some(scid)),
5142
};
5243
// TODO: write padding
5344
encode_tlv_stream!(writer, {
@@ -75,7 +66,7 @@ pub(super) fn blinded_hops<T: secp256k1::Signing + secp256k1::Verification>(
7566
) -> Result<Vec<BlindedHop>, secp256k1::Error> {
7667
let blinded_tlvs = unblinded_path.iter()
7768
.skip(1) // The first node's TLVs contains the next node's pubkey
78-
.map(|pk| ForwardTlvs { next_hop: NextHop::NodeId(*pk), next_blinding_override: None })
69+
.map(|pk| ForwardTlvs { next_hop: NextMessageHop::NodeId(*pk), next_blinding_override: None })
7970
.map(|tlvs| ControlTlvs::Forward(tlvs))
8071
.chain(core::iter::once(ControlTlvs::Receive(ReceiveTlvs { path_id: None })));
8172

@@ -102,8 +93,8 @@ where
10293
readable: ControlTlvs::Forward(ForwardTlvs { next_hop, next_blinding_override })
10394
}) => {
10495
let next_node_id = match next_hop {
105-
NextHop::NodeId(pubkey) => pubkey,
106-
NextHop::ShortChannelId(scid) => match node_id_lookup.next_node_id(scid) {
96+
NextMessageHop::NodeId(pubkey) => pubkey,
97+
NextMessageHop::ShortChannelId(scid) => match node_id_lookup.next_node_id(scid) {
10798
Some(pubkey) => pubkey,
10899
None => return Err(()),
109100
},

lightning/src/blinded_path/mod.rs

+11
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ use crate::util::ser::{Readable, Writeable, Writer};
2424
use crate::io;
2525
use crate::prelude::*;
2626

27+
/// The next hop to forward an onion message along its path.
28+
///
29+
/// Note that payment blinded paths always specify their next hop using an explicit node id.
30+
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
31+
pub enum NextMessageHop {
32+
/// The node id of the next hop.
33+
NodeId(PublicKey),
34+
/// The short channel id leading to the next hop.
35+
ShortChannelId(u64),
36+
}
37+
2738
/// Onion messages and payments can be sent and received to blinded paths, which serve to hide the
2839
/// identity of the recipient.
2940
#[derive(Clone, Debug, Hash, PartialEq, Eq)]

lightning/src/blinded_path/payment.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use bitcoin::secp256k1::{self, PublicKey, Secp256k1, SecretKey};
77
use crate::blinded_path::BlindedHop;
88
use crate::blinded_path::utils;
99
use crate::io;
10-
use crate::ln::PaymentSecret;
10+
use crate::ln::types::PaymentSecret;
1111
use crate::ln::channelmanager::CounterpartyForwardingInfo;
1212
use crate::ln::features::BlindedHopFeatures;
1313
use crate::ln::msgs::DecodeError;
@@ -425,7 +425,7 @@ impl_writeable_tlv_based!(Bolt12RefundContext, {});
425425
mod tests {
426426
use bitcoin::secp256k1::PublicKey;
427427
use crate::blinded_path::payment::{ForwardNode, ForwardTlvs, ReceiveTlvs, PaymentConstraints, PaymentContext, PaymentRelay};
428-
use crate::ln::PaymentSecret;
428+
use crate::ln::types::PaymentSecret;
429429
use crate::ln::features::BlindedHopFeatures;
430430
use crate::ln::functional_test_utils::TEST_FINAL_CLTV;
431431

lightning/src/chain/chainmonitor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use crate::chain::{ChannelMonitorUpdateStatus, Filter, WatchedOutput};
3131
use crate::chain::chaininterface::{BroadcasterInterface, FeeEstimator};
3232
use crate::chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, Balance, MonitorEvent, TransactionOutputs, WithChannelMonitor, LATENCY_GRACE_PERIOD_BLOCKS};
3333
use crate::chain::transaction::{OutPoint, TransactionData};
34-
use crate::ln::ChannelId;
34+
use crate::ln::types::ChannelId;
3535
use crate::sign::ecdsa::WriteableEcdsaChannelSigner;
3636
use crate::events;
3737
use crate::events::{Event, EventHandler};

lightning/src/chain/channelmonitor.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use bitcoin::secp256k1;
3434
use bitcoin::sighash::EcdsaSighashType;
3535

3636
use crate::ln::channel::INITIAL_COMMITMENT_NUMBER;
37-
use crate::ln::{PaymentHash, PaymentPreimage, ChannelId};
37+
use crate::ln::types::{PaymentHash, PaymentPreimage, ChannelId};
3838
use crate::ln::msgs::DecodeError;
3939
use crate::ln::channel_keys::{DelayedPaymentKey, DelayedPaymentBasepoint, HtlcBasepoint, HtlcKey, RevocationKey, RevocationBasepoint};
4040
use crate::ln::chan_utils::{self,CommitmentTransaction, CounterpartyCommitmentSecrets, HTLCOutputInCommitment, HTLCClaim, ChannelTransactionParameters, HolderCommitmentTransaction, TxCreationKeys};
@@ -4811,7 +4811,7 @@ mod tests {
48114811
use crate::chain::package::{weight_offered_htlc, weight_received_htlc, weight_revoked_offered_htlc, weight_revoked_received_htlc, WEIGHT_REVOKED_OUTPUT};
48124812
use crate::chain::transaction::OutPoint;
48134813
use crate::sign::InMemorySigner;
4814-
use crate::ln::{PaymentPreimage, PaymentHash, ChannelId};
4814+
use crate::ln::types::{PaymentPreimage, PaymentHash, ChannelId};
48154815
use crate::ln::channel_keys::{DelayedPaymentBasepoint, DelayedPaymentKey, HtlcBasepoint, RevocationBasepoint, RevocationKey};
48164816
use crate::ln::chan_utils::{self,HTLCOutputInCommitment, ChannelPublicKeys, ChannelTransactionParameters, HolderCommitmentTransaction, CounterpartyChannelTransactionParameters};
48174817
use crate::ln::channelmanager::{PaymentSendFailure, PaymentId, RecipientOnionFields};

lightning/src/chain/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use bitcoin::network::constants::Network;
1717
use bitcoin::secp256k1::PublicKey;
1818

1919
use crate::chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, MonitorEvent};
20-
use crate::ln::ChannelId;
20+
use crate::ln::types::ChannelId;
2121
use crate::sign::ecdsa::WriteableEcdsaChannelSigner;
2222
use crate::chain::transaction::{OutPoint, TransactionData};
2323
use crate::impl_writeable_tlv_based;

lightning/src/chain/onchaintx.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use bitcoin::secp256k1;
2525
use crate::chain::chaininterface::compute_feerate_sat_per_1000_weight;
2626
use crate::sign::{ChannelDerivationParameters, HTLCDescriptor, ChannelSigner, EntropySource, SignerProvider, ecdsa::WriteableEcdsaChannelSigner};
2727
use crate::ln::msgs::DecodeError;
28-
use crate::ln::PaymentPreimage;
28+
use crate::ln::types::PaymentPreimage;
2929
use crate::ln::chan_utils::{self, ChannelTransactionParameters, HTLCOutputInCommitment, HolderCommitmentTransaction};
3030
use crate::chain::ClaimId;
3131
use crate::chain::chaininterface::{ConfirmationTarget, FeeEstimator, BroadcasterInterface, LowerBoundedFeeEstimator};

lightning/src/chain/package.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use bitcoin::hash_types::Txid;
2222
use bitcoin::secp256k1::{SecretKey,PublicKey};
2323
use bitcoin::sighash::EcdsaSighashType;
2424

25-
use crate::ln::PaymentPreimage;
25+
use crate::ln::types::PaymentPreimage;
2626
use crate::ln::chan_utils::{self, TxCreationKeys, HTLCOutputInCommitment};
2727
use crate::ln::features::ChannelTypeFeatures;
2828
use crate::ln::channel_keys::{DelayedPaymentBasepoint, HtlcBasepoint};
@@ -1195,7 +1195,7 @@ mod tests {
11951195
use crate::chain::package::{CounterpartyOfferedHTLCOutput, CounterpartyReceivedHTLCOutput, HolderHTLCOutput, PackageTemplate, PackageSolvingData, RevokedOutput, WEIGHT_REVOKED_OUTPUT, weight_offered_htlc, weight_received_htlc};
11961196
use crate::chain::Txid;
11971197
use crate::ln::chan_utils::HTLCOutputInCommitment;
1198-
use crate::ln::{PaymentPreimage, PaymentHash};
1198+
use crate::ln::types::{PaymentPreimage, PaymentHash};
11991199
use crate::ln::channel_keys::{DelayedPaymentBasepoint, HtlcBasepoint};
12001200

12011201
use bitcoin::blockdata::constants::WITNESS_SCALE_FACTOR;

lightning/src/chain/transaction.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl MaybeSignedTransaction {
8888
#[cfg(test)]
8989
mod tests {
9090
use crate::chain::transaction::OutPoint;
91-
use crate::ln::ChannelId;
91+
use crate::ln::types::ChannelId;
9292

9393
use bitcoin::blockdata::transaction::Transaction;
9494
use bitcoin::consensus::encode;

lightning/src/events/bump_transaction.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use crate::chain::chaininterface::{BroadcasterInterface, fee_for_weight};
1818
use crate::chain::ClaimId;
1919
use crate::io_extras::sink;
2020
use crate::ln::channel::ANCHOR_OUTPUT_VALUE_SATOSHI;
21-
use crate::ln::ChannelId;
21+
use crate::ln::types::ChannelId;
2222
use crate::ln::chan_utils;
2323
use crate::ln::chan_utils::{
2424
ANCHOR_INPUT_WITNESS_WEIGHT, HTLC_SUCCESS_INPUT_ANCHOR_WITNESS_WEIGHT,

lightning/src/events/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use crate::ln::channelmanager::{InterceptId, PaymentId, RecipientOnionFields};
2424
use crate::ln::channel::FUNDING_CONF_DEADLINE_BLOCKS;
2525
use crate::ln::features::ChannelTypeFeatures;
2626
use crate::ln::msgs;
27-
use crate::ln::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
27+
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
2828
use crate::chain::transaction;
2929
use crate::routing::gossip::NetworkUpdate;
3030
use crate::util::errors::APIError;

lightning/src/ln/blinded_payment_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
1111
use crate::blinded_path::BlindedPath;
1212
use crate::blinded_path::payment::{ForwardNode, ForwardTlvs, PaymentConstraints, PaymentContext, PaymentRelay, ReceiveTlvs};
1313
use crate::events::{Event, HTLCDestination, MessageSendEvent, MessageSendEventsProvider, PaymentFailureReason};
14-
use crate::ln::PaymentSecret;
14+
use crate::ln::types::PaymentSecret;
1515
use crate::ln::channelmanager;
1616
use crate::ln::channelmanager::{PaymentId, RecipientOnionFields};
1717
use crate::ln::features::BlindedHopFeatures;

lightning/src/ln/chan_utils.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use bitcoin::hash_types::{Txid, PubkeyHash, WPubkeyHash};
2525
use crate::chain::chaininterface::fee_for_weight;
2626
use crate::chain::package::WEIGHT_REVOKED_OUTPUT;
2727
use crate::sign::EntropySource;
28-
use crate::ln::{PaymentHash, PaymentPreimage};
28+
use crate::ln::types::{PaymentHash, PaymentPreimage};
2929
use crate::ln::msgs::DecodeError;
3030
use crate::util::ser::{Readable, RequiredWrapper, Writeable, Writer};
3131
use crate::util::transaction_utils;
@@ -1826,7 +1826,7 @@ mod tests {
18261826
use bitcoin::{Network, Txid, ScriptBuf};
18271827
use bitcoin::hashes::Hash;
18281828
use bitcoin::hashes::hex::FromHex;
1829-
use crate::ln::PaymentHash;
1829+
use crate::ln::types::PaymentHash;
18301830
use bitcoin::address::Payload;
18311831
use bitcoin::PublicKey as BitcoinPublicKey;
18321832
use crate::ln::features::ChannelTypeFeatures;

lightning/src/ln/chanmon_update_fail_tests.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ use crate::chain::{ChannelMonitorUpdateStatus, Listen, Watch};
2121
use crate::events::{Event, MessageSendEvent, MessageSendEventsProvider, PaymentPurpose, ClosureReason, HTLCDestination};
2222
use crate::ln::channelmanager::{RAACommitmentOrder, PaymentSendFailure, PaymentId, RecipientOnionFields};
2323
use crate::ln::channel::{AnnouncementSigsState, ChannelPhase};
24-
use crate::ln::{msgs, ChannelId};
24+
use crate::ln::msgs;
25+
use crate::ln::types::ChannelId;
2526
use crate::ln::msgs::{ChannelMessageHandler, RoutingMessageHandler};
2627
use crate::util::test_channel_signer::TestChannelSigner;
2728
use crate::util::errors::APIError;

lightning/src/ln/channel.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use bitcoin::secp256k1::{PublicKey,SecretKey};
2424
use bitcoin::secp256k1::{Secp256k1,ecdsa::Signature};
2525
use bitcoin::secp256k1;
2626

27-
use crate::ln::{ChannelId, PaymentPreimage, PaymentHash};
27+
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash};
2828
use crate::ln::features::{ChannelTypeFeatures, InitFeatures};
2929
use crate::ln::msgs;
3030
use crate::ln::msgs::DecodeError;
@@ -9338,7 +9338,7 @@ mod tests {
93389338
use bitcoin::blockdata::opcodes;
93399339
use bitcoin::network::constants::Network;
93409340
use crate::ln::onion_utils::INVALID_ONION_BLINDING;
9341-
use crate::ln::{PaymentHash, PaymentPreimage};
9341+
use crate::ln::types::{PaymentHash, PaymentPreimage};
93429342
use crate::ln::channel_keys::{RevocationKey, RevocationBasepoint};
93439343
use crate::ln::channelmanager::{self, HTLCSource, PaymentId};
93449344
use crate::ln::channel::InitFeatures;

lightning/src/ln/channelmanager.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ use crate::events;
4242
use crate::events::{Event, EventHandler, EventsProvider, MessageSendEvent, MessageSendEventsProvider, ClosureReason, HTLCDestination, PaymentFailureReason};
4343
// Since this struct is returned in `list_channels` methods, expose it here in case users want to
4444
// construct one themselves.
45-
use crate::ln::{inbound_payment, ChannelId, PaymentHash, PaymentPreimage, PaymentSecret};
45+
use crate::ln::inbound_payment;
46+
use crate::ln::types::{ChannelId, PaymentHash, PaymentPreimage, PaymentSecret};
4647
use crate::ln::channel::{self, Channel, ChannelPhase, ChannelContext, ChannelError, ChannelUpdateStatus, ShutdownResult, UnfundedChannelContext, UpdateFulfillCommitFetch, OutboundV1Channel, InboundV1Channel, WithChannelContext};
4748
pub use crate::ln::channel::{InboundHTLCDetails, InboundHTLCStateDetails, OutboundHTLCDetails, OutboundHTLCStateDetails};
4849
use crate::ln::features::{Bolt12InvoiceFeatures, ChannelFeatures, ChannelTypeFeatures, InitFeatures, NodeFeatures};
@@ -1387,7 +1388,7 @@ where
13871388
///
13881389
/// ```
13891390
/// # use bitcoin::secp256k1::PublicKey;
1390-
/// # use lightning::ln::ChannelId;
1391+
/// # use lightning::ln::types::ChannelId;
13911392
/// # use lightning::ln::channelmanager::AChannelManager;
13921393
/// # use lightning::events::{Event, EventsProvider};
13931394
/// #
@@ -1490,7 +1491,7 @@ where
14901491
///
14911492
/// ```
14921493
/// # use lightning::events::{Event, EventsProvider};
1493-
/// # use lightning::ln::PaymentHash;
1494+
/// # use lightning::ln::types::PaymentHash;
14941495
/// # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, RecipientOnionFields, Retry};
14951496
/// # use lightning::routing::router::RouteParameters;
14961497
/// #
@@ -12374,8 +12375,7 @@ mod tests {
1237412375
use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
1237512376
use core::sync::atomic::Ordering;
1237612377
use crate::events::{Event, HTLCDestination, MessageSendEvent, MessageSendEventsProvider, ClosureReason};
12377-
use crate::ln::{PaymentPreimage, PaymentHash, PaymentSecret};
12378-
use crate::ln::ChannelId;
12378+
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
1237912379
use crate::ln::channelmanager::{create_recv_pending_htlc_info, HTLCForwardInfo, inbound_payment, PaymentId, PaymentSendFailure, RecipientOnionFields, InterceptId};
1238012380
use crate::ln::functional_test_utils::*;
1238112381
use crate::ln::msgs::{self, ErrorAction};

lightning/src/ln/functional_test_utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::chain::channelmonitor::ChannelMonitor;
1515
use crate::chain::transaction::OutPoint;
1616
use crate::events::{ClaimedHTLC, ClosureReason, Event, HTLCDestination, MessageSendEvent, MessageSendEventsProvider, PathFailure, PaymentPurpose, PaymentFailureReason};
1717
use crate::events::bump_transaction::{BumpTransactionEvent, BumpTransactionEventHandler, Wallet, WalletSource};
18-
use crate::ln::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
18+
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
1919
use crate::ln::channelmanager::{AChannelManager, ChainParameters, ChannelManager, ChannelManagerReadArgs, RAACommitmentOrder, PaymentSendFailure, RecipientOnionFields, PaymentId, MIN_CLTV_EXPIRY_DELTA};
2020
use crate::ln::features::InitFeatures;
2121
use crate::ln::msgs;

lightning/src/ln/functional_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use crate::chain::channelmonitor::{CLOSED_CHANNEL_UPDATE_ID, CLTV_CLAIM_BUFFER,
1919
use crate::chain::transaction::OutPoint;
2020
use crate::sign::{ecdsa::EcdsaChannelSigner, EntropySource, OutputSpender, SignerProvider};
2121
use crate::events::{Event, MessageSendEvent, MessageSendEventsProvider, PathFailure, PaymentPurpose, ClosureReason, HTLCDestination, PaymentFailureReason};
22-
use crate::ln::{ChannelId, PaymentPreimage, PaymentSecret, PaymentHash};
22+
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentSecret, PaymentHash};
2323
use crate::ln::channel::{commitment_tx_base_weight, COMMITMENT_TX_WEIGHT_PER_HTLC, CONCURRENT_INBOUND_HTLC_FEE_BUFFER, FEE_SPIKE_BUFFER_FEE_INCREASE_MULTIPLE, MIN_AFFORDABLE_HTLC_COUNT, get_holder_selected_channel_reserve_satoshis, OutboundV1Channel, InboundV1Channel, COINBASE_MATURITY, ChannelPhase};
2424
use crate::ln::channelmanager::{self, PaymentId, RAACommitmentOrder, PaymentSendFailure, RecipientOnionFields, BREAKDOWN_TIMEOUT, ENABLE_GOSSIP_TICKS, DISABLE_GOSSIP_TICKS, MIN_CLTV_EXPIRY_DELTA};
2525
use crate::ln::channel::{DISCONNECT_PEER_AWAITING_RESPONSE_TICKS, ChannelError};

0 commit comments

Comments
 (0)