]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Drop the `Payment{Hash,Preimage,Secret}` re-exports in `lightning`
authorMatt Corallo <git@bluematt.me>
Sat, 12 Oct 2024 21:59:54 +0000 (21:59 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 15 Oct 2024 14:33:03 +0000 (14:33 +0000)
These re-exports were deprecated in 0.0.124 in favor of the
`lightning::types::payment::*` paths, which we use here.

41 files changed:
fuzz/src/chanmon_consistency.rs
fuzz/src/full_stack.rs
fuzz/src/invoice_request_deser.rs
fuzz/src/refund_deser.rs
lightning-background-processor/src/lib.rs
lightning/src/blinded_path/message.rs
lightning/src/blinded_path/payment.rs
lightning/src/chain/channelmonitor.rs
lightning/src/chain/onchaintx.rs
lightning/src/chain/package.rs
lightning/src/events/mod.rs
lightning/src/ln/blinded_payment_tests.rs
lightning/src/ln/bolt11_payment.rs
lightning/src/ln/chan_utils.rs
lightning/src/ln/channel.rs
lightning/src/ln/channel_state.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/functional_test_utils.rs
lightning/src/ln/functional_tests.rs
lightning/src/ln/inbound_payment.rs
lightning/src/ln/invoice_utils.rs
lightning/src/ln/max_payment_path_len_tests.rs
lightning/src/ln/mod.rs
lightning/src/ln/msgs.rs
lightning/src/ln/onion_payment.rs
lightning/src/ln/onion_route_tests.rs
lightning/src/ln/onion_utils.rs
lightning/src/ln/outbound_payment.rs
lightning/src/ln/payment_tests.rs
lightning/src/ln/types.rs
lightning/src/offers/invoice.rs
lightning/src/offers/invoice_request.rs
lightning/src/offers/refund.rs
lightning/src/offers/test_utils.rs
lightning/src/routing/router.rs
lightning/src/sign/ecdsa.rs
lightning/src/sign/mod.rs
lightning/src/sign/taproot.rs
lightning/src/util/logger.rs
lightning/src/util/ser.rs
lightning/src/util/test_channel_signer.rs

index 9616b6f54b975a8d60409697eba2c75961f88d49..f897ba6e0922c785593cbf2fa6cd6211f99fadf5 100644 (file)
@@ -55,7 +55,7 @@ use lightning::ln::msgs::{
        self, ChannelMessageHandler, CommitmentUpdate, DecodeError, Init, UpdateAddHTLC,
 };
 use lightning::ln::script::ShutdownScript;
-use lightning::ln::types::{ChannelId, PaymentHash, PaymentPreimage, PaymentSecret};
+use lightning::ln::types::ChannelId;
 use lightning::offers::invoice::UnsignedBolt12Invoice;
 use lightning::offers::invoice_request::UnsignedInvoiceRequest;
 use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessagePath};
@@ -63,6 +63,7 @@ use lightning::routing::router::{InFlightHtlcs, Path, Route, RouteHop, RoutePara
 use lightning::sign::{
        EntropySource, InMemorySigner, KeyMaterial, NodeSigner, Recipient, SignerProvider,
 };
+use lightning::types::payment::{PaymentHash, PaymentPreimage, PaymentSecret};
 use lightning::util::config::UserConfig;
 use lightning::util::errors::APIError;
 use lightning::util::hash_tables::*;
index 8ce17c93dbd19c1a525b4e18558130067e00edd2..59f1275a600d40d4f9e700af200652e4c71f29fc 100644 (file)
@@ -48,7 +48,7 @@ use lightning::ln::peer_handler::{
        IgnoringMessageHandler, MessageHandler, PeerManager, SocketDescriptor,
 };
 use lightning::ln::script::ShutdownScript;
-use lightning::ln::types::{ChannelId, PaymentHash, PaymentPreimage, PaymentSecret};
+use lightning::ln::types::ChannelId;
 use lightning::offers::invoice::UnsignedBolt12Invoice;
 use lightning::offers::invoice_request::UnsignedInvoiceRequest;
 use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessagePath};
@@ -60,6 +60,7 @@ use lightning::routing::utxo::UtxoLookup;
 use lightning::sign::{
        EntropySource, InMemorySigner, KeyMaterial, NodeSigner, Recipient, SignerProvider,
 };
+use lightning::types::payment::{PaymentHash, PaymentPreimage, PaymentSecret};
 use lightning::util::config::{ChannelConfig, UserConfig};
 use lightning::util::errors::APIError;
 use lightning::util::hash_tables::*;
index 2bebb02333bd99b369a2f33eca281fad7f30a1f5..aa3c006abdd8352fe0941f3195c98dc58e7729b1 100644 (file)
@@ -15,14 +15,13 @@ use lightning::blinded_path::payment::{
        PaymentForwardNode, PaymentRelay, ReceiveTlvs,
 };
 use lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA;
-use lightning::ln::types::PaymentSecret;
-use lightning::ln::PaymentHash;
 use lightning::offers::invoice::UnsignedBolt12Invoice;
 use lightning::offers::invoice_request::{InvoiceRequest, InvoiceRequestFields};
 use lightning::offers::offer::OfferId;
 use lightning::offers::parse::Bolt12SemanticError;
 use lightning::sign::EntropySource;
 use lightning::types::features::BlindedHopFeatures;
+use lightning::types::payment::{PaymentHash, PaymentSecret};
 use lightning::util::ser::Writeable;
 use lightning::util::string::UntrustedString;
 
index 148a59fdd8d5e87c37f67b84f0bd39b89fa568bd..d8d9881ef974594cb38f90bcc1b31874ba2ebbe6 100644 (file)
@@ -15,13 +15,12 @@ use lightning::blinded_path::payment::{
        PaymentForwardNode, PaymentRelay, ReceiveTlvs,
 };
 use lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA;
