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
Require length limited reader in impl_writeable_msg
See prior two commits.
When deserializing objects via this macro, there is no length prefix so the
deser code will read the provided reader until it runs out of bytes.
Readable is not an appropriate trait for this situation because it should only
be used for structs that are prefixed with a length and know when to stop
reading. LengthReadable instead requires that the caller supply only the bytes
that are reserved for this struct.
let target_value = <Vec<u8>>::from_hex("020202020202020202020202020202020202020202020202020202020202020200083a840000034dd977cb9b53d93a6ff64bb5f1e158b4094b66e798fb12911168a3ccdf80a83096340a6a95da0ae8d9f776528eecdbb747eb6b545495a4319ed5378e35b21e073a").unwrap();
let closing_signed_with_range = msgs::ClosingSigned{
4882
4882
channel_id:ChannelId::from_bytes([2;32]),
@@ -4890,7 +4890,7 @@ mod tests {
4890
4890
let encoded_value_with_range = closing_signed_with_range.encode();
4891
4891
let target_value_with_range = <Vec<u8>>::from_hex("020202020202020202020202020202020202020202020202020202020202020200083a840000034dd977cb9b53d93a6ff64bb5f1e158b4094b66e798fb12911168a3ccdf80a83096340a6a95da0ae8d9f776528eecdbb747eb6b545495a4319ed5378e35b21e073a011000000000deadbeef1badcafe01234567").unwrap();
let decoded_trampoline_packet:TrampolineOnionPacket = <TrampolineOnionPacketasLengthReadable>::read_from_fixed_length_buffer(&mut trampoline_packet_reader).unwrap();
5292
+
let decoded_trampoline_packet:TrampolineOnionPacket =
0 commit comments