You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ser: support LengthLimitedRead in impl_writeable_tlv_based_enum
When introducing the LengthLimitedRead trait in [1], for some
serialization macros we need some temporary workaround to
avoid that we have the following compilation error
error[E0277]: the trait bound `Bolt12Invoice: Readable` is not satisfied
--> lightning/src/util/ser_macros.rs:1243:35
|
1243 | Ok($st::$tuple_variant_name($crate::util::ser::Readable::read(reader)?))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Readable` is not implemented for `Bolt12Invoice`
|
::: lightning/src/events/mod.rs:2463:1
|
2463 | / impl_writeable_tlv_based_enum_legacy!(PaidInvoice,
2464 | | ;
2465 | | (0, Bolt12Invoice),
2466 | | (2, StaticInvoice)
2467 | | );
| |_- in this macro invocation
|
= help: the following other types implement trait `Readable`:
()
(A, B)
(A, B, C)
(A, B, C, D)
(A, B, C, D, E)
(A, B, C, D, E, F)
(A, B, C, D, E, F, G)
AnnouncementSigsState
and 200 others
= note: this error originates in the macro `impl_writeable_tlv_based_enum_legacy` (in Nightly builds, run with -Z macro-backtrace for more info)
This is a temporary workaround to avoid introducing a big refactoring right now.
[1] lightningdevkit#3640
Co-Developed-by: @valentinewallace
Suggested-by: @valentinewallace
Signed-off-by: Vincenzo Palazzo <[email protected]>
0 commit comments