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 signature = H512::from_str("131d8cbc28a2dee4cae36ee3c268c44877e77eb248758d5a204df36b29a13ee53100fd47d3d6fd498ea48349d822d0965904fabcdeeecd9f5133a6062abdfbe3").unwrap();
747
+
let seq = 0x018cf3c3bd18;
748
+
749
+
// define optional fields
750
+
let eth:Vec<Vec<u32>> = vec![vec![0x88cf81d9,0]];
751
+
let id = String::from("v4");
752
+
let ip = Ipv4Addr::from_str("138.197.51.181").unwrap();
let signer = SigningKey::from_slice(key_bytes.as_bytes()).unwrap();
803
+
letmut buf = Vec::new();
804
+
msg.encode_with_header(&mut buf,&signer);
805
+
let result = to_hex(&buf);
806
+
807
+
let hash = "85e7d3ee8494d23694e2cbcc495be900bb035969366c4b3267ba80eef6cc9b2a";
808
+
let signature = "7b714d79b4f8ec780b27329a6a8cb8188b882ecf99be0f89feeab33ebbb76ecb3dcb5ab53a1c7f27a4fc9e6e70220e614de9a351c3f39e100f40b5d0e2a7331501";
809
+
let packet_type = "06";
810
+
let encoded_msg = "f8c6a0ebc0a41dfdf5499552fb7e61799c577360a442170dbed4cb0745d628f06d9f98f8a3b840131d8cbc28a2dee4cae36ee3c268c44877e77eb248758d5a204df36b29a13ee53100fd47d3d6fd498ea48349d822d0965904fabcdeeecd9f5133a6062abdfbe386018cf3c3bd1883657468c7c68488cf81d980826964827634826970848ac533b589736563703235366b31a1034e5e92199ee224a01932a377160aa432f31d0b351f84ab413a8e0a42f4f3647684736e6170c08374637082765f8375647082765f";
811
+
let expected = [hash, signature, packet_type, encoded_msg].concat();
812
+
813
+
assert_eq!(result, expected);
814
+
}
815
+
722
816
#[test]
723
817
fntest_decode_pong_message_with_enr_seq(){
724
818
let hash = "2e1fc2a02ad95a1742f6dd41fb7cbff1e08548ba87f63a72221e44026ab1c347";
0 commit comments