From 3def30721fbb7d530a2695e11f91e4c0fabee390 Mon Sep 17 00:00:00 2001 From: benthecarman Date: Fri, 10 Nov 2023 16:12:43 -0600 Subject: [PATCH] Make invoice fields public --- lightning-invoice/src/lib.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lightning-invoice/src/lib.rs b/lightning-invoice/src/lib.rs index b2fe8a120..d283cba7a 100644 --- a/lightning-invoice/src/lib.rs +++ b/lightning-invoice/src/lib.rs @@ -479,7 +479,7 @@ impl Sha256 { /// /// # Invariants /// The description can be at most 639 __bytes__ long -#[derive(Clone, Debug, Hash, Eq, PartialEq, Ord, PartialOrd)] +#[derive(Clone, Debug, Hash, Eq, PartialEq, Ord, PartialOrd, Default)] pub struct Description(String); /// Payee public key @@ -529,7 +529,7 @@ impl Ord for Bolt11InvoiceSignature { /// The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops) /// #[derive(Clone, Debug, Hash, Eq, PartialEq, Ord, PartialOrd)] -pub struct PrivateRoute(RouteHint); +pub struct PrivateRoute(pub RouteHint); /// Tag constants as specified in BOLT11 #[allow(missing_docs)] @@ -1145,6 +1145,12 @@ impl PositiveTimestamp { } } +impl From for Duration { + fn from(val: PositiveTimestamp) -> Self { + val.0 + } +} + #[cfg(feature = "std")] impl From for SystemTime { fn from(val: PositiveTimestamp) -> Self { -- 2.39.5