]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Move the public path for `channel_state` types to their new path
authorMatt Corallo <git@bluematt.me>
Tue, 4 Jun 2024 01:25:52 +0000 (01:25 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 4 Jun 2024 14:35:54 +0000 (14:35 +0000)
14 files changed:
fuzz/src/chanmon_consistency.rs
fuzz/src/full_stack.rs
fuzz/src/msg_targets/gen_target.sh
fuzz/src/msg_targets/msg_channel_details.rs
fuzz/src/router.rs
lightning-invoice/src/utils.rs
lightning/src/blinded_path/payment.rs
lightning/src/chain/chainmonitor.rs
lightning/src/ln/channel.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/outbound_payment.rs
lightning/src/ln/shutdown_tests.rs
lightning/src/routing/router.rs
lightning/src/util/test_utils.rs

index ba8ba3e1dc711056aaa5d2b6d025410fa574f76e..95b99b923800b96853fef794b28291bd8d468579 100644 (file)
@@ -41,7 +41,8 @@ use lightning::sign::{KeyMaterial, InMemorySigner, Recipient, EntropySource, Nod
 use lightning::events;
 use lightning::events::MessageSendEventsProvider;
 use lightning::ln::{ChannelId, PaymentHash, PaymentPreimage, PaymentSecret};
-use lightning::ln::channelmanager::{ChainParameters, ChannelDetails, ChannelManager, ChannelManagerReadArgs, PaymentId};
+use lightning::ln::channel_state::ChannelDetails;
+use lightning::ln::channelmanager::{ChainParameters, ChannelManager, ChannelManagerReadArgs, PaymentId};
 use lightning::ln::outbound_payment::{RecipientOnionFields, PaymentSendFailure};
 use lightning::ln::channel::FEE_SPIKE_BUFFER_FEE_INCREASE_MULTIPLE;
 use lightning::ln::msgs::{self, CommitmentUpdate, ChannelMessageHandler, DecodeError, UpdateAddHTLC, Init};
index 09e5b430d5fad0d41e9e02f8efb4a5cb20649831..44b3ff7132418ea361ff4b4ed8a81e8a0e3303b2 100644 (file)
@@ -37,7 +37,8 @@ use lightning::chain::transaction::OutPoint;
 use lightning::sign::{InMemorySigner, Recipient, KeyMaterial, EntropySource, NodeSigner, SignerProvider};
 use lightning::events::Event;
 use lightning::ln::{ChannelId, PaymentHash, PaymentPreimage, PaymentSecret};
-use lightning::ln::channelmanager::{ChainParameters, ChannelDetails, ChannelManager, PaymentId, InterceptId};
+use lightning::ln::channel_state::ChannelDetails;
+use lightning::ln::channelmanager::{ChainParameters, ChannelManager, PaymentId, InterceptId};
 use lightning::ln::outbound_payment::{RecipientOnionFields, Retry};
 use lightning::ln::peer_handler::{MessageHandler,PeerManager,SocketDescriptor,IgnoringMessageHandler};
 use lightning::ln::msgs::{self, DecodeError};
index cb24aa919db8c258163525afcb5d247d5e1a320f..8bce10059f539de33506b358dc4937a564dc9b69 100755 (executable)
@@ -45,7 +45,7 @@ GEN_TEST lightning::ln::msgs::ErrorMessage test_msg_hole ", 32, 2"
 GEN_TEST lightning::ln::msgs::WarningMessage test_msg_hole ", 32, 2"
 GEN_TEST lightning::ln::msgs::ChannelUpdate test_msg_hole ", 108, 1"
 
-GEN_TEST lightning::ln::channelmanager::ChannelDetails test_msg_simple ""
+GEN_TEST lightning::ln::channel_state::ChannelDetails test_msg_simple ""
 
 GEN_TEST lightning::ln::msgs::OpenChannelV2 test_msg_simple ""
 GEN_TEST lightning::ln::msgs::AcceptChannelV2 test_msg_simple ""
index 54fc289479fc3c492b2345879a9cf547962e8c08..59554fab177df629a23005493aa6fa908bf612b1 100644 (file)
@@ -15,11 +15,11 @@ use crate::utils::test_logger;
 
 #[inline]
 pub fn msg_channel_details_test<Out: test_logger::Output>(data: &[u8], _out: Out) {
-       test_msg_simple!(lightning::ln::channelmanager::ChannelDetails, data);
+       test_msg_simple!(lightning::ln::channel_state::ChannelDetails, data);
 }
 
 #[no_mangle]
 pub extern "C" fn msg_channel_details_run(data: *const u8, datalen: usize) {
        let data = unsafe { std::slice::from_raw_parts(data, datalen) };
-       test_msg_simple!(lightning::ln::channelmanager::ChannelDetails, data);
+       test_msg_simple!(lightning::ln::channel_state::ChannelDetails, data);
 }
index afe028131c1de0a3a79eb30e975a9cc6e72097a9..e3b13e517f67576a6d57f68f5933cfe02b404dcf 100644 (file)
@@ -14,7 +14,8 @@ use bitcoin::blockdata::transaction::TxOut;
 use lightning::blinded_path::{BlindedHop, BlindedPath, IntroductionNode};
 use lightning::chain::transaction::OutPoint;
 use lightning::ln::ChannelId;
-use lightning::ln::channelmanager::{self, ChannelDetails, ChannelCounterparty};
+use lightning::ln::channel_state::{ChannelDetails, ChannelCounterparty, ChannelShutdownState};
+use lightning::ln::channelmanager;
 use lightning::ln::features::{BlindedHopFeatures, Bolt12InvoiceFeatures};
 use lightning::ln::msgs;
 use lightning::offers::invoice::BlindedPayInfo;
@@ -243,7 +244,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
                                                        inbound_htlc_maximum_msat: None,
                                                        config: None,
                                                        feerate_sat_per_1000_weight: None,
-                                                       channel_shutdown_state: Some(channelmanager::ChannelShutdownState::NotShuttingDown),
+                                                       channel_shutdown_state: Some(ChannelShutdownState::NotShuttingDown),
                                                        pending_inbound_htlcs: Vec::new(),
                                                        pending_outbound_htlcs: Vec::new(),
                                                });
