@@ -66,7 +66,7 @@ use sync::Mutex;
6666/// much smaller than a full [`ChannelMonitor`]. However, for large single commitment transaction
6767/// updates (e.g. ones during which there are hundreds of HTLCs pending on the commitment
6868/// transaction), a single update may reach upwards of 1 MiB in serialized size.
69- #[ cfg_attr( any( test, fuzzing, feature = "_test_utils" ) , derive( PartialEq ) ) ]
69+ #[ cfg_attr( any( test, fuzzing, feature = "_test_utils" ) , derive( PartialEq , Eq ) ) ]
7070#[ derive( Clone ) ]
7171#[ must_use]
7272pub struct ChannelMonitorUpdate {
@@ -125,7 +125,7 @@ impl Readable for ChannelMonitorUpdate {
125125}
126126
127127/// An event to be processed by the ChannelManager.
128- #[ derive( Clone , PartialEq ) ]
128+ #[ derive( Clone , PartialEq , Eq ) ]
129129pub enum MonitorEvent {
130130 /// A monitor event containing an HTLCUpdate.
131131 HTLCEvent ( HTLCUpdate ) ,
@@ -170,7 +170,7 @@ impl_writeable_tlv_based_enum_upgradable!(MonitorEvent,
170170/// Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
171171/// chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
172172/// preimage claim backward will lead to loss of funds.
173- #[ derive( Clone , PartialEq ) ]
173+ #[ derive( Clone , PartialEq , Eq ) ]
174174pub struct HTLCUpdate {
175175 pub ( crate ) payment_hash : PaymentHash ,
176176 pub ( crate ) payment_preimage : Option < PaymentPreimage > ,
@@ -236,7 +236,7 @@ pub const ANTI_REORG_DELAY: u32 = 6;
236236pub ( crate ) const HTLC_FAIL_BACK_BUFFER : u32 = CLTV_CLAIM_BUFFER + LATENCY_GRACE_PERIOD_BLOCKS ;
237237
238238// TODO(devrandom) replace this with HolderCommitmentTransaction
239- #[ derive( Clone , PartialEq ) ]
239+ #[ derive( Clone , PartialEq , Eq ) ]
240240struct HolderSignedTx {
241241 /// txid of the transaction in tx, just used to make comparison faster
242242 txid : Txid ,
@@ -265,7 +265,7 @@ impl_writeable_tlv_based!(HolderSignedTx, {
265265
266266/// We use this to track static counterparty commitment transaction data and to generate any
267267/// justice or 2nd-stage preimage/timeout transactions.
268- #[ derive( PartialEq ) ]
268+ #[ derive( PartialEq , Eq ) ]
269269struct CounterpartyCommitmentParameters {
270270 counterparty_delayed_payment_base_key : PublicKey ,
271271 counterparty_htlc_base_key : PublicKey ,
@@ -319,7 +319,7 @@ impl Readable for CounterpartyCommitmentParameters {
319319/// transaction causing it.
320320///
321321/// Used to determine when the on-chain event can be considered safe from a chain reorganization.
322- #[ derive( PartialEq ) ]
322+ #[ derive( PartialEq , Eq ) ]
323323struct OnchainEventEntry {
324324 txid : Txid ,
325325 height : u32 ,
@@ -361,7 +361,7 @@ type CommitmentTxCounterpartyOutputInfo = Option<(u32, u64)>;
361361
362362/// Upon discovering of some classes of onchain tx by ChannelMonitor, we may have to take actions on it
363363/// once they mature to enough confirmations (ANTI_REORG_DELAY)
364- #[ derive( PartialEq ) ]
364+ #[ derive( PartialEq , Eq ) ]
365365enum OnchainEvent {
366366 /// An outbound HTLC failing after a transaction is confirmed. Used
367367 /// * when an outbound HTLC output is spent by us after the HTLC timed out
@@ -471,7 +471,7 @@ impl_writeable_tlv_based_enum_upgradable!(OnchainEvent,
471471
472472) ;
473473
474- #[ cfg_attr( any( test, fuzzing, feature = "_test_utils" ) , derive( PartialEq ) ) ]
474+ #[ cfg_attr( any( test, fuzzing, feature = "_test_utils" ) , derive( PartialEq , Eq ) ) ]
475475#[ derive( Clone ) ]
476476pub ( crate ) enum ChannelMonitorUpdateStep {
477477 LatestHolderCommitmentTXInfo {
@@ -619,7 +619,7 @@ pub enum Balance {
619619}
620620
621621/// An HTLC which has been irrevocably resolved on-chain, and has reached ANTI_REORG_DELAY.
622- #[ derive( PartialEq ) ]
622+ #[ derive( PartialEq , Eq ) ]
623623struct IrrevocablyResolvedHTLC {
624624 commitment_tx_output_idx : Option < u32 > ,
625625 /// The txid of the transaction which resolved the HTLC, this may be a commitment (if the HTLC
@@ -824,6 +824,7 @@ pub type TransactionOutputs = (Txid, Vec<(u32, TxOut)>);
824824#[ cfg( any( test, fuzzing, feature = "_test_utils" ) ) ]
825825/// Used only in testing and fuzzing to check serialization roundtrips don't change the underlying
826826/// object
827+ impl < Signer : Sign > Eq for ChannelMonitor < Signer > { }
827828impl < Signer : Sign > PartialEq for ChannelMonitor < Signer > {
828829 fn eq ( & self , other : & Self ) -> bool {
829830 let inner = self . inner . lock ( ) . unwrap ( ) ;
@@ -835,6 +836,7 @@ impl<Signer: Sign> PartialEq for ChannelMonitor<Signer> {
835836#[ cfg( any( test, fuzzing, feature = "_test_utils" ) ) ]
836837/// Used only in testing and fuzzing to check serialization roundtrips don't change the underlying
837838/// object
839+ impl < Signer : Sign > Eq for ChannelMonitorImpl < Signer > { }
838840impl < Signer : Sign > PartialEq for ChannelMonitorImpl < Signer > {
839841 fn eq ( & self , other : & Self ) -> bool {
840842 if self . latest_update_id != other. latest_update_id ||
0 commit comments