Skip to content

Commit 95333f0

Browse files
committed
chore(deps): update udp cookie consts due the hasher fn udpate
The hasher function produces new hashes and that changes the final cookie used in the UDP tracker tests. It adds a function to generate new values and fix the test with the new values.
1 parent 33757e0 commit 95333f0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/servers/udp/connection_cookie.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,16 @@ mod tests {
178178

179179
#[test]
180180
fn it_should_make_a_connection_cookie() {
181-
// Note: This constant may need to be updated in the future as the hash is not guaranteed to to be stable between versions.
182-
const ID_COOKIE_OLD: Cookie = [23, 204, 198, 29, 48, 180, 62, 19];
183-
const ID_COOKIE_NEW: Cookie = [41, 166, 45, 246, 249, 24, 108, 203];
181+
// Note: This constant may need to be updated in the future as the hash
182+
// is not guaranteed to to be stable between versions.
183+
const ID_COOKIE_OLD_HASHER: Cookie = [41, 166, 45, 246, 249, 24, 108, 203];
184+
const ID_COOKIE_NEW_HASHER: Cookie = [185, 122, 191, 238, 6, 43, 2, 198];
184185

185186
clock::Stopped::local_set_to_unix_epoch();
186187

187188
let cookie = make(&SocketAddr::new(IpAddr::V4(Ipv4Addr::UNSPECIFIED), 0));
188189

189-
assert!(cookie == ID_COOKIE_OLD || cookie == ID_COOKIE_NEW);
190+
assert!(cookie == ID_COOKIE_OLD_HASHER || cookie == ID_COOKIE_NEW_HASHER);
190191
}
191192

192193
#[test]

0 commit comments

Comments
 (0)