Skip to content

Commit 3def307

Browse files
committed
Make invoice fields public
1 parent 3fbfde3 commit 3def307

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lightning-invoice/src/lib.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ impl Sha256 {
479479
///
480480
/// # Invariants
481481
/// The description can be at most 639 __bytes__ long
482-
#[derive(Clone, Debug, Hash, Eq, PartialEq, Ord, PartialOrd)]
482+
#[derive(Clone, Debug, Hash, Eq, PartialEq, Ord, PartialOrd, Default)]
483483
pub struct Description(String);
484484

485485
/// Payee public key
@@ -529,7 +529,7 @@ impl Ord for Bolt11InvoiceSignature {
529529
/// The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
530530
///
531531
#[derive(Clone, Debug, Hash, Eq, PartialEq, Ord, PartialOrd)]
532-
pub struct PrivateRoute(RouteHint);
532+
pub struct PrivateRoute(pub RouteHint);
533533

534534
/// Tag constants as specified in BOLT11
535535
#[allow(missing_docs)]
@@ -1145,6 +1145,12 @@ impl PositiveTimestamp {
11451145
}
11461146
}
11471147

1148+
impl From<PositiveTimestamp> for Duration {
1149+
fn from(val: PositiveTimestamp) -> Self {
1150+
val.0
1151+
}
1152+
}
1153+
11481154
#[cfg(feature = "std")]
11491155
impl From<PositiveTimestamp> for SystemTime {
11501156
fn from(val: PositiveTimestamp) -> Self {

0 commit comments

Comments
 (0)