Skip to content

Commit

Permalink
chore: Derive missing eq implementations to support anchor outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
holzeis authored and luckysori committed Jul 17, 2023
1 parent 7cbb1e8 commit d6e4ba8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions lightning/src/chain/onchaintx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ impl Writeable for Option<Vec<Option<(usize, Signature)>>> {

#[cfg(anchors)]
/// The claim commonly referred to as the pre-signed second-stage HTLC transaction.
#[derive(PartialEq)]
pub(crate) struct ExternalHTLCClaim {
pub(crate) commitment_txid: Txid,
pub(crate) per_commitment_number: u64,
Expand All @@ -183,6 +184,7 @@ pub(crate) struct ExternalHTLCClaim {
// Represents the different types of claims for which events are yielded externally to satisfy said
// claims.
#[cfg(anchors)]
#[derive(PartialEq)]
pub(crate) enum ClaimEvent {
/// Event yielded to signal that the commitment transaction fee must be bumped to claim any
/// encumbered funds and proceed to HTLC resolution, if any HTLCs exist.
Expand Down
4 changes: 2 additions & 2 deletions lightning/src/ln/chan_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ pub fn build_anchor_input_witness(funding_key: &PublicKey, funding_sig: &Signatu
///
/// Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
/// before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ChannelTransactionParameters {
/// Holder public keys
pub holder_pubkeys: ChannelPublicKeys,
Expand All @@ -837,7 +837,7 @@ pub struct ChannelTransactionParameters {
}

/// Late-bound per-channel counterparty data used to build transactions.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct CounterpartyChannelTransactionParameters {
/// Counter-party public keys
pub pubkeys: ChannelPublicKeys,
Expand Down
8 changes: 5 additions & 3 deletions lightning/src/util/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ impl_writeable_tlv_based_enum_upgradable!(HTLCDestination,

#[cfg(anchors)]
/// A descriptor used to sign for a commitment transaction's anchor output.
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct AnchorDescriptor {
/// A unique identifier used along with `channel_value_satoshis` to re-derive the
/// [`InMemorySigner`] required to sign `input`.
Expand All @@ -276,7 +276,7 @@ pub struct AnchorDescriptor {

#[cfg(anchors)]
/// A descriptor used to sign for a commitment transaction's HTLC output.
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct HTLCDescriptor {
/// A unique identifier used along with `channel_value_satoshis` to re-derive the
/// [`InMemorySigner`] required to sign `input`.
Expand Down Expand Up @@ -369,7 +369,7 @@ impl HTLCDescriptor {

#[cfg(anchors)]
/// Represents the different types of transactions, originating from LDK, to be bumped.
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum BumpTransactionEvent {
/// Indicates that a channel featuring anchor outputs is to be closed by broadcasting the local
/// commitment transaction. Since commitment transactions have a static feerate pre-agreed upon,
Expand Down Expand Up @@ -462,7 +462,9 @@ pub enum BumpTransactionEvent {
/// [`BaseSign::sign_holder_htlc_transaction`]: crate::chain::keysinterface::BaseSign::sign_holder_htlc_transaction
/// [`HTLCDescriptor::tx_input_witness`]: HTLCDescriptor::tx_input_witness
HTLCResolution {
///
target_feerate_sat_per_1000_weight: u32,
///
htlc_descriptors: Vec<HTLCDescriptor>,
},
}
Expand Down

0 comments on commit d6e4ba8

Please sign in to comment.