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};
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::*;
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};
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::*;
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;
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]
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,
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};
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;
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;
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};
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};
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};
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};
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;
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;
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};
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
#[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};
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;
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;
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};
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;
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};
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};
// 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};
///
/// ```
/// # 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;
/// #
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};
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;
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};
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;
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};
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;
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;
// 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]
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))]
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;
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};
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;
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;
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;
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;
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};
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)]
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;
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};
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;
// 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;
}
}
-pub use lightning_types::payment::{PaymentHash, PaymentPreimage, PaymentSecret};
-
#[cfg(test)]
mod tests {
use bitcoin::hashes::{
//! 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};
//! #
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};
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};
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};
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;
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};
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::*;
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;
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
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"];
#[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};
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;
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;