index 1dda97fb49be246d5459080b4c7d1542d63f2ca6..2f331399f7c824cf6f0560993dbe76818903a4c6 100644 (file)
@@ -9,7 +9,8 @@ use lightning::chain;
 use lightning::chain::chaininterface::{BroadcasterInterface, FeeEstimator};
 use lightning::sign::{Recipient, NodeSigner, SignerProvider, EntropySource};
 use lightning::ln::types::{PaymentHash, PaymentSecret};
-use lightning::ln::channelmanager::{ChannelDetails, ChannelManager, MIN_FINAL_CLTV_EXPIRY_DELTA};
+use lightning::ln::channel_state::ChannelDetails;
+use lightning::ln::channelmanager::{ChannelManager, MIN_FINAL_CLTV_EXPIRY_DELTA};
 use lightning::ln::channelmanager::{PhantomRouteHints, MIN_CLTV_EXPIRY_DELTA};
 use lightning::ln::inbound_payment::{create, create_from_hash, ExpandedKey};
 use lightning::routing::gossip::RoutingFees;
index dfe89e0ebc6c34e6579fa1cea0ca79f4dc0b7672..f8abe90a318273b871618031282f7387fe3bfcc1 100644 (file)
@@ -8,7 +8,7 @@ use crate::blinded_path::BlindedHop;
 use crate::blinded_path::utils;
 use crate::io;
 use crate::ln::types::PaymentSecret;
-use crate::ln::channelmanager::CounterpartyForwardingInfo;
+use crate::ln::channel_state::CounterpartyForwardingInfo;
 use crate::ln::features::BlindedHopFeatures;
 use crate::ln::msgs::DecodeError;
 use crate::offers::invoice::BlindedPayInfo;
index ccb30e132c2c0f6e3a072149a6972eaf59e0a2e9..fcb4e7980fd74ef8492f00cb623e1afa867bb94d 100644 (file)
@@ -39,7 +39,7 @@ use crate::util::atomic_counter::AtomicCounter;
 use crate::util::logger::{Logger, WithContext};
 use crate::util::errors::APIError;
 use crate::util::wakers::{Future, Notifier};
-use crate::ln::channelmanager::ChannelDetails;
+use crate::ln::channel_state::ChannelDetails;
 
 use crate::prelude::*;
 use crate::sync::{RwLock, RwLockReadGuard, Mutex, MutexGuard};
index 6f353f3488efe7f1b125249bbf3c652eef4e0ef1..359b561dc3de92c3ad8265eb61a42c5dfa06a512 100644 (file)
@@ -29,8 +29,8 @@ use crate::ln::features::{ChannelTypeFeatures, InitFeatures};
 use crate::ln::msgs;
 use crate::ln::msgs::DecodeError;
 use crate::ln::script::{self, ShutdownScript};
