Fix tests & clear node directories before startup

This commit is contained in:
Omar Abdulla
2025-08-01 13:09:47 +03:00
parent c2c3e81125
commit 57ba765aa2
17 changed files with 146 additions and 59 deletions
+1
View File
@@ -14,6 +14,7 @@ alloy = { workspace = true }
tracing = { workspace = true }
tokio = { workspace = true }
revive-dt-common = { workspace = true }
revive-dt-config = { workspace = true }
revive-dt-format = { workspace = true }
revive-dt-node-interaction = { workspace = true }
+4
View File
@@ -25,6 +25,7 @@ use alloy::{
},
signers::local::PrivateKeySigner,
};
use revive_dt_common::fs::clear_directory;
use revive_dt_config::Arguments;
use revive_dt_format::traits::ResolverApi;
use revive_dt_node_interaction::EthereumNode;
@@ -80,6 +81,9 @@ impl Instance {
/// Create the node directory and call `geth init` to configure the genesis.
#[tracing::instrument(skip_all, fields(geth_node_id = self.id))]
fn init(&mut self, genesis: String) -> anyhow::Result<&mut Self> {
clear_directory(&self.base_directory)?;
clear_directory(&self.logs_directory)?;
create_dir_all(&self.base_directory)?;
create_dir_all(&self.logs_directory)?;
+4
View File
@@ -30,6 +30,7 @@ use alloy::{
},
signers::local::PrivateKeySigner,
};
use revive_dt_common::fs::clear_directory;
use revive_dt_format::traits::ResolverApi;
use serde::{Deserialize, Serialize};
use serde_json::{Value as JsonValue, json};
@@ -85,6 +86,9 @@ impl KitchensinkNode {
#[tracing::instrument(skip_all, fields(kitchensink_node_id = self.id))]
fn init(&mut self, genesis: &str) -> anyhow::Result<&mut Self> {
clear_directory(&self.base_directory)?;
clear_directory(&self.logs_directory)?;
create_dir_all(&self.base_directory)?;
create_dir_all(&self.logs_directory)?;