Skip to content

Commit

Permalink
fix(signatures): fix signature resolution failure case tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-Becker committed Jan 1, 2024
1 parent 303c500 commit cf58405
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions common/src/ether/signatures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,60 +353,60 @@ mod tests {
#[tokio::test]
async fn resolve_function_signature_should_return_none_when_cached_results_not_found() {
let signature = String::from("test_signature_nocache");
let result = ResolvedFunction::resolve(&signature).await.unwrap();
let result = ResolvedFunction::resolve(&signature).await;

assert_eq!(result, None,)
assert!(result.is_err());
}

#[tokio::test]
async fn resolve_function_signature_should_return_none_when_json_url_returns_empty_signatures()
{
let _ = delete_cache(&format!("selector.{}", "test_signature"));
let signature = String::from("test_signature");
let result = ResolvedFunction::resolve(&signature).await.unwrap();
assert_eq!(result, None);
let result = ResolvedFunction::resolve(&signature).await;
assert!(result.is_err());
}

#[tokio::test]
async fn resolve_error_signature_should_return_none_when_cached_results_not_found() {
let signature = String::from("test_signature_notfound");
let result = ResolvedError::resolve(&signature).await.unwrap();
assert_eq!(result, None);
let result = ResolvedError::resolve(&signature).await;
assert!(result.is_err());
}

#[tokio::test]
async fn resolve_error_signature_should_return_none_when_json_url_returns_none() {
let signature = String::from("test_signature_notfound");
let result = ResolvedError::resolve(&signature).await.unwrap();
assert_eq!(result, None);
let result = ResolvedError::resolve(&signature).await;
assert!(result.is_err());
}

#[tokio::test]
async fn resolve_error_signature_should_return_none_when_json_url_returns_empty_signatures() {
let signature = String::from("test_signature_notfound");
let result = ResolvedError::resolve(&signature).await.unwrap();
assert_eq!(result, None);
let result = ResolvedError::resolve(&signature).await;
assert!(result.is_err());
}

#[tokio::test]
async fn resolve_event_signature_should_return_none_when_cached_results_not_found() {
let signature = String::from("test_signature_notfound");
let result = ResolvedLog::resolve(&signature).await.unwrap();
assert_eq!(result, None);
let result = ResolvedLog::resolve(&signature).await;
assert!(result.is_err());
}

#[tokio::test]
async fn resolve_event_signature_should_return_none_when_json_url_returns_none() {
let signature = String::from("test_signature_notfound");
let result = ResolvedLog::resolve(&signature).await.unwrap();
assert_eq!(result, None);
let result = ResolvedLog::resolve(&signature).await;
assert!(result.is_err());
}

#[tokio::test]
async fn resolve_event_signature_should_return_none_when_json_url_returns_empty_signatures() {
let signature = String::from("test_signature_notfound");
let result = ResolvedLog::resolve(&signature).await.unwrap();
assert_eq!(result, None);
let result = ResolvedLog::resolve(&signature).await;
assert!(result.is_err());
}

#[test]
Expand Down

0 comments on commit cf58405

Please sign in to comment.