-use crate::ln::channel_state::{CounterpartyForwardingInfo, InboundHTLCDetails, InboundHTLCStateDetails, OutboundHTLCDetails, OutboundHTLCStateDetails};
-use crate::ln::channelmanager::{self, PendingHTLCStatus, HTLCSource, SentHTLCId, HTLCFailureMsg, PendingHTLCInfo, RAACommitmentOrder, BREAKDOWN_TIMEOUT, MIN_CLTV_EXPIRY_DELTA, MAX_LOCAL_BREAKDOWN_TIMEOUT, ChannelShutdownState};
+use crate::ln::channel_state::{ChannelShutdownState, CounterpartyForwardingInfo, InboundHTLCDetails, InboundHTLCStateDetails, OutboundHTLCDetails, OutboundHTLCStateDetails};
+use crate::ln::channelmanager::{self, PendingHTLCStatus, HTLCSource, SentHTLCId, HTLCFailureMsg, PendingHTLCInfo, RAACommitmentOrder, BREAKDOWN_TIMEOUT, MIN_CLTV_EXPIRY_DELTA, MAX_LOCAL_BREAKDOWN_TIMEOUT};
 use crate::ln::chan_utils::{CounterpartyCommitmentSecrets, TxCreationKeys, HTLCOutputInCommitment, htlc_success_tx_weight, htlc_timeout_tx_weight, make_funding_redeemscript, ChannelPublicKeys, CommitmentTransaction, HolderCommitmentTransaction, ChannelTransactionParameters, CounterpartyChannelTransactionParameters, MAX_HTLCS, get_commitment_transaction_number_obscure_factor, ClosingTransaction};
 use crate::ln::chan_utils;
 use crate::ln::onion_utils::HTLCFailReason;
