Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lightning/src/offers/invoice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,13 @@ impl TryFrom<Vec<u8>> for Bolt12Invoice {
}
}

impl Readable for Bolt12Invoice {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already implemented on line 1122 as part of #3078.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry, I missed that 🤦

fn read<R: io::Read>(reader: &mut R) -> Result<Self, DecodeError> {
let bytes: WithoutLength<Vec<u8>> = Readable::read(reader)?;
Self::try_from(bytes.0).map_err(|_| DecodeError::InvalidValue)
}
}

tlv_stream!(InvoiceTlvStream, InvoiceTlvStreamRef, 160..240, {
(160, paths: (Vec<BlindedPath>, WithoutLength, Iterable<'a, BlindedPathIter<'a>, BlindedPath>)),
(162, blindedpay: (Vec<BlindedPayInfo>, WithoutLength, Iterable<'a, BlindedPayInfoIter<'a>, BlindedPayInfo>)),
Expand Down