From 5f120b1b651dd4e5082ba8c24646bf7332c93904 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 19 Jul 2023 20:22:41 +0000 Subject: [PATCH] Make `OffersMessage` and offers errors `Clone`able --- lightning/src/offers/parse.rs | 4 ++-- lightning/src/onion_message/offers.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lightning/src/offers/parse.rs b/lightning/src/offers/parse.rs index b722499f2..e9477086e 100644 --- a/lightning/src/offers/parse.rs +++ b/lightning/src/offers/parse.rs @@ -116,7 +116,7 @@ impl TryFrom> for ParsedMessage { } /// Error when parsing a bech32 encoded message using [`str::parse`]. -#[derive(Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq)] pub enum Bolt12ParseError { /// The bech32 encoding does not conform to the BOLT 12 requirements for continuing messages /// across multiple parts (i.e., '+' followed by whitespace). @@ -135,7 +135,7 @@ pub enum Bolt12ParseError { } /// Error when interpreting a TLV stream as a specific type. -#[derive(Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq)] pub enum Bolt12SemanticError { /// The current [`std::time::SystemTime`] is past the offer or invoice's expiration. AlreadyExpired, diff --git a/lightning/src/onion_message/offers.rs b/lightning/src/onion_message/offers.rs index 9a1f59b84..de373bda1 100644 --- a/lightning/src/onion_message/offers.rs +++ b/lightning/src/onion_message/offers.rs @@ -38,7 +38,7 @@ pub trait OffersMessageHandler { /// Possible BOLT 12 Offers messages sent and received via an [`OnionMessage`]. /// /// [`OnionMessage`]: crate::ln::msgs::OnionMessage -#[derive(Debug)] +#[derive(Clone, Debug)] pub enum OffersMessage { /// A request for a [`Bolt12Invoice`] for a particular [`Offer`]. /// -- 2.39.5