Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PAN-2798] Enable pruning by default for fast sync #135

Merged
merged 10 commits into from
Nov 4, 2019
Prev Previous commit
add explicit tests for enable and disabling pruning
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
  • Loading branch information
RatanRSur committed Nov 4, 2019
commit d7518c201e691dfae32526d9779b7b4ee198abd9
13 changes: 12 additions & 1 deletion besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2349,7 +2349,7 @@ public void pruningIsDisabledIfSyncModeIsFull() {
}

@Test
public void pruningIsEnabledWhenSpecified() throws Exception {
public void pruningEnabledExplicitly() {
parseCommand("--pruning-enabled");

verify(mockControllerBuilder).isPruningEnabled(true);
Expand All @@ -2359,6 +2359,17 @@ public void pruningIsEnabledWhenSpecified() throws Exception {
assertThat(commandErrorOutput.toString()).isEmpty();
}

@Test
public void pruningDisabledExplicitly() {
parseCommand("--pruning-enabled=false");

verify(mockControllerBuilder).isPruningEnabled(false);
verify(mockControllerBuilder).build();

assertThat(commandOutput.toString()).isEmpty();
assertThat(commandErrorOutput.toString()).isEmpty();
}

@Test
public void pruningOptionsRequiresServiceToBeEnabled() {

Expand Down