Skip to content

Commit 7dd20a9

Browse files
committed
Drop the Payment{Hash,Preimage,Secret} re-exports in lightning
These re-exports were deprecated in 0.0.124 in favor of the `lightning::types::payment::*` paths, which we use here.
1 parent 021887e commit 7dd20a9

36 files changed

+66
-55
lines changed

lightning-background-processor/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1092,13 +1092,14 @@ mod tests {
10921092
use lightning::ln::peer_handler::{
10931093
IgnoringMessageHandler, MessageHandler, PeerManager, SocketDescriptor,
10941094
};
1095-
use lightning::ln::types::{ChannelId, PaymentHash};
1095+
use lightning::ln::types::ChannelId;
10961096
use lightning::onion_message::messenger::{DefaultMessageRouter, OnionMessenger};
10971097
use lightning::routing::gossip::{NetworkGraph, P2PGossipSync};
10981098
use lightning::routing::router::{CandidateRouteHop, DefaultRouter, Path, RouteHop};
10991099
use lightning::routing::scoring::{ChannelUsage, LockableScore, ScoreLookUp, ScoreUpdate};
11001100
use lightning::sign::{ChangeDestinationSource, InMemorySigner, KeysManager};
11011101
use lightning::types::features::{ChannelFeatures, NodeFeatures};
1102+
use lightning::types::payment::PaymentHash;
11021103
use lightning::util::config::UserConfig;
11031104
use lightning::util::persist::{
11041105
KVStore, CHANNEL_MANAGER_PERSISTENCE_KEY, CHANNEL_MANAGER_PERSISTENCE_PRIMARY_NAMESPACE,

lightning/src/blinded_path/message.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ use crate::io;
2222
use crate::io::Cursor;
2323
use crate::ln::channelmanager::PaymentId;
2424
use crate::ln::msgs::DecodeError;
25-
use crate::ln::{PaymentHash, onion_utils};
25+
use crate::ln::onion_utils;
26+
use crate::types::payment::PaymentHash;
2627
use crate::offers::nonce::Nonce;
2728
use crate::onion_message::packet::ControlTlvs;
2829
use crate::routing::gossip::{NodeId, ReadOnlyNetworkGraph};

lightning/src/blinded_path/payment.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::blinded_path::utils;
1616
use crate::crypto::streams::ChaChaPolyReadAdapter;
1717
use crate::io;
1818
use crate::io::Cursor;
19-
use crate::ln::types::PaymentSecret;
19+
use crate::types::payment::PaymentSecret;
2020
use crate::ln::channel_state::CounterpartyForwardingInfo;
2121
use crate::types::features::BlindedHopFeatures;
2222
use crate::ln::msgs::DecodeError;
@@ -632,7 +632,7 @@ impl_writeable_tlv_based!(Bolt12RefundContext, {});
632632
mod tests {
633633
use bitcoin::secp256k1::PublicKey;
634634
use crate::blinded_path::payment::{PaymentForwardNode, ForwardTlvs, ReceiveTlvs, PaymentConstraints, PaymentContext, PaymentRelay};
635-
use crate::ln::types::PaymentSecret;
635+
use crate::types::payment::PaymentSecret;
636636
use crate::types::features::BlindedHopFeatures;
637637
use crate::ln::functional_test_utils::TEST_FINAL_CLTV;
638638

lightning/src/chain/channelmonitor.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ use bitcoin::ecdsa::Signature as BitcoinSignature;
3333
use bitcoin::secp256k1::{self, SecretKey, PublicKey, Secp256k1, ecdsa::Signature};
3434

3535
use crate::ln::channel::INITIAL_COMMITMENT_NUMBER;
36-
use crate::ln::types::{PaymentHash, PaymentPreimage, ChannelId};
36+
use crate::ln::types::ChannelId;
37+
use crate::types::payment::{PaymentHash, PaymentPreimage};
3738
use crate::ln::msgs::DecodeError;
3839
use crate::ln::channel_keys::{DelayedPaymentKey, DelayedPaymentBasepoint, HtlcBasepoint, HtlcKey, RevocationKey, RevocationBasepoint};
3940
use crate::ln::chan_utils::{self,CommitmentTransaction, CounterpartyCommitmentSecrets, HTLCOutputInCommitment, HTLCClaim, ChannelTransactionParameters, HolderCommitmentTransaction, TxCreationKeys};
@@ -5006,7 +5007,8 @@ mod tests {
50065007
use crate::chain::package::{weight_offered_htlc, weight_received_htlc, weight_revoked_offered_htlc, weight_revoked_received_htlc, WEIGHT_REVOKED_OUTPUT};
50075008
use crate::chain::transaction::OutPoint;
50085009
use crate::sign::InMemorySigner;
5009-
use crate::ln::types::{PaymentPreimage, PaymentHash, ChannelId};
5010+
use crate::ln::types::ChannelId;
5011+
use crate::types::payment::{PaymentPreimage, PaymentHash};
50105012
use crate::ln::channel_keys::{DelayedPaymentBasepoint, DelayedPaymentKey, HtlcBasepoint, RevocationBasepoint, RevocationKey};
50115013
use crate::ln::chan_utils::{self,HTLCOutputInCommitment, ChannelPublicKeys, ChannelTransactionParameters, HolderCommitmentTransaction, CounterpartyChannelTransactionParameters};
50125014
use crate::ln::channelmanager::{PaymentSendFailure, PaymentId, RecipientOnionFields};

lightning/src/chain/onchaintx.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use bitcoin::secp256k1;
2727
use crate::chain::chaininterface::{ConfirmationTarget, compute_feerate_sat_per_1000_weight};
2828
use crate::sign::{ChannelDerivationParameters, HTLCDescriptor, ChannelSigner, EntropySource, SignerProvider, ecdsa::EcdsaChannelSigner};
2929
use crate::ln::msgs::DecodeError;
30-
use crate::ln::types::PaymentPreimage;
30+
use crate::types::payment::PaymentPreimage;
3131
use crate::ln::chan_utils::{self, ChannelTransactionParameters, HTLCOutputInCommitment, HolderCommitmentTransaction};
3232
use crate::chain::ClaimId;
3333
use crate::chain::chaininterface::{FeeEstimator, BroadcasterInterface, LowerBoundedFeeEstimator};

lightning/src/chain/package.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use bitcoin::secp256k1::{SecretKey,PublicKey};
2424
use bitcoin::sighash::EcdsaSighashType;
2525
use bitcoin::transaction::Version;
2626

27-
use crate::ln::types::PaymentPreimage;
27+
use crate::types::payment::PaymentPreimage;
2828
use crate::ln::chan_utils::{self, TxCreationKeys, HTLCOutputInCommitment};
2929
use crate::types::features::ChannelTypeFeatures;
3030
use crate::ln::channel_keys::{DelayedPaymentBasepoint, HtlcBasepoint};
@@ -1199,7 +1199,7 @@ mod tests {
11991199
use crate::chain::package::{CounterpartyOfferedHTLCOutput, CounterpartyReceivedHTLCOutput, HolderHTLCOutput, PackageTemplate, PackageSolvingData, RevokedOutput, WEIGHT_REVOKED_OUTPUT, weight_offered_htlc, weight_received_htlc};
12001200
use crate::chain::Txid;
12011201
use crate::ln::chan_utils::HTLCOutputInCommitment;
1202-
use crate::ln::types::{PaymentPreimage, PaymentHash};
1202+
use crate::types::payment::{PaymentPreimage, PaymentHash};
12031203
use crate::ln::channel_keys::{DelayedPaymentBasepoint, HtlcBasepoint};
12041204

12051205
use bitcoin::amount::Amount;

lightning/src/events/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ use crate::ln::channelmanager::{InterceptId, PaymentId, RecipientOnionFields};
2525
use crate::ln::channel::FUNDING_CONF_DEADLINE_BLOCKS;
2626
use crate::types::features::ChannelTypeFeatures;
2727
use crate::ln::msgs;
28-
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
28+
use crate::ln::types::ChannelId;
29+
use crate::types::payment::{PaymentPreimage, PaymentHash, PaymentSecret};
2930
use crate::offers::invoice::Bolt12Invoice;
3031
use crate::onion_message::messenger::Responder;
3132
use crate::routing::gossip::NetworkUpdate;

lightning/src/ln/blinded_payment_tests.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ use bitcoin::secp256k1::ecdsa::{RecoverableSignature, Signature};
1414
use crate::blinded_path;
1515
use crate::blinded_path::payment::{BlindedPaymentPath, PaymentForwardNode, ForwardTlvs, PaymentConstraints, PaymentContext, PaymentRelay, ReceiveTlvs};
1616
use crate::events::{Event, HTLCDestination, MessageSendEvent, MessageSendEventsProvider, PaymentFailureReason};
17-
use crate::ln::types::{ChannelId, PaymentHash, PaymentSecret};
17+
use crate::ln::types::ChannelId;
18+
use crate::types::payment::{PaymentHash, PaymentSecret};
1819
use crate::ln::channelmanager;
1920
use crate::ln::channelmanager::{HTLCFailureMsg, PaymentId, RecipientOnionFields};
2021
use crate::types::features::{BlindedHopFeatures, ChannelFeatures, NodeFeatures};

lightning/src/ln/bolt11_payment.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ use bitcoin::hashes::Hash;
1313
use lightning_invoice::Bolt11Invoice;
1414

1515
use crate::ln::channelmanager::RecipientOnionFields;
16-
use crate::ln::types::PaymentHash;
1716
use crate::routing::router::{PaymentParameters, RouteParameters};
17+
use crate::types::payment::PaymentHash;
1818

1919
/// Builds the necessary parameters to pay or pre-flight probe the given zero-amount
2020
/// [`Bolt11Invoice`] using [`ChannelManager::send_payment`] or
@@ -87,8 +87,8 @@ fn params_from_invoice(
8787
#[cfg(test)]
8888
mod tests {
8989
use super::*;
90-
use crate::ln::types::PaymentSecret;
9190
use crate::routing::router::Payee;
91+
use crate::types::payment::PaymentSecret;
9292
use bitcoin::hashes::sha256::Hash as Sha256;
9393
use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
9494
use lightning_invoice::{Currency, InvoiceBuilder};

lightning/src/ln/chan_utils.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use bitcoin::hash_types::Txid;
2828
use crate::chain::chaininterface::fee_for_weight;
2929
use crate::chain::package::WEIGHT_REVOKED_OUTPUT;
3030
use crate::sign::EntropySource;
31-
use crate::ln::types::{PaymentHash, PaymentPreimage};
31+
use crate::types::payment::{PaymentHash, PaymentPreimage};
3232
use crate::ln::msgs::DecodeError;
3333
use crate::util::ser::{Readable, RequiredWrapper, Writeable, Writer};
3434
use crate::util::transaction_utils;
@@ -1901,7 +1901,7 @@ mod tests {
19011901
use bitcoin::{Network, Txid, ScriptBuf, CompressedPublicKey};
19021902
use bitcoin::hashes::Hash;
19031903
use bitcoin::hex::FromHex;
1904-
use crate::ln::types::PaymentHash;
1904+
use crate::types::payment::PaymentHash;
19051905
use bitcoin::PublicKey as BitcoinPublicKey;
19061906
use crate::types::features::ChannelTypeFeatures;
19071907

lightning/src/ln/channel.rs

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

28-
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash};
28+
use crate::ln::types::ChannelId;
29+
use crate::types::payment::{PaymentPreimage, PaymentHash};
2930
use crate::types::features::{ChannelTypeFeatures, InitFeatures};
3031
use crate::ln::msgs;
3132
use crate::ln::msgs::{ClosingSigned, ClosingSignedFeeRange, DecodeError};
@@ -9605,7 +9606,7 @@ mod tests {
96059606
use bitcoin::opcodes;
96069607
use bitcoin::network::Network;
96079608
use crate::ln::onion_utils::INVALID_ONION_BLINDING;
9608-
use crate::ln::types::{PaymentHash, PaymentPreimage};
9609+
use crate::types::payment::{PaymentHash, PaymentPreimage};
96099610
use crate::ln::channel_keys::{RevocationKey, RevocationBasepoint};
96109611
use crate::ln::channelmanager::{self, HTLCSource, PaymentId};
96119612
use crate::ln::channel::InitFeatures;

lightning/src/ln/channel_state.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ use crate::chain::transaction::OutPoint;
1818
use crate::io;
1919
use crate::ln::channel::ChannelContext;
2020
use crate::ln::msgs::DecodeError;
21-
use crate::ln::types::{ChannelId, PaymentHash};
21+
use crate::ln::types::ChannelId;
2222
use crate::sign::SignerProvider;
2323
use crate::types::features::{ChannelTypeFeatures, InitFeatures};
24+
use crate::types::payment::PaymentHash;
2425
use crate::util::config::ChannelConfig;
2526
use crate::util::ser::{Readable, Writeable, Writer};
2627

lightning/src/ln/channelmanager.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ use crate::events::{Event, EventHandler, EventsProvider, MessageSendEvent, Messa
4747
// Since this struct is returned in `list_channels` methods, expose it here in case users want to
4848
// construct one themselves.
4949
use crate::ln::inbound_payment;
50-
use crate::ln::types::{ChannelId, PaymentHash, PaymentPreimage, PaymentSecret};
50+
use crate::ln::types::ChannelId;
51+
use crate::types::payment::{PaymentHash, PaymentPreimage, PaymentSecret};
5152
use crate::ln::channel::{self, Channel, ChannelPhase, ChannelContext, ChannelError, ChannelUpdateStatus, ShutdownResult, UnfundedChannelContext, UpdateFulfillCommitFetch, OutboundV1Channel, InboundV1Channel, WithChannelContext};
5253
use crate::ln::channel_state::ChannelDetails;
5354
use crate::types::features::{Bolt12InvoiceFeatures, ChannelFeatures, ChannelTypeFeatures, InitFeatures, NodeFeatures};
@@ -1787,7 +1788,7 @@ where
17871788
///
17881789
/// ```
17891790
/// # use lightning::events::{Event, EventsProvider};
1790-
/// # use lightning::ln::types::PaymentHash;
1791+
/// # use lightning::types::payment::PaymentHash;
17911792
/// # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, RecipientOnionFields, Retry};
17921793
/// # use lightning::routing::router::RouteParameters;
17931794
/// #
@@ -13114,7 +13115,8 @@ mod tests {
1311413115
use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
1311513116
use core::sync::atomic::Ordering;
1311613117
use crate::events::{Event, HTLCDestination, MessageSendEvent, MessageSendEventsProvider, ClosureReason};
13117-
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
13118+
use crate::ln::types::ChannelId;
13119+
use crate::types::payment::{PaymentPreimage, PaymentHash, PaymentSecret};
1311813120
use crate::ln::channelmanager::{create_recv_pending_htlc_info, HTLCForwardInfo, inbound_payment, PaymentId, PaymentSendFailure, RecipientOnionFields, InterceptId};
1311913121
use crate::ln::functional_test_utils::*;
1312013122
use crate::ln::msgs::{self, ErrorAction};

lightning/src/ln/functional_test_utils.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ 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::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
18+
use crate::ln::types::ChannelId;
19+
use crate::types::payment::{PaymentPreimage, PaymentHash, PaymentSecret};
1920
use crate::ln::channelmanager::{AChannelManager, ChainParameters, ChannelManager, ChannelManagerReadArgs, RAACommitmentOrder, PaymentSendFailure, RecipientOnionFields, PaymentId, MIN_CLTV_EXPIRY_DELTA};
2021
use crate::types::features::InitFeatures;
2122
use crate::ln::msgs;

lightning/src/ln/functional_tests.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ 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, FundingInfo, MessageSendEvent, MessageSendEventsProvider, PathFailure, PaymentPurpose, ClosureReason, HTLCDestination, PaymentFailureReason};
22-
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentSecret, PaymentHash};
22+
use crate::ln::types::ChannelId;
23+
use crate::types::payment::{PaymentPreimage, PaymentSecret, PaymentHash};
2324
use crate::ln::channel::{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};
2425
use crate::ln::channelmanager::{self, PaymentId, RAACommitmentOrder, PaymentSendFailure, RecipientOnionFields, BREAKDOWN_TIMEOUT, ENABLE_GOSSIP_TICKS, DISABLE_GOSSIP_TICKS, MIN_CLTV_EXPIRY_DELTA};
2526
use crate::ln::channel::{DISCONNECT_PEER_AWAITING_RESPONSE_TICKS, ChannelError};

lightning/src/ln/inbound_payment.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use crate::crypto::chacha20::ChaCha20;
1818
use crate::crypto::utils::hkdf_extract_expand_5x;
1919
use crate::ln::msgs;
2020
use crate::ln::msgs::MAX_VALUE_MSAT;
21-
use crate::ln::types::{PaymentHash, PaymentPreimage, PaymentSecret};
21+
use crate::types::payment::{PaymentHash, PaymentPreimage, PaymentSecret};
2222
use crate::offers::nonce::Nonce;
2323
use crate::sign::{KeyMaterial, EntropySource};
2424
use crate::util::errors::APIError;

lightning/src/ln/invoice_utils.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use bitcoin::hashes::Hash;
99
use crate::chain;
1010
use crate::chain::chaininterface::{BroadcasterInterface, FeeEstimator};
1111
use crate::sign::{Recipient, NodeSigner, SignerProvider, EntropySource};
12-
use crate::ln::types::{PaymentHash, PaymentSecret};
12+
use crate::types::payment::{PaymentHash, PaymentSecret};
1313
use crate::ln::channel_state::ChannelDetails;
1414
use crate::ln::channelmanager::{ChannelManager, MIN_FINAL_CLTV_EXPIRY_DELTA};
1515
use crate::ln::channelmanager::{PhantomRouteHints, MIN_CLTV_EXPIRY_DELTA};
@@ -835,8 +835,7 @@ mod test {
835835
use bitcoin::hashes::sha256::Hash as Sha256;
836836
use crate::sign::PhantomKeysManager;
837837
use crate::events::{MessageSendEvent, MessageSendEventsProvider};
838-
use crate::ln::types::PaymentHash;
839-
use crate::ln::types::PaymentPreimage;
838+
use crate::types::payment::{PaymentHash, PaymentPreimage};
840839
use crate::ln::channelmanager::{PhantomRouteHints, MIN_FINAL_CLTV_EXPIRY_DELTA, PaymentId, RecipientOnionFields, Retry};
841840
use crate::ln::functional_test_utils::*;
842841
use crate::ln::msgs::ChannelMessageHandler;

lightning/src/ln/max_payment_path_len_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use bitcoin::secp256k1::{Secp256k1, PublicKey};
1414
use crate::blinded_path::BlindedHop;
1515
use crate::blinded_path::payment::{BlindedPayInfo, BlindedPaymentPath, PaymentConstraints, PaymentContext, ReceiveTlvs};
1616
use crate::events::{Event, MessageSendEventsProvider};
17-
use crate::ln::PaymentSecret;
17+
use crate::types::payment::PaymentSecret;
1818
use crate::ln::blinded_payment_tests::get_blinded_route_parameters;
1919
use crate::ln::channelmanager::PaymentId;
2020
use crate::types::features::BlindedHopFeatures;

lightning/src/ln/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ pub mod types;
3636
pub mod invoice_utils;
3737
pub mod bolt11_payment;
3838

39-
pub use lightning_types::payment::{PaymentHash, PaymentPreimage, PaymentSecret};
40-
4139
#[cfg(fuzzing)]
4240
pub mod peer_channel_encryptor;
4341
#[cfg(not(fuzzing))]

lightning/src/ln/msgs.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ use bitcoin::script::ScriptBuf;
3232
use bitcoin::hash_types::Txid;
3333

3434
use crate::blinded_path::payment::{BlindedPaymentTlvs, ForwardTlvs, ReceiveTlvs};
35-
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
35+
use crate::ln::types::ChannelId;
36+
use crate::types::payment::{PaymentPreimage, PaymentHash, PaymentSecret};
3637
use crate::types::features::{ChannelFeatures, ChannelTypeFeatures, InitFeatures, NodeFeatures};
3738
use crate::ln::onion_utils;
3839
use crate::onion_message;
@@ -1746,7 +1747,7 @@ pub struct FinalOnionHopData {
17461747
mod fuzzy_internal_msgs {
17471748
use bitcoin::secp256k1::PublicKey;
17481749
use crate::blinded_path::payment::{PaymentConstraints, PaymentContext, PaymentRelay};
1749-
use crate::ln::types::{PaymentPreimage, PaymentSecret};
1750+
use crate::types::payment::{PaymentPreimage, PaymentSecret};
17501751
use crate::types::features::BlindedHopFeatures;
17511752
use super::{FinalOnionHopData, TrampolineOnionPacket};
17521753

@@ -3298,7 +3299,8 @@ impl_writeable_msg!(GossipTimestampFilter, {
32983299
mod tests {
32993300
use bitcoin::{Amount, Transaction, TxIn, ScriptBuf, Sequence, Witness, TxOut};
33003301
use bitcoin::hex::DisplayHex;
3301-
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
3302+
use crate::ln::types::ChannelId;
3303+
use crate::types::payment::{PaymentPreimage, PaymentHash, PaymentSecret};
33023304
use crate::types::features::{ChannelFeatures, ChannelTypeFeatures, InitFeatures, NodeFeatures};
33033305
use crate::ln::msgs::{self, FinalOnionHopData, OnionErrorPacket, CommonOpenChannelFields, CommonAcceptChannelFields, TrampolineOnionPacket};
33043306
use crate::ln::msgs::SocketAddress;

lightning/src/ln/onion_payment.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use bitcoin::secp256k1::{self, PublicKey, Scalar, Secp256k1};
1111
use crate::blinded_path;
1212
use crate::blinded_path::payment::{PaymentConstraints, PaymentRelay};
1313
use crate::chain::channelmonitor::{HTLC_FAIL_BACK_BUFFER, LATENCY_GRACE_PERIOD_BLOCKS};
14-
use crate::ln::types::PaymentHash;
14+
use crate::types::payment::PaymentHash;
1515
use crate::ln::channelmanager::{BlindedFailure, BlindedForward, CLTV_FAR_FAR_AWAY, HTLCFailureMsg, MIN_CLTV_EXPIRY_DELTA, PendingHTLCInfo, PendingHTLCRouting};
1616
use crate::types::features::BlindedHopFeatures;
1717
use crate::ln::msgs;
@@ -508,7 +508,8 @@ mod tests {
508508
use bitcoin::hashes::Hash;
509509
use bitcoin::hashes::sha256::Hash as Sha256;
510510
use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
511-
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
511+
use crate::ln::types::ChannelId;
512+
use crate::types::payment::{PaymentPreimage, PaymentHash, PaymentSecret};
512513
use crate::ln::channelmanager::RecipientOnionFields;
513514
use crate::types::features::{ChannelFeatures, NodeFeatures};
514515
use crate::ln::msgs;

lightning/src/ln/onion_route_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use crate::chain::channelmonitor::{CLTV_CLAIM_BUFFER, LATENCY_GRACE_PERIOD_BLOCKS};
1515
use crate::sign::{EntropySource, NodeSigner, Recipient};
1616
use crate::events::{Event, HTLCDestination, MessageSendEvent, MessageSendEventsProvider, PathFailure, PaymentFailureReason};
17-
use crate::ln::types::{PaymentHash, PaymentSecret};
17+
use crate::types::payment::{PaymentHash, PaymentSecret};
1818
use crate::ln::channel::EXPIRE_PREV_CONFIG_TICKS;
1919
use crate::ln::channelmanager::{HTLCForwardInfo, FailureCode, CLTV_FAR_FAR_AWAY, DISABLE_GOSSIP_TICKS, MIN_CLTV_EXPIRY_DELTA, PendingAddHTLCInfo, PendingHTLCInfo, PendingHTLCRouting, PaymentId, RecipientOnionFields};
2020
use crate::ln::onion_utils;

lightning/src/ln/onion_utils.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ use crate::crypto::streams::ChaChaReader;
1313
use crate::ln::channel::TOTAL_BITCOIN_SUPPLY_SATOSHIS;
1414
use crate::ln::channelmanager::{HTLCSource, RecipientOnionFields};
1515
use crate::ln::msgs;
16-
use crate::ln::types::{PaymentHash, PaymentPreimage};
1716
use crate::routing::gossip::NetworkUpdate;
1817
use crate::routing::router::{Path, RouteHop, RouteParameters};
1918
use crate::sign::NodeSigner;
2019
use crate::types::features::{ChannelFeatures, NodeFeatures};
20+
use crate::types::payment::{PaymentHash, PaymentPreimage};
2121
use crate::util::errors::{self, APIError};
2222
use crate::util::logger::Logger;
2323
use crate::util::ser::{LengthCalculatingWriter, Readable, ReadableArgs, Writeable, Writer};
@@ -1271,9 +1271,9 @@ fn decode_next_hop<T, R: ReadableArgs<T>, N: NextPacketBytes>(
12711271
mod tests {
12721272
use crate::io;
12731273
use crate::ln::msgs;
1274-
use crate::ln::types::PaymentHash;
12751274
use crate::routing::router::{Path, Route, RouteHop};
12761275
use crate::types::features::{ChannelFeatures, NodeFeatures};
1276+
use crate::types::payment::PaymentHash;
12771277
use crate::util::ser::{VecWriter, Writeable, Writer};
12781278

12791279
#[allow(unused_imports)]

0 commit comments

Comments
 (0)