From: benthecarman Date: Fri, 10 Nov 2023 22:12:43 +0000 (-0600) Subject: Make invoice fields public X-Git-Tag: v0.0.119~49^2~1 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=3def30721fbb7d530a2695e11f91e4c0fabee390;p=rust-lightning Make invoice fields public --- 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 {