Fix unknown handling in `impl_writeable_tlv_based_enum_upgradable`
authorMatt Corallo <git@bluematt.me>
Tue, 26 Mar 2024 15:08:20 +0000 (15:08 +0000)
committerMatt Corallo <git@bluematt.me>
Sun, 7 Apr 2024 19:55:56 +0000 (19:55 +0000)
`impl_writeable_tlv_based_enum_upgradable` professed to supporting
upgrades by returning `None` from `MaybeReadable` when unknown
variants written by newer versions of LDK were read. However, it
generally didn't support this as it didn't discard bytes for
unknown types, resulting in corrupt reading.

This is fixed here for enum variants written as a TLV stream,
however we don't have a length prefix for tuple enum variants, so
the documentation on the macro is updated to mention that
downgrades are not supported for tuple variants.


No differences found