From b536d01702bf126f97470a48a6be4f3c97057848 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 26 Jan 2023 01:51:43 +0000 Subject: [PATCH] Implement `PartialEq`/`Eq` for `Event`s --- lightning/src/routing/router.rs | 2 +- lightning/src/util/events.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lightning/src/routing/router.rs b/lightning/src/routing/router.rs index 8543956ac..1e2ca10c0 100644 --- a/lightning/src/routing/router.rs +++ b/lightning/src/routing/router.rs @@ -363,7 +363,7 @@ impl Readable for Route { /// [`Event::PaymentPathFailed`] for retrying a failed payment path. /// /// [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct RouteParameters { /// The parameters of the failed payment path. pub payment_params: PaymentParameters, diff --git a/lightning/src/util/events.rs b/lightning/src/util/events.rs index 432a532d6..475533c90 100644 --- a/lightning/src/util/events.rs +++ b/lightning/src/util/events.rs @@ -46,7 +46,7 @@ use crate::sync::Arc; /// Some information provided on receipt of payment depends on whether the payment received is a /// spontaneous payment or a "conventional" lightning payment that's paying an invoice. -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq, Eq)] pub enum PaymentPurpose { /// Information for receiving a payment that we generated an invoice for. InvoicePayment { @@ -455,7 +455,7 @@ impl_writeable_tlv_based_enum!(InterceptNextHop, /// Note that while Writeable and Readable are implemented for Event, you probably shouldn't use /// them directly as they don't round-trip exactly (for example FundingGenerationReady is never /// written as it makes no sense to respond to it after reconnecting to peers). -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq, Eq)] pub enum Event { /// Used to indicate that the client should generate a funding transaction with the given /// parameters and then call [`ChannelManager::funding_transaction_generated`]. -- 2.39.5