Compare commits

..

11 Commits

Author SHA1 Message Date
Omar Abdulla 3138ff67a1 Rename log_files -> logs_file_to_flush 2025-07-14 19:03:01 +03:00
Omar Abdulla c30c2277fd Flush the log files on drop 2025-07-14 17:52:55 +03:00
Omar Abdulla 4ff81e5452 Remove outdated comment 2025-07-14 17:29:25 +03:00
Omar Abdulla e2795cd5cd Revert the use of subprocess 2025-07-14 16:31:54 +03:00
Omar Abdulla 4d2759dc9a More consistent handling of open options 2025-07-14 14:40:01 +03:00
Omar Abdulla 7c978586e1 Separate stdout and stderr and use more consts. 2025-07-14 14:30:55 +03:00
Omar Abdulla 1081c569e8 Merge remote-tracking branch 'origin/main' into feature/persist-node-logs 2025-07-14 13:57:19 +03:00
Omar Abdulla a1ad9f2f95 Fix tests 2025-07-13 23:05:21 +03:00
Omar Abdulla d71b39dbfb Delete the node's db on shutdown but persist logs 2025-07-13 16:12:27 +03:00
Omar Abdulla 7c4dc3568e Fix clippy lints 2025-07-12 21:10:44 +03:00
Omar Abdulla 50e1f0ccdf Persist node logs 2025-07-12 21:04:29 +03:00
2 changed files with 1 additions and 35 deletions
-1
View File
@@ -25,4 +25,3 @@ sp-runtime = { workspace = true }
[dev-dependencies]
temp-dir = { workspace = true }
tokio = { workspace = true }
+1 -34
View File
@@ -166,7 +166,6 @@ impl KitchensinkNode {
.clone()
.open(self.kitchensink_stderr_log_file_path())?;
self.process_substrate = Command::new(&self.substrate_binary)
.arg("--dev")
.arg("--chain")
.arg(chainspec_path)
.arg("--base-path")
@@ -918,14 +917,13 @@ impl BlockHeader for KitchenSinkHeader {
#[cfg(test)]
mod tests {
use alloy::rpc::types::TransactionRequest;
use revive_dt_config::Arguments;
use std::path::PathBuf;
use temp_dir::TempDir;
use std::fs;
use super::*;
use super::KitchensinkNode;
use crate::{GENESIS_JSON, Node};
fn test_config() -> (Arguments, TempDir) {
@@ -940,37 +938,6 @@ mod tests {
(config, temp_dir)
}
#[tokio::test]
async fn node_mines_simple_transfer_transaction_and_returns_receipt() {
// Arrange
let (args, _temp_dir) = test_config();
let mut node = KitchensinkNode::new(&args);
node.spawn(GENESIS_JSON.to_owned())
.expect("Failed to spawn the node");
let provider = ProviderBuilder::new()
.network::<KitchenSinkNetwork>()
.wallet(args.wallet())
.connect(&node.rpc_url)
.await
.expect("Failed to create provider");
let account_address = args.wallet().default_signer().address();
let transaction = TransactionRequest::default()
.to(account_address)
.value(U256::from(100_000_000_000_000u128));
// Act
let receipt = provider.send_transaction(transaction).await;
// Assert
let _ = receipt
.expect("Failed to send the transfer transaction")
.get_receipt()
.await
.expect("Failed to get the receipt for the transfer");
}
#[test]
fn test_init_generates_chainspec_with_balances() {
let genesis_content = r#"