Add support for including `ignorable` types in enum de/ser macros
authorMatt Corallo <git@bluematt.me>
Tue, 22 Nov 2022 22:41:13 +0000 (22:41 +0000)
committerMatt Corallo <git@bluematt.me>
Sun, 15 Jan 2023 20:28:42 +0000 (20:28 +0000)
commita03db3ca309413c3408f5971b5ed5a8020422a81
tree30574013f2fb114c3d1f09632914b20c2cd3fac2
parent7fd9b33c09d09f83c1712b1d8348cc0c67eee746
Add support for including `ignorable` types in enum de/ser macros

An enum implements de/serialization via
`impl_writeable_tlv_based_enum_upgradable` currently cannot contain
an object that only implements `MaybeReadable`.

This solves that by implementing the required blocks for
`ignorable`, opting to return `Ok(None)` in the top-level read in
cases where the inner field read returns `Ok(None)`.
lightning/src/util/ser_macros.rs