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
// 1. Check we can read a valid NodeAnnouncementInfo and fail on an invalid one
3250
-
let valid_netaddr = crate::ln::msgs::NetAddress::Hostname{hostname:crate::util::ser::Hostname::try_from("A".to_string()).unwrap(),port:1234};
3270
+
let announcement_message = hex::decode("d977cb9b53d93a6ff64bb5f1e158b4094b66e798fb12911168a3ccdf80a83096340a6a95da0ae8d9f776528eecdbb747eb6b545495a4319ed5378e35b21e073a000122013413a7031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f2020201010101010101010101010101010101010101010101010101010101010101010000701fffefdfc2607").unwrap();
3271
+
let announcement_message = NodeAnnouncement::read(&mut announcement_message.as_slice()).unwrap();
let encoded_invalid_node_ann_info = hex::decode("3f0009000788a000080a51a20204000000000403000000062000000000000000000000000000000000000000000000000000000000000000000a0505014004d2").unwrap();
3266
3287
let read_invalid_node_ann_info_res:Result<NodeAnnouncementInfo,crate::ln::msgs::DecodeError> = crate::util::ser::Readable::read(&mut encoded_invalid_node_ann_info.as_slice());
@@ -3281,6 +3302,15 @@ pub(crate) mod tests {
3281
3302
let read_invalid_node_info:NodeInfo = crate::util::ser::Readable::read(&mut encoded_invalid_node_info_hex.as_slice()).unwrap();
let old_ann_info_with_addresses = hex::decode("3f0009000708a000080a51220204000000000403000000062000000000000000000000000000000000000000000000000000000000000000000a0505014104d2").unwrap();
3309
+
let ann_info_with_addresses = NodeAnnouncementInfo::read(&mut old_ann_info_with_addresses.as_slice())
3310
+
.expect("to be able to read an old NodeAnnouncementInfo with addresses");
3311
+
// This serialized info has an address field but no announcement_message, therefore the addresses returned by our function will still be empty
0 commit comments