Skip to content

Commit 1cf14d4

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

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lightning-invoice/src/lib.rs

Lines changed: 9 additions & 3 deletions
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
@@ -489,7 +489,7 @@ pub struct PayeePubKey(pub PublicKey);
489489
/// Positive duration that defines when (relatively to the timestamp) in the future the invoice
490490
/// expires
491491
#[derive(Clone, Debug, Hash, Eq, PartialEq, Ord, PartialOrd)]
492-
pub struct ExpiryTime(Duration);
492+
pub struct ExpiryTime(pub Duration);
493493

494494
/// `min_final_cltv_expiry_delta` to use for the last HTLC in the route
495495
#[derive(Clone, Debug, Hash, Eq, PartialEq, Ord, PartialOrd)]
@@ -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)