From 3c558f04ace27582ae521a52c00e14a83fb43178 Mon Sep 17 00:00:00 2001 From: ObaniIsola Date: Fri, 29 May 2026 18:32:40 +0200 Subject: [PATCH] feat: validate batch argument item shape with detailed paths --- src/cli/commands.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cli/commands.rs b/src/cli/commands.rs index cbee9755..c6fd8a02 100644 --- a/src/cli/commands.rs +++ b/src/cli/commands.rs @@ -487,7 +487,8 @@ fn run_batch(args: &RunArgs, batch_file: &std::path::Path) -> Result<()> { logging::log_contract_loaded(wasm_bytes.len()); print_info(format!("Loading batch file: {:?}", batch_file)); - let batch_items = crate::batch::BatchExecutor::load_batch_file(batch_file)?; + let batch_items = crate::batch::BatchExecutor::load_batch_file(batch_file) + .with_context(|| format!("Failed to parse batch file {:?}. Expected a JSON array of objects, where each object contains an 'args' string field (and optional 'expected' or 'label' string fields).", batch_file))?; print_success(format!("Loaded {} test cases", batch_items.len())); if let Some(snapshot_path) = &args.network_snapshot {