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
Next Next commit
test new pruning default
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
  • Loading branch information
RatanRSur committed Oct 24, 2019
commit dcf291dc28258ccd9c435f6c0a6b15b8633a842f
22 changes: 22 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 @@ -2316,6 +2316,28 @@ public void miningParametersAreCaptured() throws Exception {
.isEqualTo(BytesValue.fromHexString(extraDataString));
}

@Test
public void pruningIsEnabledIfSyncModeIsFast() {
parseCommand("--sync-mode", "FAST");

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

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

@Test
public void pruningIsDisabledIfSyncModeIsFull() {
parseCommand("--sync-mode", "FULL");

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

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

@Test
public void pruningIsEnabledWhenSpecified() throws Exception {
RatanRSur marked this conversation as resolved.
Show resolved Hide resolved
parseCommand("--pruning-enabled");
Expand Down