From 9c0e73d8d6cf7fa5e53c930cfacb9deefd5ddfbd Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Wed, 18 Dec 2024 21:49:42 -0600 Subject: [PATCH] chore: clean up and cargo fmt --- Cargo.lock | 2 +- e2e-tests-rust/Cargo.lock | 4 +-- e2e-tests-rust/tests/lib.rs | 56 ++----------------------------------- 3 files changed, 5 insertions(+), 57 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b0713d6f..491ce9a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8632,4 +8632,4 @@ checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" dependencies = [ "cc", "pkg-config", -] +] \ No newline at end of file diff --git a/e2e-tests-rust/Cargo.lock b/e2e-tests-rust/Cargo.lock index 4740ff5d..96e3c7db 100644 --- a/e2e-tests-rust/Cargo.lock +++ b/e2e-tests-rust/Cargo.lock @@ -5066,9 +5066,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.27" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" dependencies = [ "base64 0.22.1", "bytes", diff --git a/e2e-tests-rust/tests/lib.rs b/e2e-tests-rust/tests/lib.rs index 616dde7e..5d40e388 100644 --- a/e2e-tests-rust/tests/lib.rs +++ b/e2e-tests-rust/tests/lib.rs @@ -580,58 +580,6 @@ async fn dump_state_on_run() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] -async fn dump_state_on_run() -> anyhow::Result<()> { - let temp_dir = TempDir::new("state-test").expect("failed creating temporary dir"); - let dump_path = temp_dir.path().join("state_dump.json"); - - let dump_path_clone = dump_path.clone(); - let provider = init_testing_provider(move |node| { - node - .path(get_node_binary_path()) - .arg("--state-interval") - .arg("1") - .arg("--dump-state") - .arg(dump_path_clone.to_str().unwrap()) - }) - .await?; - - provider.tx().finalize().await?; - - // Allow some time for the state to be dumped - sleep(Duration::from_secs(2)); - - drop(provider); - - assert!( - dump_path.exists(), - "State dump file should exist at {:?}", - dump_path - ); - - let dumped_data = fs::read_to_string(&dump_path)?; - let state: VersionedState = serde_json::from_str(&dumped_data) - .map_err(|e| anyhow::anyhow!("Failed to deserialize state: {}", e))?; - - match state { - VersionedState::V1 { version: _, state } => { - assert!( - !state.blocks.is_empty(), - "state_dump.json should contain at least one block" - ); - assert!( - !state.transactions.is_empty(), - "state_dump.json should contain at least one transaction" - ); - }, - VersionedState::Unknown { version } => { - panic!("Encountered unknown state version: {}", version); - } - } - - Ok(()) -} - #[tokio::test] async fn dump_state_on_fork() -> anyhow::Result<()> { let temp_dir = TempDir::new("state-fork-test").expect("failed creating temporary dir"); @@ -645,7 +593,7 @@ async fn dump_state_on_fork() -> anyhow::Result<()> { .arg("1") .arg("--dump-state") .arg(dump_path_clone.to_str().unwrap()) - .fork("mainnet") + .fork("sepolia-testnet") }) .await?; @@ -771,7 +719,7 @@ async fn load_state_on_fork() -> anyhow::Result<()> { .arg("1") .arg("--load-state") .arg(dump_path_clone.to_str().unwrap()) - .fork("mainnet") + .fork("sepolia-testnet") }) .await?;