-use lightning::ln::types::PaymentSecret;
-use lightning::ln::PaymentHash;
 use lightning::offers::invoice::UnsignedBolt12Invoice;
 use lightning::offers::parse::Bolt12SemanticError;
 use lightning::offers::refund::Refund;
 use lightning::sign::EntropySource;
 use lightning::types::features::BlindedHopFeatures;
+use lightning::types::payment::{PaymentHash, PaymentSecret};
 use lightning::util::ser::Writeable;
 
 #[inline]
index cea975fb00f6ebebc42d763de646a96065cc5ff3..66cd0260d726c86828159c3b3a08977132e9184b 100644 (file)
@@ -1092,13 +1092,14 @@ mod tests {
        use lightning::ln::peer_handler::{
                IgnoringMessageHandler, MessageHandler, PeerManager, SocketDescriptor,
        };
-       use lightning::ln::types::{ChannelId, PaymentHash};
+       use lightning::ln::types::ChannelId;
        use lightning::onion_message::messenger::{DefaultMessageRouter, OnionMessenger};
        use lightning::routing::gossip::{NetworkGraph, P2PGossipSync};
        use lightning::routing::router::{CandidateRouteHop, DefaultRouter, Path, RouteHop};
        use lightning::routing::scoring::{ChannelUsage, LockableScore, ScoreLookUp, ScoreUpdate};
        use lightning::sign::{ChangeDestinationSource, InMemorySigner, KeysManager};
        use lightning::types::features::{ChannelFeatures, NodeFeatures};
+       use lightning::types::payment::PaymentHash;
        use lightning::util::config::UserConfig;
        use lightning::util::persist::{
                KVStore, CHANNEL_MANAGER_PERSISTENCE_KEY, CHANNEL_MANAGER_PERSISTENCE_PRIMARY_NAMESPACE,
index 2cad33887f41feb9ce699b297378a34db038f56b..4d96434dd636cd50724d064bb70a80981e4637ae 100644 (file)
@@ -22,7 +22,8 @@ use crate::io;
 use crate::io::Cursor;
 use crate::ln::channelmanager::PaymentId;
 use crate::ln::msgs::DecodeError;
-use crate::ln::{PaymentHash, onion_utils};
+use crate::ln::onion_utils;
+use crate::types::payment::PaymentHash;
 use crate::offers::nonce::Nonce;
 use crate::onion_message::packet::ControlTlvs;
 use crate::routing::gossip::{NodeId, ReadOnlyNetworkGraph};
index 69ee5ce4b3b2e6cb2a5891d9221241a9a9d53027..62ce7dec1864a1b356c3a406f950e7e0d5c699ce 100644 (file)
@@ -16,7 +16,7 @@ use crate::blinded_path::utils;
 use crate::crypto::streams::ChaChaPolyReadAdapter;
 use crate::io;
 use crate::io::Cursor;
-use crate::ln::types::PaymentSecret;
+use crate::types::payment::PaymentSecret;
 use crate::ln::channel_state::CounterpartyForwardingInfo;
 use crate::types::features::BlindedHopFeatures;
 use crate::ln::msgs::DecodeError;
@@ -632,7 +632,7 @@ impl_writeable_tlv_based!(Bolt12RefundContext, {});
 mod tests {
        use bitcoin::secp256k1::PublicKey;
        use crate::blinded_path::payment::{PaymentForwardNode, ForwardTlvs, ReceiveTlvs, PaymentConstraints, PaymentContext, PaymentRelay};
-       use crate::ln::types::PaymentSecret;
+       use crate::types::payment::PaymentSecret;
        use crate::types::features::BlindedHopFeatures;
        use crate::ln::functional_test_utils::TEST_FINAL_CLTV;
 
index b0ac1a34c6cc0f48e3e931d8cdbaed61ccab766e..7449d15381fa354767dc5c1876d3acb8c10dd579 100644 (file)
@@ -33,7 +33,8 @@ use bitcoin::ecdsa::Signature as BitcoinSignature;
 use bitcoin::secp256k1::{self, SecretKey, PublicKey, Secp256k1, ecdsa::Signature};
 
 use crate::ln::channel::INITIAL_COMMITMENT_NUMBER;
-use crate::ln::types::{PaymentHash, PaymentPreimage, ChannelId};
+use crate::ln::types::ChannelId;
+use crate::types::payment::{PaymentHash, PaymentPreimage};
 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};
@@ -5006,7 +5007,8 @@ 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::types::{PaymentPreimage, PaymentHash, ChannelId};
+       use crate::ln::types::ChannelId;
+       use crate::types::payment::{PaymentPreimage, PaymentHash};
        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};
index 56b34818a9074743174465f703084962d74d9f9c..fb842a39ddefdc8850d161181e51d34ac5a5683d 100644 (file)
@@ -27,7 +27,7 @@ use bitcoin::secp256k1;
 use crate::chain::chaininterface::{ConfirmationTarget, compute_feerate_sat_per_1000_weight};
 use crate::sign::{ChannelDerivationParameters, HTLCDescriptor, ChannelSigner, EntropySource, SignerProvider, ecdsa::EcdsaChannelSigner};
 use crate::ln::msgs::DecodeError;
-use crate::ln::types::PaymentPreimage;
+use crate::types::payment::PaymentPreimage;
 use crate::ln::chan_utils::{self, ChannelTransactionParameters, HTLCOutputInCommitment, HolderCommitmentTransaction};
 use crate::chain::ClaimId;
 use crate::chain::chaininterface::{FeeEstimator, BroadcasterInterface, LowerBoundedFeeEstimator};
index 1ab124b8ccc6a286dd5ca166af5109447d5ffb80..1b96acd6772aef403e9b9ce7f1a4ed2e0344c7c8 100644 (file)
@@ -24,7 +24,7 @@ use bitcoin::secp256k1::{SecretKey,PublicKey};
 use bitcoin::sighash::EcdsaSighashType;
 use bitcoin::transaction::Version;
 
-use crate::ln::types::PaymentPreimage;
+use crate::types::payment::PaymentPreimage;
 use crate::ln::chan_utils::{self, TxCreationKeys, HTLCOutputInCommitment};
 use crate::types::features::ChannelTypeFeatures;
 use crate::ln::channel_keys::{DelayedPaymentBasepoint, HtlcBasepoint};
@@ -1199,7 +1199,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::types::{PaymentPreimage, PaymentHash};
+       use crate::types::payment::{PaymentPreimage, PaymentHash};
        use crate::ln::channel_keys::{DelayedPaymentBasepoint, HtlcBasepoint};
 
        use bitcoin::amount::Amount;
index 56c7362093cd71bfa6ff7291e1a753c25addd8cf..c450c1d91cd9a958ce65dff5bbd65239c6a1898f 100644 (file)
@@ -25,7 +25,8 @@ use crate::ln::channelmanager::{InterceptId, PaymentId, RecipientOnionFields};
 use crate::ln::channel::FUNDING_CONF_DEADLINE_BLOCKS;
 use crate::types::features::ChannelTypeFeatures;
 use crate::ln::msgs;
-use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
+use crate::ln::types::ChannelId;
+use crate::types::payment::{PaymentPreimage, PaymentHash, PaymentSecret};
 use crate::offers::invoice::Bolt12Invoice;
 use crate::onion_message::messenger::Responder;
 use crate::routing::gossip::NetworkUpdate;
index fe2e8060fea763631c2a760e3f55989b088ed1f0..79b24e06db39b8e954ecb2b158ddf4e5c2ee28b1 100644 (file)
@@ -14,7 +14,8 @@ use bitcoin::secp256k1::ecdsa::{RecoverableSignature, Signature};
 use crate::blinded_path;
 use crate::blinded_path::payment::{BlindedPaymentPath, PaymentForwardNode, ForwardTlvs, PaymentConstraints, PaymentContext, PaymentRelay, ReceiveTlvs};
 use crate::events::{Event, HTLCDestination, MessageSendEvent, MessageSendEventsProvider, PaymentFailureReason};
-use crate::ln::types::{ChannelId, PaymentHash, PaymentSecret};
+use crate::ln::types::ChannelId;
+use crate::types::payment::{PaymentHash, PaymentSecret};
 use crate::ln::channelmanager;
 use crate::ln::channelmanager::{HTLCFailureMsg, PaymentId, RecipientOnionFields};
 use crate::types::features::{BlindedHopFeatures, ChannelFeatures, NodeFeatures};
index 13840dc05d742c3e99acf529baadceb0757d2318..2f2e60f12b507cdd53f7f321a742c72c13dc4466 100644 (file)
@@ -13,8 +13,8 @@ use bitcoin::hashes::Hash;
 use lightning_invoice::Bolt11Invoice;
 
 use crate::ln::channelmanager::RecipientOnionFields;
-use crate::ln::types::PaymentHash;
 use crate::routing::router::{PaymentParameters, RouteParameters};
+use crate::types::payment::PaymentHash;
 
 /// Builds the necessary parameters to pay or pre-flight probe the given zero-amount
 /// [`Bolt11Invoice`] using [`ChannelManager::send_payment`] or
@@ -87,8 +87,8 @@ fn params_from_invoice(
 #[cfg(test)]
 mod tests {
        use super::*;
-       use crate::ln::types::PaymentSecret;
        use crate::routing::router::Payee;
+       use crate::types::payment::PaymentSecret;
        use bitcoin::hashes::sha256::Hash as Sha256;
        use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
        use lightning_invoice::{Currency, InvoiceBuilder};
index 7cd58c087713b169b2abaaf9c9cb03695cb723e8..ae76308f0ceffbf42f9e362d9e2b0e9e09189dfd 100644 (file)
@@ -28,7 +28,7 @@ use bitcoin::hash_types::Txid;
 use crate::chain::chaininterface::fee_for_weight;
 use crate::chain::package::WEIGHT_REVOKED_OUTPUT;
 use crate::sign::EntropySource;
-use crate::ln::types::{PaymentHash, PaymentPreimage};
+use crate::types::payment::{PaymentHash, PaymentPreimage};
 use crate::ln::msgs::DecodeError;
 use crate::util::ser::{Readable, RequiredWrapper, Writeable, Writer};
 use crate::util::transaction_utils;
@@ -1901,7 +1901,7 @@ mod tests {
        use bitcoin::{Network, Txid, ScriptBuf, CompressedPublicKey};
        use bitcoin::hashes::Hash;
        use bitcoin::hex::FromHex;
-       use crate::ln::types::PaymentHash;
+       use crate::types::payment::PaymentHash;
        use bitcoin::PublicKey as BitcoinPublicKey;
        use crate::types::features::ChannelTypeFeatures;
 
index 0122106f6844aa3e16d399ca4eb037bc9725439d..7b7cfb446b9becd83f4db126819948179bf810cf 100644 (file)
@@ -25,7 +25,8 @@ use bitcoin::secp256k1::{PublicKey,SecretKey};
 use bitcoin::secp256k1::{Secp256k1,ecdsa::Signature};
 use bitcoin::secp256k1;
 
-use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash};
+use crate::ln::types::ChannelId;
+use crate::types::payment::{PaymentPreimage, PaymentHash};
 use crate::types::features::{ChannelTypeFeatures, InitFeatures};
 use crate::ln::msgs;
 use crate::ln::msgs::{ClosingSigned, ClosingSignedFeeRange, DecodeError};
@@ -9605,7 +9606,7 @@ mod tests {
        use bitcoin::opcodes;
        use bitcoin::network::Network;
        use crate::ln::onion_utils::INVALID_ONION_BLINDING;
-       use crate::ln::types::{PaymentHash, PaymentPreimage};
+       use crate::types::payment::{PaymentHash, PaymentPreimage};
        use crate::ln::channel_keys::{RevocationKey, RevocationBasepoint};
        use crate::ln::channelmanager::{self, HTLCSource, PaymentId};
        use crate::ln::channel::InitFeatures;
@@ -10293,7 +10294,7 @@ mod tests {
                use bitcoin::hex::DisplayHex;
                use bitcoin::secp256k1::Message;
                use crate::sign::{ChannelDerivationParameters, HTLCDescriptor, ecdsa::EcdsaChannelSigner};
-               use crate::ln::PaymentPreimage;
+               use crate::types::payment::PaymentPreimage;
                use crate::ln::channel::{HTLCOutputInCommitment ,TxCreationKeys};
                use crate::ln::channel_keys::{DelayedPaymentBasepoint, HtlcBasepoint};
                use crate::ln::chan_utils::{ChannelPublicKeys, HolderCommitmentTransaction, CounterpartyChannelTransactionParameters};
index 36e8687924ccf8a2ffcc785ae20595db39b1bc10..9945bba885c5eaa3a166cbf172650c6b1c89d513 100644 (file)
@@ -18,9 +18,10 @@ use crate::chain::transaction::OutPoint;
 use crate::io;
 use crate::ln::channel::ChannelContext;
 use crate::ln::msgs::DecodeError;
-use crate::ln::types::{ChannelId, PaymentHash};
+use crate::ln::types::ChannelId;
 use crate::sign::SignerProvider;
 use crate::types::features::{ChannelTypeFeatures, InitFeatures};
+use crate::types::payment::PaymentHash;
 use crate::util::config::ChannelConfig;
 use crate::util::ser::{Readable, Writeable, Writer};
 
index 0ffab3bfed0e91138ba3c38de9b76cdeafa237e9..aa903d9b38a497d2b169645d2a05c9915e65951a 100644 (file)
@@ -47,7 +47,8 @@ use crate::events::{Event, EventHandler, EventsProvider, MessageSendEvent, Messa
 // Since this struct is returned in `list_channels` methods, expose it here in case users want to
 // construct one themselves.
 use crate::ln::inbound_payment;
-use crate::ln::types::{ChannelId, PaymentHash, PaymentPreimage, PaymentSecret};
+use crate::ln::types::ChannelId;
+use crate::types::payment::{PaymentHash, PaymentPreimage, PaymentSecret};
 use crate::ln::channel::{self, Channel, ChannelPhase, ChannelContext, ChannelError, ChannelUpdateStatus, ShutdownResult, UnfundedChannelContext, UpdateFulfillCommitFetch, OutboundV1Channel, InboundV1Channel, WithChannelContext};
 use crate::ln::channel_state::ChannelDetails;
 use crate::types::features::{Bolt12InvoiceFeatures, ChannelFeatures, ChannelTypeFeatures, InitFeatures, NodeFeatures};
@@ -1787,7 +1788,7 @@ where
 ///
 /// ```
 /// # use lightning::events::{Event, EventsProvider};
-/// # use lightning::ln::types::PaymentHash;
+/// # use lightning::types::payment::PaymentHash;
 /// # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, RecipientOnionFields, Retry};
 /// # use lightning::routing::router::RouteParameters;
 /// #
@@ -13114,7 +13115,8 @@ mod tests {
        use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
        use core::sync::atomic::Ordering;
        use crate::events::{Event, HTLCDestination, MessageSendEvent, MessageSendEventsProvider, ClosureReason};
-       use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
+       use crate::ln::types::ChannelId;
+       use crate::types::payment::{PaymentPreimage, PaymentHash, PaymentSecret};
        use crate::ln::channelmanager::{create_recv_pending_htlc_info, HTLCForwardInfo, inbound_payment, PaymentId, PaymentSendFailure, RecipientOnionFields, InterceptId};
        use crate::ln::functional_test_utils::*;
        use crate::ln::msgs::{self, ErrorAction};
index 1643be848f9c7d8aee84a4d9384fa62391daf059..70c64fd2192df8805f9117e2c55809beb58c41a6 100644 (file)
@@ -15,7 +15,8 @@ use crate::chain::channelmonitor::ChannelMonitor;
 use crate::chain::transaction::OutPoint;
 use crate::events::{ClaimedHTLC, ClosureReason, Event, HTLCDestination, MessageSendEvent, MessageSendEventsProvider, PathFailure, PaymentPurpose, PaymentFailureReason};
 use crate::events::bump_transaction::{BumpTransactionEvent, BumpTransactionEventHandler, Wallet, WalletSource};
-use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
+use crate::ln::types::ChannelId;
+use crate::types::payment::{PaymentPreimage, PaymentHash, PaymentSecret};
 use crate::ln::channelmanager::{AChannelManager, ChainParameters, ChannelManager, ChannelManagerReadArgs, RAACommitmentOrder, PaymentSendFailure, RecipientOnionFields, PaymentId, MIN_CLTV_EXPIRY_DELTA};
 use crate::types::features::InitFeatures;
 use crate::ln::msgs;
index 62885409d9f46ba024b6f9dd83a1e6408576ced9..d917ff29ab6674d5f8b80888df4499246875a758 100644 (file)
@@ -19,7 +19,8 @@ use crate::chain::channelmonitor::{CLOSED_CHANNEL_UPDATE_ID, CLTV_CLAIM_BUFFER,
 use crate::chain::transaction::OutPoint;
 use crate::sign::{ecdsa::EcdsaChannelSigner, EntropySource, OutputSpender, SignerProvider};
 use crate::events::{Event, FundingInfo, MessageSendEvent, MessageSendEventsProvider, PathFailure, PaymentPurpose, ClosureReason, HTLCDestination, PaymentFailureReason};
-use crate::ln::types::{ChannelId, PaymentPreimage, PaymentSecret, PaymentHash};
+use crate::ln::types::ChannelId;
+use crate::types::payment::{PaymentPreimage, PaymentSecret, PaymentHash};
 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};
 use crate::ln::channelmanager::{self, PaymentId, RAACommitmentOrder, PaymentSendFailure, RecipientOnionFields, BREAKDOWN_TIMEOUT, ENABLE_GOSSIP_TICKS, DISABLE_GOSSIP_TICKS, MIN_CLTV_EXPIRY_DELTA};
 use crate::ln::channel::{DISCONNECT_PEER_AWAITING_RESPONSE_TICKS, ChannelError};
index 0ae260a50861ef8683ed0f4e257c7e80dff3700e..e294dcbcf2409c6598522edc8e661a9aed30ffb5 100644 (file)
@@ -18,7 +18,7 @@ use crate::crypto::chacha20::ChaCha20;
 use crate::crypto::utils::hkdf_extract_expand_5x;
 use crate::ln::msgs;
 use crate::ln::msgs::MAX_VALUE_MSAT;
-use crate::ln::types::{PaymentHash, PaymentPreimage, PaymentSecret};
+use crate::types::payment::{PaymentHash, PaymentPreimage, PaymentSecret};
 use crate::offers::nonce::Nonce;
 use crate::sign::{KeyMaterial, EntropySource};
 use crate::util::errors::APIError;
index 4c7e347dab11f4456b19817a922f6910ce0cd3ba..b9d1c45bc1e0ebe9d31f06e831a429af3c572f68 100644 (file)
@@ -9,7 +9,7 @@ use bitcoin::hashes::Hash;
 use crate::chain;
 use crate::chain::chaininterface::{BroadcasterInterface, FeeEstimator};
 use crate::sign::{Recipient, NodeSigner, SignerProvider, EntropySource};
-use crate::ln::types::{PaymentHash, PaymentSecret};
+use crate::types::payment::{PaymentHash, PaymentSecret};
 use crate::ln::channel_state::ChannelDetails;
 use crate::ln::channelmanager::{ChannelManager, MIN_FINAL_CLTV_EXPIRY_DELTA};
 use crate::ln::channelmanager::{PhantomRouteHints, MIN_CLTV_EXPIRY_DELTA};
@@ -835,8 +835,7 @@ mod test {
        use bitcoin::hashes::sha256::Hash as Sha256;
        use crate::sign::PhantomKeysManager;
        use crate::events::{MessageSendEvent, MessageSendEventsProvider};
-       use crate::ln::types::PaymentHash;
-       use crate::ln::types::PaymentPreimage;
+       use crate::types::payment::{PaymentHash, PaymentPreimage};
        use crate::ln::channelmanager::{PhantomRouteHints, MIN_FINAL_CLTV_EXPIRY_DELTA, PaymentId, RecipientOnionFields, Retry};
        use crate::ln::functional_test_utils::*;
        use crate::ln::msgs::ChannelMessageHandler;
index a6252fd2b1f6250e4f3546872f18fd413b7e931b..8c24ef363397573dfc332bc6a35b8263e7a63daa 100644 (file)
@@ -14,7 +14,7 @@ use bitcoin::secp256k1::{Secp256k1, PublicKey};
 use crate::blinded_path::BlindedHop;
 use crate::blinded_path::payment::{BlindedPayInfo, BlindedPaymentPath, PaymentConstraints, PaymentContext, ReceiveTlvs};
 use crate::events::{Event, MessageSendEventsProvider};
-use crate::ln::PaymentSecret;
+use crate::types::payment::PaymentSecret;
 use crate::ln::blinded_payment_tests::get_blinded_route_parameters;
 use crate::ln::channelmanager::PaymentId;
 use crate::types::features::BlindedHopFeatures;
index dceb52ab4ae865777ea1dddd674a9fd84e93b945..90571b0d89f609d31418f8e250913a7ba8643b87 100644 (file)
@@ -8,12 +8,6 @@
 // licenses.
 
 //! Implementations of various parts of the Lightning protocol are in this module.
-//!
-//! Note that the re-exports of [`PaymentHash`], [`PaymentPreimage`], and [`PaymentSecret`] here
-//! are deprecated and will be removed in a future version. Instead, use them via
-//! [`lightning::types::payment`].
-//!
-//! [`lightning::types::payment`]: crate::types::payment
 
 #[cfg(any(test, feature = "_test_utils"))]
 #[macro_use]
@@ -36,8 +30,6 @@ pub mod types;
 pub mod invoice_utils;
 pub mod bolt11_payment;
 
-pub use lightning_types::payment::{PaymentHash, PaymentPreimage, PaymentSecret};
-
 #[cfg(fuzzing)]
 pub mod peer_channel_encryptor;
 #[cfg(not(fuzzing))]
index 39c998092f870e7d3a76a39761b35e752c9f6104..9d1269c56d6752b089b086e8afa94d1e1b35d11f 100644 (file)
@@ -32,7 +32,8 @@ use bitcoin::script::ScriptBuf;
 use bitcoin::hash_types::Txid;
 
 use crate::blinded_path::payment::{BlindedPaymentTlvs, ForwardTlvs, ReceiveTlvs};
-use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
+use crate::ln::types::ChannelId;
+use crate::types::payment::{PaymentPreimage, PaymentHash, PaymentSecret};
 use crate::types::features::{ChannelFeatures, ChannelTypeFeatures, InitFeatures, NodeFeatures};
 use crate::ln::onion_utils;
 use crate::onion_message;
@@ -1746,7 +1747,7 @@ pub struct FinalOnionHopData {
 mod fuzzy_internal_msgs {
        use bitcoin::secp256k1::PublicKey;
        use crate::blinded_path::payment::{PaymentConstraints, PaymentContext, PaymentRelay};
-       use crate::ln::types::{PaymentPreimage, PaymentSecret};
+       use crate::types::payment::{PaymentPreimage, PaymentSecret};
        use crate::types::features::BlindedHopFeatures;
        use super::{FinalOnionHopData, TrampolineOnionPacket};
 
@@ -3298,7 +3299,8 @@ impl_writeable_msg!(GossipTimestampFilter, {
 mod tests {
        use bitcoin::{Amount, Transaction, TxIn, ScriptBuf, Sequence, Witness, TxOut};
        use bitcoin::hex::DisplayHex;
-       use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
+       use crate::ln::types::ChannelId;
+       use crate::types::payment::{PaymentPreimage, PaymentHash, PaymentSecret};
        use crate::types::features::{ChannelFeatures, ChannelTypeFeatures, InitFeatures, NodeFeatures};
        use crate::ln::msgs::{self, FinalOnionHopData, OnionErrorPacket, CommonOpenChannelFields, CommonAcceptChannelFields, TrampolineOnionPacket};
        use crate::ln::msgs::SocketAddress;
index 45783466211eb9992ef00fe6105a7a566bbb1f63..528b5e7d8865a6c7627eec82d52cd28f607e04de 100644 (file)
@@ -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::ln::types::PaymentHash;
+use crate::types::payment::PaymentHash;
 use crate::ln::channelmanager::{BlindedFailure, BlindedForward, CLTV_FAR_FAR_AWAY, HTLCFailureMsg, MIN_CLTV_EXPIRY_DELTA, PendingHTLCInfo, PendingHTLCRouting};
 use crate::types::features::BlindedHopFeatures;
 use crate::ln::msgs;
@@ -508,7 +508,8 @@ mod tests {
        use bitcoin::hashes::Hash;
        use bitcoin::hashes::sha256::Hash as Sha256;
        use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
-       use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
+       use crate::ln::types::ChannelId;
+       use crate::types::payment::{PaymentPreimage, PaymentHash, PaymentSecret};
        use crate::ln::channelmanager::RecipientOnionFields;
        use crate::types::features::{ChannelFeatures, NodeFeatures};
        use crate::ln::msgs;
index cad01262660af27015df0255d7bf9fbcd8215f32..c0253166d991e14944db07372debd322a1b4ee05 100644 (file)
@@ -14,7 +14,7 @@
 use crate::chain::channelmonitor::{CLTV_CLAIM_BUFFER, LATENCY_GRACE_PERIOD_BLOCKS};
 use crate::sign::{EntropySource, NodeSigner, Recipient};
 use crate::events::{Event, HTLCDestination, MessageSendEvent, MessageSendEventsProvider, PathFailure, PaymentFailureReason};
-use crate::ln::types::{PaymentHash, PaymentSecret};
+use crate::types::payment::{PaymentHash, PaymentSecret};
 use crate::ln::channel::EXPIRE_PREV_CONFIG_TICKS;
 use crate::ln::channelmanager::{HTLCForwardInfo, FailureCode, CLTV_FAR_FAR_AWAY, DISABLE_GOSSIP_TICKS, MIN_CLTV_EXPIRY_DELTA, PendingAddHTLCInfo, PendingHTLCInfo, PendingHTLCRouting, PaymentId, RecipientOnionFields};
 use crate::ln::onion_utils;
index 33eec9dff0b630ef76a2ac82e17a061a8929a696..208096c128e2e2c554da8a8543b64ad2e7368677 100644 (file)
@@ -13,11 +13,11 @@ use crate::crypto::streams::ChaChaReader;
 use crate::ln::channel::TOTAL_BITCOIN_SUPPLY_SATOSHIS;
 use crate::ln::channelmanager::{HTLCSource, RecipientOnionFields};
 use crate::ln::msgs;
-use crate::ln::types::{PaymentHash, PaymentPreimage};
 use crate::routing::gossip::NetworkUpdate;
 use crate::routing::router::{Path, RouteHop, RouteParameters};
 use crate::sign::NodeSigner;
 use crate::types::features::{ChannelFeatures, NodeFeatures};
+use crate::types::payment::{PaymentHash, PaymentPreimage};
 use crate::util::errors::{self, APIError};
 use crate::util::logger::Logger;
 use crate::util::ser::{LengthCalculatingWriter, Readable, ReadableArgs, Writeable, Writer};
@@ -1271,9 +1271,9 @@ fn decode_next_hop<T, R: ReadableArgs<T>, N: NextPacketBytes>(
 mod tests {
        use crate::io;
        use crate::ln::msgs;
-       use crate::ln::types::PaymentHash;
        use crate::routing::router::{Path, Route, RouteHop};
        use crate::types::features::{ChannelFeatures, NodeFeatures};
+       use crate::types::payment::PaymentHash;
        use crate::util::ser::{VecWriter, Writeable, Writer};
 
        #[allow(unused_imports)]
index b592ae0c4f4a36701813bbaa1961cd69d0c56972..9c8998b8970f9a7da6fda93ebc10ea1b2df89b13 100644 (file)
@@ -15,7 +15,7 @@ use bitcoin::secp256k1::{self, Secp256k1, SecretKey};
 
 use crate::blinded_path::{IntroductionNode, NodeIdLookUp};
 use crate::events::{self, PaymentFailureReason};
-use crate::ln::types::{PaymentHash, PaymentPreimage, PaymentSecret};
+use crate::types::payment::{PaymentHash, PaymentPreimage, PaymentSecret};
 use crate::ln::channel_state::ChannelDetails;
 use crate::ln::channelmanager::{EventCompletionAction, HTLCSource, PaymentId};
 use crate::types::features::Bolt12InvoiceFeatures;
@@ -2265,7 +2265,7 @@ mod tests {
 
        use crate::blinded_path::EmptyNodeIdLookUp;
        use crate::events::{Event, PathFailure, PaymentFailureReason};
-       use crate::ln::types::{PaymentHash, PaymentPreimage};
+       use crate::types::payment::{PaymentHash, PaymentPreimage};
        use crate::ln::channelmanager::{PaymentId, RecipientOnionFields};
        use crate::types::features::{Bolt12InvoiceFeatures, ChannelFeatures, NodeFeatures};
        use crate::ln::msgs::{ErrorAction, LightningError};
index 2f6a14e8c38db431403aa1755657c182ae807466..7839b49be778acc40af5827af570c476ba6fa96e 100644 (file)
@@ -19,7 +19,8 @@ use crate::ln::channel::{EXPIRE_PREV_CONFIG_TICKS, get_holder_selected_channel_r
 use crate::ln::channelmanager::{BREAKDOWN_TIMEOUT, MPP_TIMEOUT_TICKS, MIN_CLTV_EXPIRY_DELTA, PaymentId, PaymentSendFailure, RecentPaymentDetails, RecipientOnionFields, HTLCForwardInfo, PendingHTLCRouting, PendingAddHTLCInfo};
 use crate::types::features::{Bolt11InvoiceFeatures, ChannelTypeFeatures};
 use crate::ln::msgs;
-use crate::ln::types::{ChannelId, PaymentHash, PaymentSecret, PaymentPreimage};
+use crate::ln::types::ChannelId;
+use crate::types::payment::{PaymentHash, PaymentSecret, PaymentPreimage};
 use crate::ln::chan_utils;
 use crate::ln::msgs::ChannelMessageHandler;
 use crate::ln::onion_utils;
index dbe1e216b90cf6e03e8c66dba972853c7d555da6..48b663afed7befbf850568c4ae2a69f8dfa1b9d9 100644 (file)
@@ -8,12 +8,6 @@
 // licenses.
 
 //! Various wrapper types (most around 32-byte arrays) for use in lightning.
-//!
-//! Note that the re-exports of [`PaymentHash`], [`PaymentPreimage`], and [`PaymentSecret`] here
-//! are deprecated and will be removed in a future version. Instead, use them via
-//! [`lightning::types::payment`].
-//!
-//! [`lightning::types::payment`]: crate::types::payment
 
 use crate::chain::transaction::OutPoint;
 use crate::io;
@@ -134,8 +128,6 @@ impl_fmt_traits! {
        }
 }
 
-pub use lightning_types::payment::{PaymentHash, PaymentPreimage, PaymentSecret};
-
 #[cfg(test)]
 mod tests {
        use bitcoin::hashes::{
index d1fa54b8f191ac589ed48236737e54fef7bc1638..844018012c1c2928b02019a4aa4a69774632c5fe 100644 (file)
@@ -28,7 +28,7 @@
 //! use lightning::offers::refund::Refund;
 //! use lightning::util::ser::Writeable;
 //!
-//! # use lightning::ln::types::PaymentHash;
+//! # use lightning::types::payment::PaymentHash;
 //! # use lightning::offers::invoice::{ExplicitSigningPubkey, InvoiceBuilder};
 //! # use lightning::blinded_path::payment::{BlindedPayInfo, BlindedPaymentPath};
 //! #
@@ -113,7 +113,7 @@ use crate::io;
 use crate::blinded_path::BlindedPath;
 use crate::blinded_path::message::BlindedMessagePath;
 use crate::blinded_path::payment::{BlindedPayInfo, BlindedPaymentPath};
-use crate::ln::types::PaymentHash;
+use crate::types::payment::PaymentHash;
 use crate::ln::channelmanager::PaymentId;
 use crate::types::features::{Bolt12InvoiceFeatures, InvoiceRequestFeatures, OfferFeatures};
 use crate::ln::inbound_payment::{ExpandedKey, IV_LEN};
index 3fcc50b5e30d4bbcbb1f68641f724fceae7aa936..fed8bfee27f9bd2c0382ae38aa88fd385bcdc4bb 100644 (file)
@@ -64,7 +64,7 @@ use bitcoin::secp256k1::schnorr::Signature;
 use crate::io;
 use crate::blinded_path::message::BlindedMessagePath;
 use crate::blinded_path::payment::BlindedPaymentPath;
-use crate::ln::types::PaymentHash;
+use crate::types::payment::PaymentHash;
 use crate::ln::channelmanager::PaymentId;
 use crate::types::features::InvoiceRequestFeatures;
 use crate::ln::inbound_payment::{ExpandedKey, IV_LEN};
index 8c580bdcc6e3f11dd0824f18e7ad0f08249e459e..8d76534ff6d4bbae8b71b22fa28b57333ed725fa 100644 (file)
@@ -93,7 +93,7 @@ use crate::sign::EntropySource;
 use crate::io;
 use crate::blinded_path::message::BlindedMessagePath;
 use crate::blinded_path::payment::BlindedPaymentPath;
-use crate::ln::types::PaymentHash;
+use crate::types::payment::PaymentHash;
 use crate::ln::channelmanager::PaymentId;
 use crate::types::features::InvoiceRequestFeatures;
 use crate::ln::inbound_payment::{ExpandedKey, IV_LEN};
index fc6d9f755a0c0f8ec0b38f0381758c8b2d74adf1..3c6016e20c6fc3ecb5855120d485ea144daadeb8 100644 (file)
@@ -16,7 +16,7 @@ use core::time::Duration;
 use crate::blinded_path::BlindedHop;
 use crate::blinded_path::payment::{BlindedPayInfo, BlindedPaymentPath};
 use crate::sign::EntropySource;
-use crate::ln::types::PaymentHash;
+use crate::types::payment::PaymentHash;
 use crate::types::features::BlindedHopFeatures;
 use crate::offers::merkle::TaggedHash;
 
index 9bdacab4be038385e665374b7a6f32cb0f7be64d..513ccd6adad2a8bf68bf77bcc73fff5301381816 100644 (file)
@@ -13,7 +13,7 @@ use bitcoin::secp256k1::{PublicKey, Secp256k1, self};
 
 use crate::blinded_path::{BlindedHop, Direction, IntroductionNode};
 use crate::blinded_path::payment::{BlindedPaymentPath, ForwardTlvs, PaymentConstraints, PaymentForwardNode, PaymentRelay, ReceiveTlvs};
-use crate::ln::{PaymentHash, PaymentPreimage};
+use crate::types::payment::{PaymentHash, PaymentPreimage};
 use crate::ln::channel_state::ChannelDetails;
 use crate::ln::channelmanager::{PaymentId, MIN_FINAL_CLTV_EXPIRY_DELTA, RecipientOnionFields};
 use crate::types::features::{BlindedHopFeatures, Bolt11InvoiceFeatures, Bolt12InvoiceFeatures, ChannelFeatures, NodeFeatures};
index ecdd45aa3f5e0b5b401843bff17327aa04dbdaec..afaa2c35a03f892be07e0636577cf99c8d1d2b26 100644 (file)
@@ -10,7 +10,7 @@ use crate::ln::chan_utils::{
        ClosingTransaction, CommitmentTransaction, HTLCOutputInCommitment, HolderCommitmentTransaction,
 };
 use crate::ln::msgs::UnsignedChannelAnnouncement;
-use crate::ln::types::PaymentPreimage;
+use crate::types::payment::PaymentPreimage;
 
 #[allow(unused_imports)]
 use crate::prelude::*;
index c1a70e5e8d076199b8c7139f4cd6862017d5701f..70c5039b8e4c81cc62a81f34052a4fcf6d192423 100644 (file)
@@ -55,9 +55,9 @@ use crate::ln::channel_keys::{
 use crate::ln::msgs::PartialSignatureWithNonce;
 use crate::ln::msgs::{UnsignedChannelAnnouncement, UnsignedGossipMessage};
 use crate::ln::script::ShutdownScript;
-use crate::ln::types::PaymentPreimage;
 use crate::offers::invoice::UnsignedBolt12Invoice;
 use crate::offers::invoice_request::UnsignedInvoiceRequest;
+use crate::types::payment::PaymentPreimage;
 use crate::util::ser::{Readable, ReadableArgs, Writeable, Writer};
 use crate::util::transaction_utils;
 
index 740942bc055b27e12dee6f5184fe0a6f657725dc..ebfaad26c85266bbf1f01a9a9e9db1c0505cadfc 100644 (file)
@@ -11,8 +11,8 @@ use crate::ln::chan_utils::{
        ClosingTransaction, CommitmentTransaction, HTLCOutputInCommitment, HolderCommitmentTransaction,
 };
 use crate::ln::msgs::PartialSignatureWithNonce;
-use crate::ln::PaymentPreimage;
 use crate::sign::{ChannelSigner, HTLCDescriptor};
+use crate::types::payment::PaymentPreimage;
 
 /// A Taproot-specific signer type that defines signing-related methods that are either unique to
 /// Taproot or have argument or return types that differ from the ones an ECDSA signer would be
index 0b29ea1a98fcb5c1e28b02c94a47710fdf8dbd03..86c9ea4a8d166eb9d7b521fd17dc242a55357b0a 100644 (file)
@@ -21,9 +21,9 @@ use core::fmt;
 use core::ops::Deref;
 
 use crate::ln::types::ChannelId;
-use crate::ln::PaymentHash;
 #[cfg(c_bindings)]
 use crate::prelude::*; // Needed for String
+use crate::types::payment::PaymentHash;
 
 static LOG_LEVEL_NAMES: [&'static str; 6] = ["GOSSIP", "TRACE", "DEBUG", "INFO", "WARN", "ERROR"];
 
@@ -265,8 +265,8 @@ impl<T: fmt::Display, I: core::iter::Iterator<Item = T> + Clone> fmt::Display fo
 #[cfg(test)]
 mod tests {
        use crate::ln::types::ChannelId;
-       use crate::ln::PaymentHash;
        use crate::sync::Arc;
+       use crate::types::payment::PaymentHash;
        use crate::util::logger::{Level, Logger, WithContext};
        use crate::util::test_utils::TestLogger;
        use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
index e27d492930ea7a25a15ecc843c4c6a197888d809..5c1a82d4b6fb3b24ddd1ae6432923311c91884f7 100644 (file)
@@ -45,7 +45,7 @@ use crate::chain::ClaimId;
 use crate::ln::msgs::DecodeError;
 #[cfg(taproot)]
 use crate::ln::msgs::PartialSignatureWithNonce;
-use crate::ln::types::{PaymentPreimage, PaymentHash, PaymentSecret};
+use crate::types::payment::{PaymentPreimage, PaymentHash, PaymentSecret};
 
 use crate::util::byte_utils::{be48_to_array, slice_to_be48};
 use crate::util::string::UntrustedString;
index 9a1a75e92cb8105622466739156510a75b798208..9cfeb9c180a320492d02bb0f2f5dacf75a2f827b 100644 (file)
@@ -11,7 +11,7 @@ use crate::ln::channel::{ANCHOR_OUTPUT_VALUE_SATOSHI, MIN_CHAN_DUST_LIMIT_SATOSH
 use crate::ln::chan_utils::{HTLCOutputInCommitment, ChannelPublicKeys, HolderCommitmentTransaction, CommitmentTransaction, ChannelTransactionParameters, TrustedCommitmentTransaction, ClosingTransaction};
 use crate::ln::channel_keys::{HtlcKey};
 use crate::ln::msgs;
-use crate::ln::types::PaymentPreimage;
+use crate::types::payment::PaymentPreimage;
 use crate::sign::{InMemorySigner, ChannelSigner};
 use crate::sign::ecdsa::EcdsaChannelSigner;