Skip to content

Commit

Permalink
test: add retry test (#1373)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Sep 26, 2024
1 parent 165eb67 commit 4182585
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crates/transport/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,15 @@ impl RpcErrorExt for RpcError<TransportErrorKind> {
None
}
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test_retry_error() {
let err = "{\"code\":-32007,\"message\":\"100/second request limit reached - reduce calls per second or upgrade your account at quicknode.com\"}";
let err = serde_json::from_str::<ErrorPayload>(err).unwrap();
assert!(TransportError::ErrorResp(err).is_retryable());
}
}

0 comments on commit 4182585

Please sign in to comment.