lightningdevkit / rust-lightning

A highly modular Bitcoin Lightning library written in Rust. It's rust-lightning, not Rusty's Lightning!
Other
1.11k stars 342 forks source link

Implement `Readable` for `Bolt12Invoice` #3143

Closed TheBlueMatt closed 1 week ago

TheBlueMatt commented 1 week ago

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

Because Bolt12Invoices 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.