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 target_value = hex::decode("0202020202020202020202020202020202020202020202020202020202020202000e727573742d6c696768746e696e67").unwrap();
2045
+
assert_eq!(encoded_value, target_value);
2046
+
}
2047
+
2048
+
#[test]
2049
+
fnencoding_ping(){
2050
+
let ping = msgs::Ping{
2051
+
ponglen:64,
2052
+
byteslen:64
2053
+
};
2054
+
let encoded_value = ping.encode();
2055
+
let target_value = hex::decode("0040004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").unwrap();
2056
+
assert_eq!(encoded_value, target_value);
2057
+
}
2058
+
2059
+
#[test]
2060
+
fnencoding_pong(){
2061
+
let pong = msgs::Pong{
2062
+
byteslen:64
2063
+
};
2064
+
let encoded_value = pong.encode();
2065
+
let target_value = hex::decode("004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").unwrap();
0 commit comments