@@ -139,13 +139,15 @@ enum FeeUpdateState {
139139 Outbound,
140140}
141141
142+ #[derive(Debug)]
142143enum InboundHTLCRemovalReason {
143144 FailRelay(msgs::OnionErrorPacket),
144145 FailMalformed(([u8; 32], u16)),
145146 Fulfill(PaymentPreimage, Option<AttributionData>),
146147}
147148
148149/// Represents the resolution status of an inbound HTLC.
150+ #[cfg_attr(test, derive(Debug))]
149151#[derive(Clone)]
150152enum InboundHTLCResolution {
151153 /// Resolved implies the action we must take with the inbound HTLC has already been determined,
@@ -169,6 +171,7 @@ impl_writeable_tlv_based_enum!(InboundHTLCResolution,
169171 },
170172);
171173
174+ #[cfg_attr(test, derive(Debug))]
172175enum InboundHTLCState {
173176 /// Offered by remote, to be included in next local commitment tx. I.e., the remote sent an
174177 /// update_add_htlc message for this HTLC.
@@ -296,6 +299,7 @@ impl InboundHTLCState {
296299 }
297300}
298301
302+ #[cfg_attr(test, derive(Debug))]
299303struct InboundHTLCOutput {
300304 htlc_id: u64,
301305 amount_msat: u64,
@@ -304,7 +308,8 @@ struct InboundHTLCOutput {
304308 state: InboundHTLCState,
305309}
306310
307- #[cfg_attr(test, derive(Clone, Debug, PartialEq))]
311+ #[derive(Debug)]
312+ #[cfg_attr(test, derive(Clone, PartialEq))]
308313enum OutboundHTLCState {
309314 /// Added by us and included in a commitment_signed (if we were AwaitingRemoteRevoke when we
310315 /// created it we would have put it in the holding cell instead). When they next revoke_and_ack
@@ -398,8 +403,8 @@ impl OutboundHTLCState {
398403 }
399404}
400405
401- #[derive(Clone)]
402- #[cfg_attr(test, derive(Debug, PartialEq))]
406+ #[derive(Clone, Debug )]
407+ #[cfg_attr(test, derive(PartialEq))]
403408enum OutboundHTLCOutcome {
404409 /// We started always filling in the preimages here in 0.0.105, and the requirement
405410 /// that the preimages always be filled in was added in 0.2.
@@ -416,7 +421,8 @@ impl<'a> Into<Option<&'a HTLCFailReason>> for &'a OutboundHTLCOutcome {
416421 }
417422}
418423
419- #[cfg_attr(test, derive(Clone, Debug, PartialEq))]
424+ #[derive(Debug)]
425+ #[cfg_attr(test, derive(Clone, PartialEq))]
420426struct OutboundHTLCOutput {
421427 htlc_id: u64,
422428 amount_msat: u64,
@@ -431,7 +437,8 @@ struct OutboundHTLCOutput {
431437}
432438
433439/// See AwaitingRemoteRevoke ChannelState for more info
434- #[cfg_attr(test, derive(Clone, Debug, PartialEq))]
440+ #[derive(Debug)]
441+ #[cfg_attr(test, derive(Clone, PartialEq))]
435442enum HTLCUpdateAwaitingACK {
436443 AddHTLC {
437444 // TODO: Time out if we're getting close to cltv_expiry
@@ -1014,7 +1021,7 @@ macro_rules! secp_check {
10141021/// spamming the network with updates if the connection is flapping. Instead, we "stage" updates to
10151022/// our channel_update message and track the current state here.
10161023/// See implementation at [`super::channelmanager::ChannelManager::timer_tick_occurred`].
1017- #[derive(Clone, Copy, PartialEq)]
1024+ #[derive(Clone, Copy, PartialEq, Debug )]
10181025pub(super) enum ChannelUpdateStatus {
10191026 /// We've announced the channel as enabled and are connected to our peer.
10201027 Enabled,
@@ -1027,6 +1034,7 @@ pub(super) enum ChannelUpdateStatus {
10271034}
10281035
10291036/// We track when we sent an `AnnouncementSignatures` to our peer in a few states, described here.
1037+ #[cfg_attr(test, derive(Debug))]
10301038#[derive(PartialEq)]
10311039pub enum AnnouncementSigsState {
10321040 /// We have not sent our peer an `AnnouncementSignatures` yet, or our peer disconnected since
@@ -1396,6 +1404,7 @@ pub(crate) const CHANNEL_ANNOUNCEMENT_PROPAGATION_DELAY: u32 = 14 * 24 * 6 * 4;
13961404#[cfg(test)]
13971405pub(crate) const CHANNEL_ANNOUNCEMENT_PROPAGATION_DELAY: u32 = 144;
13981406
1407+ #[derive(Debug)]
13991408struct PendingChannelMonitorUpdate {
14001409 update: ChannelMonitorUpdate,
14011410}
@@ -2278,6 +2287,7 @@ impl UnfundedChannelContext {
22782287/// Information pertaining to an attempt at funding the channel. This is typically constructed
22792288/// during channel establishment and may be replaced during channel splicing or if the attempted
22802289/// funding transaction is replaced using tx_init_rbf.
2290+ #[derive(Debug)]
22812291pub(super) struct FundingScope {
22822292 value_to_self_msat: u64, // Excluding all pending_htlcs, fees, and anchor outputs
22832293
@@ -2605,6 +2615,7 @@ impl FundingScope {
26052615/// Information about pending attempts at funding a channel. This includes funding currently under
26062616/// negotiation and any negotiated attempts waiting enough on-chain confirmations. More than one
26072617/// such attempt indicates use of RBF to increase the chances of confirmation.
2618+ #[derive(Debug)]
26082619struct PendingFunding {
26092620 funding_negotiation: Option<FundingNegotiation>,
26102621
@@ -2626,6 +2637,7 @@ impl_writeable_tlv_based!(PendingFunding, {
26262637 (7, received_funding_txid, option),
26272638});
26282639
2640+ #[derive(Debug)]
26292641enum FundingNegotiation {
26302642 AwaitingAck {
26312643 context: FundingNegotiationContext,
@@ -2718,6 +2730,7 @@ impl PendingFunding {
27182730 }
27192731}
27202732
2733+ #[derive(Debug)]
27212734pub(crate) struct SpliceInstructions {
27222735 adjusted_funding_contribution: SignedAmount,
27232736 our_funding_inputs: Vec<FundingTxInput>,
@@ -2745,6 +2758,7 @@ impl_writeable_tlv_based!(SpliceInstructions, {
27452758 (11, locktime, required),
27462759});
27472760
2761+ #[derive(Debug)]
27482762pub(crate) enum QuiescentAction {
27492763 Splice(SpliceInstructions),
27502764 #[cfg(any(test, fuzzing))]
@@ -2791,6 +2805,7 @@ impl<'a> From<&'a Transaction> for ConfirmedTransaction<'a> {
27912805}
27922806
27932807/// Contains everything about the channel including state, and various flags.
2808+ #[cfg_attr(test, derive(Debug))]
27942809pub(super) struct ChannelContext<SP: Deref>
27952810where
27962811 SP::Target: SignerProvider,
@@ -6585,6 +6600,7 @@ fn check_v2_funding_inputs_sufficient(
65856600}
65866601
65876602/// Context for negotiating channels (dual-funded V2 open, splicing)
6603+ #[derive(Debug)]
65886604pub(super) struct FundingNegotiationContext {
65896605 /// Whether we initiated the funding negotiation.
65906606 pub is_initiator: bool,
@@ -6724,6 +6740,7 @@ impl FundingNegotiationContext {
67246740
67256741// Holder designates channel data owned for the benefit of the user client.
67266742// Counterparty designates channel data owned by the another channel participant entity.
6743+ #[cfg_attr(test, derive(Debug))]
67276744pub(super) struct FundedChannel<SP: Deref>
67286745where
67296746 SP::Target: SignerProvider,
@@ -6743,7 +6760,7 @@ where
67436760}
67446761
67456762#[cfg(any(test, fuzzing))]
6746- #[derive(Clone, Copy, Default)]
6763+ #[derive(Clone, Copy, Default, Debug )]
67476764struct PredictedNextFee {
67486765 predicted_feerate: u32,
67496766 predicted_nondust_htlc_count: usize,
0 commit comments