Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
ermalkaleci committed Mar 21, 2024
1 parent 1f9b81e commit aeb5ce2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/middlewares/methods/block_tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ mod tests {
Box::new(move |req: CallRequest, context| {
async move {
// cache bypassed, cannot determine finalized block
assert_eq!(bypass_cache(&context), true);
assert!(bypass_cache(&context));
// no replacement
assert_eq!(req.params, params);
Ok(json!("0x1111"))
Expand Down Expand Up @@ -280,7 +280,7 @@ mod tests {
Box::new(move |req: CallRequest, context| {
async move {
// cache bypassed for latest
assert_eq!(bypass_cache(&context), true);
assert!(bypass_cache(&context));
// latest block replaced with block number
assert_eq!(req.params, vec![json!("0x1234"), json!("0x4321")]);
Ok(json!("0x1111"))
Expand All @@ -301,7 +301,7 @@ mod tests {
Box::new(move |req: CallRequest, context| {
async move {
// cache bypassed, block tag not replaced
assert_eq!(bypass_cache(&context), true);
assert!(bypass_cache(&context));
// block tag not replaced
assert_eq!(req.params, vec![json!("0x1234"), json!("finalized")]);
Ok(json!("0x1111"))
Expand All @@ -325,7 +325,7 @@ mod tests {
Box::new(move |req: CallRequest, context| {
async move {
// cache not bypassed, finalized replaced with block number
assert_eq!(bypass_cache(&context), false);
assert!(!bypass_cache(&context));
// block tag replaced with block number
assert_eq!(req.params, vec![json!("0x1234"), json!("0x4321")]);
Ok(json!("0x1111"))
Expand All @@ -346,7 +346,7 @@ mod tests {
Box::new(move |req: CallRequest, context| {
async move {
// cache bypassed for latest
assert_eq!(bypass_cache(&context), true);
assert!(bypass_cache(&context));
// latest block replaced with block number
assert_eq!(req.params, vec![json!("0x1234"), json!("0x5432")]);
Ok(json!("0x1111"))
Expand Down
12 changes: 6 additions & 6 deletions src/middlewares/methods/inject_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ mod tests {
Box::new(move |req: CallRequest, context| {
async move {
// cache not bypassed
assert_eq!(bypass_cache(&context), false);
assert!(!bypass_cache(&context));
// block number is not finalized
assert_eq!(req.params, vec![json!("0x1234"), json!(0x4321)]);
Ok(json!("0x1111"))
Expand Down Expand Up @@ -556,7 +556,7 @@ mod tests {
Box::new(move |req: CallRequest, context| {
async move {
// cache bypassed
assert_eq!(bypass_cache(&context), true);
assert!(bypass_cache(&context));
// block number is injected
assert_eq!(req.params, vec![json!("0x1234"), json!(0x5432)]);
Ok(json!("0x1111"))
Expand All @@ -578,7 +578,7 @@ mod tests {
Box::new(move |req: CallRequest, context| {
async move {
// cache bypassed
assert_eq!(bypass_cache(&context), true);
assert!(bypass_cache(&context));
// params not changed
assert_eq!(req.params, vec![json!("0x1234"), json!(0x5432)]);
Ok(json!("0x1111"))
Expand All @@ -600,7 +600,7 @@ mod tests {
Box::new(move |req: CallRequest, context| {
async move {
// cache not bypassed
assert_eq!(bypass_cache(&context), false);
assert!(!bypass_cache(&context));
// params not changed
assert_eq!(req.params, vec![json!("0x1234"), json!(0x4321)]);
Ok(json!("0x1111"))
Expand All @@ -626,7 +626,7 @@ mod tests {
Box::new(move |req: CallRequest, context| {
async move {
// cache not bypassed
assert_eq!(bypass_cache(&context), false);
assert!(!bypass_cache(&context));
// params not changed
assert_eq!(req.params, vec![json!("0x1234"), json!(0x4321), json!("0xabcd")]);
Ok(json!("0x1111"))
Expand All @@ -649,7 +649,7 @@ mod tests {
Box::new(move |req: CallRequest, context| {
async move {
// cache bypassed
assert_eq!(bypass_cache(&context), true);
assert!(bypass_cache(&context));
// params not changed
assert_eq!(req.params, vec![json!("0x1234"), json!(0x5432), json!("0xabcd")]);
Ok(json!("0x1111"))
Expand Down

0 comments on commit aeb5ce2

Please sign in to comment.