Skip to content

Commit

Permalink
Fix hyperledger#7367: Correct default value display for --rpc-max-tra…
Browse files Browse the repository at this point in the history
…ce-filter-range along with a test

Signed-off-by: 7suyash7 <[email protected]>
  • Loading branch information
7suyash7 committed Aug 13, 2024
1 parent c61cf0b commit c113d8a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
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
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 c113d8a

Please sign in to comment.