Skip to content

Commit 99548c9

Browse files
committed
fix: clippy on test
1 parent 520b580 commit 99548c9

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

crates/anvil/tests/it/eip4844.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ 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![
471+
let blob_data = [
472472
b"Hello Beacon API - Blob 1",
473473
b"Hello Beacon API - Blob 2",
474474
b"Hello Beacon API - Blob 3",
@@ -514,9 +514,7 @@ async fn test_beacon_api_get_blob_sidecars() {
514514
assert_eq!(
515515
receipt.block_number.unwrap(),
516516
block_number,
517-
"Transaction {} was not included in block {}",
518-
i,
519-
block_number
517+
"Transaction {i} was not included in block {block_number}"
520518
);
521519
}
522520

@@ -540,10 +538,10 @@ async fn test_beacon_api_get_blob_sidecars() {
540538

541539
// Verify blob structure for each blob
542540
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);
541+
assert!(blob["index"].is_string(), "Blob {i} missing index");
542+
assert!(blob["blob"].is_string(), "Blob {i} missing blob data");
543+
assert!(blob["kzg_commitment"].is_string(), "Blob {i} missing kzg_commitment");
544+
assert!(blob["kzg_proof"].is_string(), "Blob {i} missing kzg_proof");
547545
}
548546

549547
// Test filtering with indices query parameter - single index
@@ -556,7 +554,7 @@ async fn test_beacon_api_get_blob_sidecars() {
556554
let status = response.status();
557555
if status != reqwest::StatusCode::OK {
558556
let error_body = response.text().await.unwrap();
559-
panic!("Expected OK status, got {}: {}", status, error_body);
557+
panic!("Expected OK status, got {status}: {error_body}");
560558
}
561559
let body: serde_json::Value = response.json().await.unwrap();
562560
let filtered_blobs = body["data"].as_array().unwrap();
@@ -601,9 +599,10 @@ async fn test_beacon_api_get_blob_sidecars() {
601599
let url = format!("{}/eth/v1/beacon/blob_sidecars/{}", handle.http_endpoint(), block_id);
602600
assert_eq!(client.get(&url).send().await.unwrap().status(), reqwest::StatusCode::OK);
603601
}
602+
let url = format!("{}/eth/v1/beacon/blob_sidecars/pending", handle.http_endpoint());
604603
assert_eq!(
605604
client
606-
.get(&format!("{}/eth/v1/beacon/blob_sidecars/pending", handle.http_endpoint()))
605+
.get(&url)
607606
.send()
608607
.await
609608
.unwrap()
@@ -613,9 +612,8 @@ async fn test_beacon_api_get_blob_sidecars() {
613612

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

0 commit comments

Comments
 (0)