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
let read_chan_update_info_res:Result<ChannelUpdateInfo,::ln::msgs::DecodeError> = ::util::ser::Readable::read(&mutold_chan_update_info_with_none.as_slice());
let read_chan_update_info_res:Result<ChannelUpdateInfo,::ln::msgs::DecodeError> = ::util::ser::Readable::read(&mutlegacy_chan_update_info_with_none.as_slice());
2980
2982
assert!(read_chan_update_info_res.is_err());
2981
2983
2984
+
// 2. Test encoding/decoding of ChannelInfo
2982
2985
// Check we can encode/decode ChannelInfo without ChannelUpdateInfo fields present.
2983
2986
let chan_info_none_updates = ChannelInfo{
2984
2987
features:ChannelFeatures::known(),
@@ -2997,7 +3000,7 @@ mod tests {
2997
3000
let read_chan_info:ChannelInfo = ::util::ser::Readable::read(&mut encoded_chan_info.as_slice()).unwrap();
let legacy_chan_info_with_some:Vec<u8> = hex::decode("ca00020000010800000000000156660221027f921585f2ac0c7c70e36110adecfd8fd14b8a99bfb3d000a283fcac358fce88043636340004000000170201010402002a060800000000000004d2080909000000000000162e0a0d0c00040000000902040000000a0c010006210355f8d2238a322d16b602bd0ceaad5b01019fb055971eaadcc9b29226a4da6c23083636340004000000170201010402002a060800000000000004d2080909000000000000162e0a0d0c00040000000902040000000a0c01000a01000c0100").unwrap();
// Check we can decode legacy ChannelInfo, even if the `two_to_one`/`one_to_two` fields
3026
+
// fail to decode.
3027
+
let legacy_chan_info_with_none:Vec<u8> = hex::decode("ba00020000010800000000000156660221027f921585f2ac0c7c70e36110adecfd8fd14b8a99bfb3d000a283fcac358fce88042e2e2c0004000000170201010402002a060800000000000004d20801000a0d0c00040000000902040000000a0c010006210355f8d2238a322d16b602bd0ceaad5b01019fb055971eaadcc9b29226a4da6c23082e2e2c0004000000170201010402002a060800000000000004d20801000a0d0c00040000000902040000000a0c01000a01000c0100").unwrap();
3028
+
let read_chan_info:ChannelInfo = ::util::ser::Readable::read(&mut legacy_chan_info_with_none.as_slice()).unwrap();
0 commit comments