Skip to content

Commit 8269c55

Browse files
committed
fix: clippy on test
1 parent 520b580 commit 8269c55

File tree

1 file changed

+11
-27
lines changed

1 file changed

+11
-27
lines changed

crates/anvil/tests/it/eip4844.rs

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -468,11 +468,8 @@ async fn test_beacon_api_get_blob_sidecars() {
468468
let gas_price = provider.get_gas_price().await.unwrap();
469469

470470
// Create multiple blob transactions to be included in the same block
471-
let blob_data = vec![
472-
b"Hello Beacon API - Blob 1",
473-
b"Hello Beacon API - Blob 2",
474-
b"Hello Beacon API - Blob 3",
475-
];
471+
let blob_data =
472+
[b"Hello Beacon API - Blob 1", b"Hello Beacon API - Blob 2", b"Hello Beacon API - Blob 3"];
476473

477474
let mut pending_txs = Vec::new();
478475

@@ -514,9 +511,7 @@ async fn test_beacon_api_get_blob_sidecars() {
514511
assert_eq!(
515512
receipt.block_number.unwrap(),
516513
block_number,
517-
"Transaction {} was not included in block {}",
518-
i,
519-
block_number
514+
"Transaction {i} was not included in block {block_number}"
520515
);
521516
}
522517

@@ -540,10 +535,10 @@ async fn test_beacon_api_get_blob_sidecars() {
540535

541536
// Verify blob structure for each blob
542537
for (i, blob) in blobs.iter().enumerate() {
543-
assert!(blob["index"].is_string(), "Blob {} missing index", i);
544-
assert!(blob["blob"].is_string(), "Blob {} missing blob data", i);
545-
assert!(blob["kzg_commitment"].is_string(), "Blob {} missing kzg_commitment", i);
546-
assert!(blob["kzg_proof"].is_string(), "Blob {} missing kzg_proof", i);
538+
assert!(blob["index"].is_string(), "Blob {i} missing index");
539+
assert!(blob["blob"].is_string(), "Blob {i} missing blob data");
540+
assert!(blob["kzg_commitment"].is_string(), "Blob {i} missing kzg_commitment");
541+
assert!(blob["kzg_proof"].is_string(), "Blob {i} missing kzg_proof");
547542
}
548543

549544
// Test filtering with indices query parameter - single index
@@ -556,7 +551,7 @@ async fn test_beacon_api_get_blob_sidecars() {
556551
let status = response.status();
557552
if status != reqwest::StatusCode::OK {
558553
let error_body = response.text().await.unwrap();
559-
panic!("Expected OK status, got {}: {}", status, error_body);
554+
panic!("Expected OK status, got {status}: {error_body}");
560555
}
561556
let body: serde_json::Value = response.json().await.unwrap();
562557
let filtered_blobs = body["data"].as_array().unwrap();
@@ -601,22 +596,11 @@ async fn test_beacon_api_get_blob_sidecars() {
601596
let url = format!("{}/eth/v1/beacon/blob_sidecars/{}", handle.http_endpoint(), block_id);
602597
assert_eq!(client.get(&url).send().await.unwrap().status(), reqwest::StatusCode::OK);
603598
}
604-
assert_eq!(
605-
client
606-
.get(&format!("{}/eth/v1/beacon/blob_sidecars/pending", handle.http_endpoint()))
607-
.send()
608-
.await
609-
.unwrap()
610-
.status(),
611-
reqwest::StatusCode::NOT_FOUND
612-
);
599+
let url = format!("{}/eth/v1/beacon/blob_sidecars/pending", handle.http_endpoint());
600+
assert_eq!(client.get(&url).send().await.unwrap().status(), reqwest::StatusCode::NOT_FOUND);
613601

614602
// Test with hex block number
615-
let url = format!(
616-
"{}/eth/v1/beacon/blob_sidecars/0x{}",
617-
handle.http_endpoint(),
618-
format!("{:x}", block_number)
619-
);
603+
let url = format!("{}/eth/v1/beacon/blob_sidecars/0x{block_number:x}", handle.http_endpoint());
620604
let response = client.get(&url).send().await.unwrap();
621605
assert_eq!(response.status(), reqwest::StatusCode::OK);
622606

0 commit comments

Comments
 (0)