@@ -138,13 +138,15 @@ enum FeeUpdateState {
138138 Outbound,
139139}
140140
141+ #[derive(Debug)]
141142enum InboundHTLCRemovalReason {
142143 FailRelay(msgs::OnionErrorPacket),
143144 FailMalformed(([u8; 32], u16)),
144145 Fulfill(PaymentPreimage, Option<AttributionData>),
145146}
146147
147148/// Represents the resolution status of an inbound HTLC.
149+ #[cfg_attr(test, derive(Debug))]
148150#[derive(Clone)]
149151enum InboundHTLCResolution {
150152 /// Resolved implies the action we must take with the inbound HTLC has already been determined,
@@ -168,6 +170,7 @@ impl_writeable_tlv_based_enum!(InboundHTLCResolution,
168170 },
169171);
170172
173+ #[cfg_attr(test, derive(Debug))]
171174enum InboundHTLCState {
172175 /// Offered by remote, to be included in next local commitment tx. I.e., the remote sent an
173176 /// update_add_htlc message for this HTLC.
@@ -295,6 +298,7 @@ impl InboundHTLCState {
295298 }
296299}
297300
301+ #[cfg_attr(test, derive(Debug))]
298302struct InboundHTLCOutput {
299303 htlc_id: u64,
300304 amount_msat: u64,
@@ -303,7 +307,8 @@ struct InboundHTLCOutput {
303307 state: InboundHTLCState,
304308}
305309
306- #[cfg_attr(test, derive(Clone, Debug, PartialEq))]
310+ #[derive(Debug)]
311+ #[cfg_attr(test, derive(Clone, PartialEq))]
307312enum OutboundHTLCState {
308313 /// Added by us and included in a commitment_signed (if we were AwaitingRemoteRevoke when we
309314 /// created it we would have put it in the holding cell instead). When they next revoke_and_ack
@@ -397,8 +402,8 @@ impl OutboundHTLCState {
397402 }
398403}
399404
400- #[derive(Clone)]
401- #[cfg_attr(test, derive(Debug, PartialEq))]
405+ #[derive(Clone, Debug )]
406+ #[cfg_attr(test, derive(PartialEq))]
402407enum OutboundHTLCOutcome {
403408 /// We started always filling in the preimages here in 0.0.105, and the requirement
404409 /// that the preimages always be filled in was added in 0.2.
@@ -415,7 +420,8 @@ impl<'a> Into<Option<&'a HTLCFailReason>> for &'a OutboundHTLCOutcome {
415420 }
416421}
417422
418- #[cfg_attr(test, derive(Clone, Debug, PartialEq))]
423+ #[derive(Debug)]
424+ #[cfg_attr(test, derive(Clone, PartialEq))]
419425struct OutboundHTLCOutput {
420426 htlc_id: u64,
421427 amount_msat: u64,
@@ -430,7 +436,8 @@ struct OutboundHTLCOutput {
430436}
431437
432438/// See AwaitingRemoteRevoke ChannelState for more info
433- #[cfg_attr(test, derive(Clone, Debug, PartialEq))]
439+ #[derive(Debug)]
440+ #[cfg_attr(test, derive(Clone, PartialEq))]
434441enum HTLCUpdateAwaitingACK {
435442 AddHTLC {
436443 // TODO: Time out if we're getting close to cltv_expiry
@@ -1013,7 +1020,7 @@ macro_rules! secp_check {
10131020/// spamming the network with updates if the connection is flapping. Instead, we "stage" updates to
10141021/// our channel_update message and track the current state here.
10151022/// See implementation at [`super::channelmanager::ChannelManager::timer_tick_occurred`].
1016- #[derive(Clone, Copy, PartialEq)]
1023+ #[derive(Clone, Copy, PartialEq, Debug )]
10171024pub(super) enum ChannelUpdateStatus {
10181025 /// We've announced the channel as enabled and are connected to our peer.
10191026 Enabled,
@@ -1026,6 +1033,7 @@ pub(super) enum ChannelUpdateStatus {
10261033}
10271034
10281035/// We track when we sent an `AnnouncementSignatures` to our peer in a few states, described here.
1036+ #[cfg_attr(test, derive(Debug))]
10291037#[derive(PartialEq)]
10301038pub enum AnnouncementSigsState {
10311039 /// We have not sent our peer an `AnnouncementSignatures` yet, or our peer disconnected since
@@ -1395,6 +1403,7 @@ pub(crate) const CHANNEL_ANNOUNCEMENT_PROPAGATION_DELAY: u32 = 14 * 24 * 6 * 4;
13951403#[cfg(test)]
13961404pub(crate) const CHANNEL_ANNOUNCEMENT_PROPAGATION_DELAY: u32 = 144;
13971405
1406+ #[derive(Debug)]
13981407struct PendingChannelMonitorUpdate {
13991408 update: ChannelMonitorUpdate,
14001409}
@@ -2277,6 +2286,7 @@ impl UnfundedChannelContext {
22772286/// Information pertaining to an attempt at funding the channel. This is typically constructed
22782287/// during channel establishment and may be replaced during channel splicing or if the attempted
22792288/// funding transaction is replaced using tx_init_rbf.
2289+ #[derive(Debug)]
22802290pub(super) struct FundingScope {
22812291 value_to_self_msat: u64, // Excluding all pending_htlcs, fees, and anchor outputs
22822292
@@ -2604,6 +2614,7 @@ impl FundingScope {
26042614/// Information about pending attempts at funding a channel. This includes funding currently under
26052615/// negotiation and any negotiated attempts waiting enough on-chain confirmations. More than one
26062616/// such attempt indicates use of RBF to increase the chances of confirmation.
2617+ #[derive(Debug)]
26072618struct PendingFunding {
26082619 funding_negotiation: Option<FundingNegotiation>,
26092620
@@ -2625,6 +2636,7 @@ impl_writeable_tlv_based!(PendingFunding, {
26252636 (7, received_funding_txid, option),
26262637});
26272638
2639+ #[derive(Debug)]
26282640enum FundingNegotiation {
26292641 AwaitingAck {
26302642 context: FundingNegotiationContext,
@@ -2717,6 +2729,7 @@ impl PendingFunding {
27172729 }
27182730}
27192731
2732+ #[derive(Debug)]
27202733pub(crate) struct SpliceInstructions {
27212734 adjusted_funding_contribution: SignedAmount,
27222735 our_funding_inputs: Vec<FundingTxInput>,
@@ -2744,6 +2757,7 @@ impl_writeable_tlv_based!(SpliceInstructions, {
27442757 (11, locktime, required),
27452758});
27462759
2760+ #[derive(Debug)]
27472761pub(crate) enum QuiescentAction {
27482762 Splice(SpliceInstructions),
27492763 #[cfg(any(test, fuzzing))]
@@ -2790,6 +2804,7 @@ impl<'a> From<&'a Transaction> for ConfirmedTransaction<'a> {
27902804}
27912805
27922806/// Contains everything about the channel including state, and various flags.
2807+ #[cfg_attr(test, derive(Debug))]
27932808pub(super) struct ChannelContext<SP: Deref>
27942809where
27952810 SP::Target: SignerProvider,
@@ -6584,6 +6599,7 @@ fn check_v2_funding_inputs_sufficient(
65846599}
65856600
65866601/// Context for negotiating channels (dual-funded V2 open, splicing)
6602+ #[derive(Debug)]
65876603pub(super) struct FundingNegotiationContext {
65886604 /// Whether we initiated the funding negotiation.
65896605 pub is_initiator: bool,
@@ -6723,6 +6739,7 @@ impl FundingNegotiationContext {
67236739
67246740// Holder designates channel data owned for the benefit of the user client.
67256741// Counterparty designates channel data owned by the another channel participant entity.
6742+ #[cfg_attr(test, derive(Debug))]
67266743pub(super) struct FundedChannel<SP: Deref>
67276744where
67286745 SP::Target: SignerProvider,
@@ -6742,7 +6759,7 @@ where
67426759}
67436760
67446761#[cfg(any(test, fuzzing))]
6745- #[derive(Clone, Copy, Default)]
6762+ #[derive(Clone, Copy, Default, Debug )]
67466763struct PredictedNextFee {
67476764 predicted_feerate: u32,
67486765 predicted_nondust_htlc_count: usize,
0 commit comments