projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a not-exported tag to the Display implementation for RawHrp
[rust-lightning]
/
lightning-invoice
/
src
/
ser.rs
diff --git
a/lightning-invoice/src/ser.rs
b/lightning-invoice/src/ser.rs
index fdff7f4f61cc56d93a8c2d1d0cdbf2e6ff78f05a..8811926782348a263735b55824ea74fb65d662cb 100644
(file)
--- a/
lightning-invoice/src/ser.rs
+++ b/
lightning-invoice/src/ser.rs
@@
-2,7
+2,8
@@
use std::fmt;
use std::fmt::{Display, Formatter};
use bech32::{ToBase32, u5, WriteBase32, Base32Len};
use std::fmt::{Display, Formatter};
use bech32::{ToBase32, u5, WriteBase32, Base32Len};
-use ::*;
+use super::{Invoice, Sha256, TaggedField, ExpiryTime, MinFinalCltvExpiry, Fallback, PayeePubKey, InvoiceSignature, PositiveTimestamp,
+ RouteHint, Description, RawTaggedField, Currency, RawHrp, SiPrefix, constants, SignedRawInvoice, RawDataPart};
/// Converts a stream of bytes written to it to base32. On finalization the according padding will
/// be applied. That means the results of writing two data blocks with one or two `BytesToBase32`
/// Converts a stream of bytes written to it to base32. On finalization the according padding will
/// be applied. That means the results of writing two data blocks with one or two `BytesToBase32`
@@
-122,6
+123,7
@@
impl Display for SignedRawInvoice {
}
}
}
}
+/// (C-not exported)
impl Display for RawHrp {
fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
let amount = match self.raw_amount {
impl Display for RawHrp {
fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
let amount = match self.raw_amount {
@@
-297,18
+299,6
@@
impl Base32Len for PayeePubKey {
}
}
}
}
-impl ToBase32 for PaymentSecret {
- fn write_base32<W: WriteBase32>(&self, writer: &mut W) -> Result<(), <W as WriteBase32>::Err> {
- (&self.0[..]).write_base32(writer)
- }
-}
-
-impl Base32Len for PaymentSecret {
- fn base32_len(&self) -> usize {
- bytes_size_to_base32_size(32)
- }
-}
-
impl ToBase32 for ExpiryTime {
fn write_base32<W: WriteBase32>(&self, writer: &mut W) -> Result<(), <W as WriteBase32>::Err> {
writer.write(&encode_int_be_base32(self.as_seconds()))
impl ToBase32 for ExpiryTime {
fn write_base32<W: WriteBase32>(&self, writer: &mut W) -> Result<(), <W as WriteBase32>::Err> {
writer.write(&encode_int_be_base32(self.as_seconds()))
@@
-461,7
+451,7
@@
impl ToBase32 for TaggedField {
}
}
}
}
-impl ToBase32 for Signature {
+impl ToBase32 for
Invoice
Signature {
fn write_base32<W: WriteBase32>(&self, writer: &mut W) -> Result<(), <W as WriteBase32>::Err> {
let mut converter = BytesToBase32::new(writer);
let (recovery_id, signature) = self.0.serialize_compact();
fn write_base32<W: WriteBase32>(&self, writer: &mut W) -> Result<(), <W as WriteBase32>::Err> {
let mut converter = BytesToBase32::new(writer);
let (recovery_id, signature) = self.0.serialize_compact();