mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-01-19 05:43:55 +01:00
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.
This commit is contained in:
parent
64c12431b7
commit
50b5a6efa7
@ -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::*;
|
||||
|
@ -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::*;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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]
|
||||
|
@ -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,
|
||||
|
@ -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};
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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};
|
||||
|
@ -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};
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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};
|
||||
|
@ -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};
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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};
|
||||
|
@ -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};
|
||||
|
||||
|
@ -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};
|
||||
|
@ -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;
|
||||
|
@ -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};
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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))]
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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)]
|
||||
|
@ -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};
|
||||
|
@ -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;
|
||||
|
@ -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::{
|
||||
|
@ -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};
|
||||
|
@ -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};
|
||||
|
@ -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};
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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};
|
||||
|
@ -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::*;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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};
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user