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
See previous commit.
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 hop_data = WithoutLength::<Vec<u8>>::read(&mut rd)?.0;
2015
+
let hop_data = WithoutLength::<Vec<u8>>::read_from_fixed_length_buffer(&mut rd)?.0;
2016
2016
2017
2017
let hmac = Readable::read(r)?;
2018
2018
@@ -4379,7 +4379,9 @@ mod tests {
4379
4379
let encoded_value = closing_signed.encode();
4380
4380
let target_value = <Vec<u8>>::from_hex("020202020202020202020202020202020202020202020202020202020202020200083a840000034dd977cb9b53d93a6ff64bb5f1e158b4094b66e798fb12911168a3ccdf80a83096340a6a95da0ae8d9f776528eecdbb747eb6b545495a4319ed5378e35b21e073a").unwrap();
let closing_signed_with_range = msgs::ClosingSigned{
4385
4387
channel_id:ChannelId::from_bytes([2;32]),
@@ -4393,7 +4395,9 @@ mod tests {
4393
4395
let encoded_value_with_range = closing_signed_with_range.encode();
4394
4396
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();
4803
+
let decoded_trampoline_packet:TrampolineOnionPacket =
0 commit comments