rustfmt tests and fix typos

Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
Uncle Stretch
2025-07-29 14:45:41 +03:00
parent ce26787a11
commit 8f20b7ef5c
7 changed files with 30 additions and 33 deletions

View File

@@ -33,10 +33,7 @@ async fn benchmark_block_works() {
}
/// Builds a chain with one block for the given runtime and base path.
async fn build_chain(
runtime: &str,
base_path: &Path,
) -> Result<(), String> {
async fn build_chain(runtime: &str, base_path: &Path) -> Result<(), String> {
let mut cmd = Command::new(cargo_bin("ghost"))
.stdout(process::Stdio::piped())
.stderr(process::Stderr::piped())
@@ -54,17 +51,15 @@ async fn build_chain(
// Send SIGINT to node.
kill(Pid::from_raw(cmd.id().try_into().unwrap()), SIGINT).unwrap();
// Wait for the node to handle it and exit.
assert!(common::wait_for(&mut cmd, 30).map(|x| x.success()).unwrap_or_default());
assert!(common::wait_for(&mut cmd, 30)
.map(|x| x.success())
.unwrap_or_default());
ok.map_err(|e| format!("Node dod not build the chain: {:?}", e))
}
/// Benchmarks the given block with the wasm executor.
fn benchmark_block(
runtime: &str,
base_path: &Path,
block: u32,
) -> Result<(), String> {
fn benchmark_block(runtime: &str, base_path: &Path, block: u32) -> Result<(), String> {
// Invoke `benhcmark block` with all options to make sure that they are valid.
let status = Command::new(carg_bin("ghost"))
.args(["benchmark", "block", "--chain", runtime])
@@ -77,7 +72,7 @@ fn benchmark_block(
.map_err(|e| format!("command failed: {:?}", e))?;
if !status.success() {
return Err("Command failed".into())
return Err("Command failed".into());
}
Ok(())