Added --dev to substrate-node arguments.

This commit adds the `--dev` argument to the `substrate-node` to allow
the chain to keep advancing as time goes own. We have found that if this
option is not added then the chain won't advance forward.
This commit is contained in:
Omar Abdulla
2025-07-11 17:18:42 +03:00
parent f6374ad52a
commit 4bab457114
3 changed files with 36 additions and 1 deletions
+34 -1
View File
@@ -128,6 +128,7 @@ impl KitchensinkNode {
// Start Substrate node
let mut substrate_process = Command::new(&self.substrate_binary)
.arg("--dev")
.arg("--chain")
.arg(chainspec_path)
.arg("--base-path")
@@ -808,13 +809,14 @@ 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::KitchensinkNode;
use super::*;
use crate::{GENESIS_JSON, Node};
fn test_config() -> (Arguments, TempDir) {
@@ -829,6 +831,37 @@ 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#"