From 30013987f163e9498e078f2f69bb521413aa5cad Mon Sep 17 00:00:00 2001 From: yerke26 Date: Mon, 28 Oct 2024 16:02:29 +0600 Subject: [PATCH] set output alloc, result default values --- tools/evm/Program.cs | 4 ++-- tools/evm/T8NTool/T8NTool.cs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/evm/Program.cs b/tools/evm/Program.cs index 46ab94e0e8e..bd3f09bf228 100644 --- a/tools/evm/Program.cs +++ b/tools/evm/Program.cs @@ -19,10 +19,10 @@ static void ConfigureT8NCommand(ref RootCommand rootCmd) var inputAllocOpt = new Option("--input.alloc", description: "Input allocations", getDefaultValue: () => "alloc.json"); var inputEnvOpt = new Option("--input.env", description: "Input environment", getDefaultValue: () => "env.json"); var inputTxsOpt = new Option("--input.txs", description: "Input transactions", getDefaultValue: () => "txs.json"); - var outputAllocOpt = new Option("--output.alloc", description: "Output allocations"); + var outputAllocOpt = new Option("--output.alloc", description: "Output allocations", getDefaultValue: () => "alloc.json"); var outputBaseDirOpt = new Option("--output.basedir", description: "Output base directory"); var outputBodyOpt = new Option("--output.body", description: "Output body"); - var outputResultOpt = new Option("--output.result", description: "Output result"); + var outputResultOpt = new Option("--output.result", description: "Output result", getDefaultValue: () => "result.json"); var stateChainIdOpt = new Option("--state.chainid", description: "State chain id", getDefaultValue: () => 1); var stateForkOpt = new Option("--state.fork", description: "State fork", getDefaultValue: () => "GrayGlacier"); var stateRewardOpt = new Option("--state.reward", description: "State reward"); diff --git a/tools/evm/T8NTool/T8NTool.cs b/tools/evm/T8NTool/T8NTool.cs index fc101494f14..2a70d19d8e2 100644 --- a/tools/evm/T8NTool/T8NTool.cs +++ b/tools/evm/T8NTool/T8NTool.cs @@ -23,9 +23,9 @@ public T8NOutput Execute( string inputEnv, string inputTxs, string? outputBasedir, - string? outputAlloc, + string outputAlloc, string? outputBody, - string? outputResult, + string outputResult, ulong stateChainId, string stateFork, string? stateReward, @@ -39,10 +39,10 @@ public T8NOutput Execute( isGnosis, traceOptions); if (outputAlloc == "stdout") t8NOutput.Alloc = t8NExecutionResult.Alloc; - else if (outputAlloc != null) WriteToFile(outputAlloc, outputBasedir, t8NExecutionResult.Alloc); + else WriteToFile(outputAlloc, outputBasedir, t8NExecutionResult.Alloc); if (outputResult == "stdout") t8NOutput.Result = t8NExecutionResult.PostState; - else if (outputResult != null) WriteToFile(outputResult, outputBasedir, t8NExecutionResult.PostState); + else WriteToFile(outputResult, outputBasedir, t8NExecutionResult.PostState); if (outputBody == "stdout") t8NOutput.Body = t8NExecutionResult.Body; else if (outputBody != null) WriteToFile(outputBody, outputBasedir, t8NExecutionResult.Body);