Skip to content

Commit

Permalink
Correct default --help values (hyperledger#7454)
Browse files Browse the repository at this point in the history
* Fix hyperledger#7367: Correct default value display for --rpc-max-trace-filter-range along with a test
* Fix hyperledger#7369: Show default value for --genesis-state-hash-cache-enabled

Signed-off-by: 7suyash7 <[email protected]>
  • Loading branch information
7suyash7 authored Aug 14, 2024
1 parent a3b6fd5 commit adf19af
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
3 changes: 2 additions & 1 deletion besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,8 @@ public class BesuCommand implements DefaultCommandValues, Runnable {

@Option(
names = {"--genesis-state-hash-cache-enabled"},
description = "Use genesis state hash from data on startup if specified")
description =
"Use genesis state hash from data on startup if specified (default: ${DEFAULT-VALUE})")
private final Boolean genesisStateHashCacheEnabled = false;

@Option(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public ApiConfigurationOptions() {}
@CommandLine.Option(
names = {"--rpc-max-trace-filter-range"},
description =
"Specifies the maximum number of blocks for the trace_filter method. Must be >=0. 0 specifies no limit (default: $DEFAULT-VALUE)")
"Specifies the maximum number of blocks for the trace_filter method. Must be >=0. 0 specifies no limit (default: ${DEFAULT-VALUE})")
private final Long maxTraceFilterRange = 1000L;

/**
Expand Down
12 changes: 12 additions & 0 deletions besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2503,4 +2503,16 @@ public void genesisStateHashCacheEnabledShouldWork() throws IOException {
assertThat(commandOutput.toString(UTF_8)).isEmpty();
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty();
}

@Test
void helpOutputShouldDisplayCorrectDefaultValues() {
parseCommand("--help");

final String commandOutputString = commandOutput.toString(UTF_8);
final String errorOutputString = commandErrorOutput.toString(UTF_8);

assertThat(commandOutputString).doesNotContain("$DEFAULT-VALUE");

assertThat(errorOutputString).isEmpty();
}
}

0 comments on commit adf19af

Please sign in to comment.