Skip to content

Commit 50b5a6e

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 64c1243 commit 50b5a6e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+74
-75
lines changed

fuzz/src/chanmon_consistency.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,15 @@ use lightning::ln::msgs::{
5555
self, ChannelMessageHandler, CommitmentUpdate, DecodeError, Init, UpdateAddHTLC,
5656
};
5757
use lightning::ln::script::ShutdownScript;
58-
use lightning::ln::types::{ChannelId, PaymentHash, PaymentPreimage, PaymentSecret};
58+
use lightning::ln::types::ChannelId;
5959
use lightning::offers::invoice::UnsignedBolt12Invoice;
6060
use lightning::offers::invoice_request::UnsignedInvoiceRequest;
6161
use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessagePath};
6262
use lightning::routing::router::{InFlightHtlcs, Path, Route, RouteHop, RouteParameters, Router};
6363
use lightning::sign::{
6464
EntropySource, InMemorySigner, KeyMaterial, NodeSigner, Recipient, SignerProvider,
6565
};
66+
use lightning::types::payment::{PaymentHash, PaymentPreimage, PaymentSecret};
6667
use lightning::util::config::UserConfig;
6768
use lightning::util::errors::APIError;
6869
use lightning::util::hash_tables::*;

fuzz/src/full_stack.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ use lightning::ln::peer_handler::{
4848
IgnoringMessageHandler, MessageHandler, PeerManager, SocketDescriptor,
4949
};
5050
use lightning::ln::script::ShutdownScript;
51-
use lightning::ln::types::{ChannelId, PaymentHash, PaymentPreimage, PaymentSecret};
51+
use lightning::ln::types::ChannelId;
5252
use lightning::offers::invoice::UnsignedBolt12Invoice;
5353
use lightning::offers::invoice_request::UnsignedInvoiceRequest;
5454
use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessagePath};
@@ -60,6 +60,7 @@ use lightning::routing::utxo::UtxoLookup;
6060
use lightning::sign::{
6161
EntropySource, InMemorySigner, KeyMaterial, NodeSigner, Recipient, SignerProvider,
6262
};
63+
use lightning::types::payment::{PaymentHash, PaymentPreimage, PaymentSecret};
6364
use lightning::util::config::{ChannelConfig, UserConfig};
6465
use lightning::util::errors::APIError;
6566
use lightning::util::hash_tables::*;

fuzz/src/invoice_request_deser.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@ use lightning::blinded_path::payment::{
1515
PaymentForwardNode, PaymentRelay, ReceiveTlvs,
1616
};
1717
use lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA;
18-
use lightning::ln::types::PaymentSecret;
19-
use lightning::ln::PaymentHash;
2018
use lightning::offers::invoice::UnsignedBolt12Invoice;
2119
use lightning::offers::invoice_request::{InvoiceRequest, InvoiceRequestFields};
2220
use lightning::offers::offer::OfferId;
2321
use lightning::offers::parse::Bolt12SemanticError;
2422
use lightning::sign::EntropySource;
2523
use lightning::types::features::BlindedHopFeatures;
24+
use lightning::types::payment::{PaymentHash, PaymentSecret};
2625
use lightning::util::ser::Writeable;
2726
use lightning::util::string::UntrustedString;
2827

fuzz/src/refund_deser.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ use lightning::blinded_path::payment::{
1515
PaymentForwardNode, PaymentRelay, ReceiveTlvs,
1616
};
1717
use lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA;
18-
use lightning::ln::types::PaymentSecret;
19-
use lightning::ln::PaymentHash;
2018
use lightning::offers::invoice::UnsignedBolt12Invoice;
2119
use lightning::offers::parse::Bolt12SemanticError;
2220
use lightning::offers::refund::Refund;
2321
use lightning::sign::EntropySource;
2422
use lightning::types::features::BlindedHopFeatures;
23+
use lightning::types::payment::{PaymentHash, PaymentSecret};
2524
use lightning::util::ser::Writeable;
2625

2726
#[inline]

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;

0 commit comments

Comments
 (0)