Skip to content

Commit 7dd20a9

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

36 files changed

+66
-55
lines changed

lightning-background-processor/src/lib.rs

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

lightning/src/blinded_path/message.rs

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

lightning/src/blinded_path/payment.rs

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

lightning/src/chain/channelmonitor.rs

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

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

lightning/src/chain/onchaintx.rs

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

lightning/src/chain/package.rs

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

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

12051205
use bitcoin::amount::Amount;

lightning/src/events/mod.rs

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

lightning/src/ln/blinded_payment_tests.rs

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

lightning/src/ln/bolt11_payment.rs

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

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

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

lightning/src/ln/chan_utils.rs

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

0 commit comments

Comments
 (0)