X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Foffers%2Finvoice_error.rs;h=f587b271d12d84e97031391044025f91df0dab65;hb=0211daa48ba8233ad7dbf2864ca72e0150051c68;hp=7345bc14d69b0a97b69e47e185a2b5ff716dcc07;hpb=f8c9b092fdeab598431a0d05e4ccb914c2ca0a4f;p=rust-lightning diff --git a/lightning/src/offers/invoice_error.rs b/lightning/src/offers/invoice_error.rs index 7345bc14..f587b271 100644 --- a/lightning/src/offers/invoice_error.rs +++ b/lightning/src/offers/invoice_error.rs @@ -11,7 +11,7 @@ use crate::io; use crate::ln::msgs::DecodeError; -use crate::offers::parse::SemanticError; +use crate::offers::parse::Bolt12SemanticError; use crate::util::ser::{HighZeroBytesDroppedBigSize, Readable, WithoutLength, Writeable, Writer}; use crate::util::string::UntrustedString; @@ -70,7 +70,7 @@ impl Writeable for InvoiceError { impl Readable for InvoiceError { fn read(reader: &mut R) -> Result { - _init_and_read_tlv_fields!(reader, { + _init_and_read_len_prefixed_tlv_fields!(reader, { (1, erroneous_field, (option, encoding: (u64, HighZeroBytesDroppedBigSize))), (3, suggested_value, (option, encoding: (Vec, WithoutLength))), (5, error, (option, encoding: (UntrustedString, WithoutLength))), @@ -93,8 +93,8 @@ impl Readable for InvoiceError { } } -impl From for InvoiceError { - fn from(error: SemanticError) -> Self { +impl From for InvoiceError { + fn from(error: Bolt12SemanticError) -> Self { InvoiceError { erroneous_field: None, message: UntrustedString(format!("{:?}", error)),