index c47a47fa6a66424ac792ad0da302ec979b24a9f1..ab20354085cd85ec04bf07573530670daf20ef98 100644 (file)
@@ -45,8 +45,7 @@ use crate::events::{Event, EventHandler, EventsProvider, MessageSendEvent, Messa
 use crate::ln::inbound_payment;
 use crate::ln::types::{ChannelId, PaymentHash, PaymentPreimage, PaymentSecret};
 use crate::ln::channel::{self, Channel, ChannelPhase, ChannelContext, ChannelError, ChannelUpdateStatus, ShutdownResult, UnfundedChannelContext, UpdateFulfillCommitFetch, OutboundV1Channel, InboundV1Channel, WithChannelContext};
-pub use crate::ln::channel_state::{ChannelCounterparty, ChannelDetails, ChannelShutdownState, CounterpartyForwardingInfo};
-pub use crate::ln::channel_state::{InboundHTLCDetails, InboundHTLCStateDetails, OutboundHTLCDetails, OutboundHTLCStateDetails};
+use crate::ln::channel_state::{ChannelCounterparty, ChannelDetails, ChannelShutdownState, CounterpartyForwardingInfo};
 use crate::ln::features::{Bolt12InvoiceFeatures, ChannelFeatures, ChannelTypeFeatures, InitFeatures, NodeFeatures};
 #[cfg(any(feature = "_test_utils", test))]
 use crate::ln::features::Bolt11InvoiceFeatures;
index 2dd1e2a74096b50e6b0a69297238e6854f6f3a75..d872a36e576b46615d5d98b1b2d9e1c9d3e4f371 100644 (file)
@@ -16,7 +16,8 @@ use bitcoin::secp256k1::{self, Secp256k1, SecretKey};
 use crate::sign::{EntropySource, NodeSigner, Recipient};
 use crate::events::{self, PaymentFailureReason};
 use crate::ln::types::{PaymentHash, PaymentPreimage, PaymentSecret};
-use crate::ln::channelmanager::{ChannelDetails, EventCompletionAction, HTLCSource, PaymentId};
+use crate::ln::channel_state::ChannelDetails;
+use crate::ln::channelmanager::{EventCompletionAction, HTLCSource, PaymentId};
 use crate::ln::onion_utils::{DecodedOnionFailure, HTLCFailReason};
 use crate::offers::invoice::Bolt12Invoice;
 use crate::routing::router::{BlindedTail, InFlightHtlcs, Path, PaymentParameters, Route, RouteParameters, Router};
index 12421ce9c3f6323e31747173d4064572f5ae1198..d60f341c25ce173bd9061a3b17eecb9dc7f776bf 100644 (file)
@@ -14,7 +14,8 @@ use crate::sign::{EntropySource, SignerProvider};
 use crate::chain::ChannelMonitorUpdateStatus;
 use crate::chain::transaction::OutPoint;
 use crate::events::{Event, MessageSendEvent, HTLCDestination, MessageSendEventsProvider, ClosureReason};
-use crate::ln::channelmanager::{self, PaymentSendFailure, PaymentId, RecipientOnionFields, Retry, ChannelShutdownState, ChannelDetails};
+use crate::ln::channel_state::{ChannelDetails, ChannelShutdownState};
+use crate::ln::channelmanager::{self, PaymentSendFailure, PaymentId, RecipientOnionFields, Retry};
 use crate::routing::router::{PaymentParameters, get_route, RouteParameters};
 use crate::ln::msgs;
 use crate::ln::types::ChannelId;
index e8fb7d404e61e197b7b1cedce5d9579d55589d04..efffd9964ace8dc43227c70a819134162ed42b51 100644 (file)
@@ -14,7 +14,8 @@ use bitcoin::secp256k1::{PublicKey, Secp256k1, self};
 use crate::blinded_path::{BlindedHop, BlindedPath, Direction, IntroductionNode};
 use crate::blinded_path::payment::{ForwardNode, ForwardTlvs, PaymentConstraints, PaymentRelay, ReceiveTlvs};
 use crate::ln::types::PaymentHash;
-use crate::ln::channelmanager::{ChannelDetails, PaymentId, MIN_FINAL_CLTV_EXPIRY_DELTA};
+use crate::ln::channel_state::ChannelDetails;
+use crate::ln::channelmanager::{PaymentId, MIN_FINAL_CLTV_EXPIRY_DELTA};
 use crate::ln::features::{BlindedHopFeatures, Bolt11InvoiceFeatures, Bolt12InvoiceFeatures, ChannelFeatures, NodeFeatures};
 use crate::ln::msgs::{DecodeError, ErrorAction, LightningError, MAX_VALUE_MSAT};
 use crate::offers::invoice::{BlindedPayInfo, Bolt12Invoice};
@@ -3291,6 +3292,7 @@ mod tests {
        use crate::routing::test_utils::{add_channel, add_or_update_node, build_graph, build_line_graph, id_to_feature_flags, get_nodes, update_channel};
        use crate::chain::transaction::OutPoint;
        use crate::sign::EntropySource;
+       use crate::ln::channel_state::{ChannelCounterparty, ChannelDetails, ChannelShutdownState};
        use crate::ln::types::ChannelId;
        use crate::ln::features::{BlindedHopFeatures, ChannelFeatures, InitFeatures, NodeFeatures};
        use crate::ln::msgs::{ErrorAction, LightningError, UnsignedChannelUpdate, MAX_VALUE_MSAT};
@@ -3318,10 +3320,10 @@ mod tests {
        use crate::sync::Arc;
 
        fn get_channel_details(short_channel_id: Option<u64>, node_id: PublicKey,
-                       features: InitFeatures, outbound_capacity_msat: u64) -> channelmanager::ChannelDetails {
-               channelmanager::ChannelDetails {
+                       features: InitFeatures, outbound_capacity_msat: u64) -> ChannelDetails {
+               ChannelDetails {
                        channel_id: ChannelId::new_zero(),
-                       counterparty: channelmanager::ChannelCounterparty {
+                       counterparty: ChannelCounterparty {
                                features,
                                node_id,
                                unspendable_punishment_reserve: 0,
@@ -3351,7 +3353,7 @@ mod tests {
                        inbound_htlc_maximum_msat: None,
                        config: None,
                        feerate_sat_per_1000_weight: None,
-                       channel_shutdown_state: Some(channelmanager::ChannelShutdownState::NotShuttingDown),
+                       channel_shutdown_state: Some(ChannelShutdownState::NotShuttingDown),
                        pending_inbound_htlcs: Vec::new(),
                        pending_outbound_htlcs: Vec::new(),
                }
@@ -8415,8 +8417,9 @@ pub(crate) mod bench_utils {
        use crate::chain::transaction::OutPoint;
        use crate::routing::scoring::ScoreUpdate;
        use crate::sign::KeysManager;
+       use crate::ln::channel_state::{ChannelCounterparty, ChannelShutdownState};
+       use crate::ln::channelmanager;
        use crate::ln::types::ChannelId;
-       use crate::ln::channelmanager::{self, ChannelCounterparty};
        use crate::util::config::UserConfig;
        use crate::util::test_utils::TestLogger;
 
@@ -8501,7 +8504,7 @@ pub(crate) mod bench_utils {
                        inbound_htlc_maximum_msat: None,
                        config: None,
                        feerate_sat_per_1000_weight: None,
-                       channel_shutdown_state: Some(channelmanager::ChannelShutdownState::NotShuttingDown),
+                       channel_shutdown_state: Some(ChannelShutdownState::NotShuttingDown),
                        pending_inbound_htlcs: Vec::new(),
                        pending_outbound_htlcs: Vec::new(),
                }
index 9a340db905eebb4e358ec5fd3bee1d4edc6128f8..184f0e54679762eb5b44eacc4e39fca67eb36d4d 100644 (file)
@@ -25,7 +25,8 @@ use crate::sign;
 use crate::events;
 use crate::events::bump_transaction::{WalletSource, Utxo};
 use crate::ln::types::ChannelId;
-use crate::ln::channelmanager::{ChannelDetails, self};
+use crate::ln::channel_state::ChannelDetails;
+use crate::ln::channelmanager;
 #[cfg(test)]
 use crate::ln::chan_utils::CommitmentTransaction;
 use crate::ln::features::{ChannelFeatures, InitFeatures, NodeFeatures};