Skip to content

Commit

Permalink
test: fix broken connection tests
Browse files Browse the repository at this point in the history
  • Loading branch information
scsibug committed Sep 4, 2023
1 parent bacb850 commit da29bdd
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions tests/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ mod tests {
let challenge = client_conn.auth_challenge().unwrap();
let event = auth_event(challenge);

let result = client_conn.authenticate(&event, &RELAY.into());
let result = client_conn.authenticate(&event, RELAY.into());

assert!(matches!(result, Ok(())));
assert_eq!(client_conn.auth_challenge(), None);
Expand All @@ -67,7 +67,7 @@ mod tests {
assert_eq!(client_conn.auth_pubkey(), None);

let event = auth_event(&"challenge".into());
let result = client_conn.authenticate(&event, &RELAY.into());
let result = client_conn.authenticate(&event, RELAY.into());

assert!(matches!(result, Err(Error::AuthFailure)));
}
Expand All @@ -87,14 +87,14 @@ mod tests {
let challenge = client_conn.auth_challenge().unwrap().clone();

let event = auth_event(&challenge);
let result = client_conn.authenticate(&event, &RELAY.into());
let result = client_conn.authenticate(&event, RELAY.into());

assert!(matches!(result, Ok(())));
assert_eq!(client_conn.auth_challenge(), None);
assert_eq!(client_conn.auth_pubkey(), Some(&event.pubkey));

let event1 = auth_event(&challenge);
let result1 = client_conn.authenticate(&event1, &RELAY.into());
let result1 = client_conn.authenticate(&event1, RELAY.into());

assert!(matches!(result1, Ok(())));
assert_eq!(client_conn.auth_challenge(), None);
Expand All @@ -118,7 +118,7 @@ mod tests {
let mut event = auth_event(challenge);
event.sig = event.sig.chars().rev().collect::<String>();

let result = client_conn.authenticate(&event, &RELAY.into());
let result = client_conn.authenticate(&event, RELAY.into());

assert!(matches!(result, Err(Error::AuthFailure)));
}
Expand All @@ -138,7 +138,7 @@ mod tests {
let challenge = client_conn.auth_challenge().unwrap();
let event = auth_event_with_kind(challenge, 9999999999999999);

let result = client_conn.authenticate(&event, &RELAY.into());
let result = client_conn.authenticate(&event, RELAY.into());

assert!(matches!(result, Err(Error::AuthFailure)));
}
Expand All @@ -158,7 +158,7 @@ mod tests {
let challenge = client_conn.auth_challenge().unwrap();
let event = auth_event_with_created_at(challenge, unix_time() - 1200); // 20 minutes

let result = client_conn.authenticate(&event, &RELAY.into());
let result = client_conn.authenticate(&event, RELAY.into());

assert!(matches!(result, Err(Error::AuthFailure)));
}
Expand All @@ -178,7 +178,7 @@ mod tests {
let challenge = client_conn.auth_challenge().unwrap();
let event = auth_event_with_created_at(challenge, unix_time() + 1200); // 20 minutes

let result = client_conn.authenticate(&event, &RELAY.into());
let result = client_conn.authenticate(&event, RELAY.into());

assert!(matches!(result, Err(Error::AuthFailure)));
}
Expand All @@ -197,7 +197,7 @@ mod tests {

let event = auth_event_without_tags();

let result = client_conn.authenticate(&event, &RELAY.into());
let result = client_conn.authenticate(&event, RELAY.into());

assert!(matches!(result, Err(Error::AuthFailure)));
}
Expand All @@ -216,7 +216,7 @@ mod tests {

let event = auth_event_without_challenge();

let result = client_conn.authenticate(&event, &RELAY.into());
let result = client_conn.authenticate(&event, RELAY.into());

assert!(matches!(result, Err(Error::AuthFailure)));
}
Expand All @@ -236,7 +236,7 @@ mod tests {
let challenge = client_conn.auth_challenge().unwrap();
let event = auth_event_without_relay(challenge);

let result = client_conn.authenticate(&event, &RELAY.into());
let result = client_conn.authenticate(&event, RELAY.into());

assert!(matches!(result, Err(Error::AuthFailure)));
}
Expand All @@ -255,7 +255,7 @@ mod tests {

let event = auth_event(&"invalid challenge".into());

let result = client_conn.authenticate(&event, &RELAY.into());
let result = client_conn.authenticate(&event, RELAY.into());

assert!(matches!(result, Err(Error::AuthFailure)));
}
Expand All @@ -275,7 +275,7 @@ mod tests {
let challenge = client_conn.auth_challenge().unwrap();
let event = auth_event_with_relay(challenge, &"xyz".into());

let result = client_conn.authenticate(&event, &RELAY.into());
let result = client_conn.authenticate(&event, RELAY.into());

assert!(matches!(result, Err(Error::AuthFailure)));
}
Expand Down

0 comments on commit da29bdd

Please sign in to comment.