]> git.bitcoin.ninja Git - rust-lightning/commit
Implement `Readable` for `Bolt12Invoice` 2024-06-readable-invoices
authorMatt Corallo <git@bluematt.me>
Tue, 25 Jun 2024 14:26:25 +0000 (14:26 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 25 Jun 2024 14:26:25 +0000 (14:26 +0000)
commit0c157442b452325dd6997b2de78e24d60c541dd2
treea0a3b5e2d81cee5203f13a0ed48dd07c29d84017
parent88e1b56d66ff550b36a6d422f47c9b9729406f61
Implement `Readable` for `Bolt12Invoice`

In c13b6d814bfb5dd95f9e40f8ff07dd45c47a387e and
fc14495ac6a9dbe7dc9a6bd43c4395b599592db1 we implemented `Readable`
for `Refund` and `Offer`s, but didn't do so for `Bolt12Invoice`.

Because `Bolt12Invoice`s are not serializable to strings, we
generally expect users to read and write them as byte arrays, and
currently expose this via `TryFrom<Vec<u8>>`. This is fine, but
there's no reason to not implement `Readable` as well, and it
saves having to implement `TryFrom` in bindings.
lightning/src/offers/invoice.rs