Expose sync mode option (#1270)

* Expose sync mode option

- remove `hidden` annotation attribute
- enable `syncModeOptionMustBeUsed` test
fix PAN-2525
fixes PAN-2525

* Update PantheonCommandTest.java

* expose fast sync min peers

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
Abdelhamid Bakhta 6 years ago committed by GitHub
parent e870ade816
commit 41ddaf3767
  1. 2
      pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java
  2. 12
      pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java

@ -232,7 +232,6 @@ public class PantheonCommand implements DefaultCommandValues, Runnable {
private final Collection<String> bannedNodeIds = new ArrayList<>();
@Option(
hidden = true,
names = {"--sync-mode"},
paramLabel = MANDATORY_MODE_FORMAT_HELP,
description =
@ -240,7 +239,6 @@ public class PantheonCommand implements DefaultCommandValues, Runnable {
private final SyncMode syncMode = DEFAULT_SYNC_MODE;
@Option(
hidden = true,
names = {"--fast-sync-min-peers"},
paramLabel = MANDATORY_INTEGER_FORMAT_HELP,
description =

@ -74,7 +74,6 @@ import io.vertx.core.json.JsonObject;
import net.consensys.cava.toml.Toml;
import net.consensys.cava.toml.TomlParseResult;
import org.apache.commons.text.StringEscapeUtils;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
@ -1042,7 +1041,6 @@ public class PantheonCommandTest extends CommandTestAbstract {
}
@Test
@Ignore
public void syncModeOptionMustBeUsed() {
parseCommand("--sync-mode", "FAST");
@ -1055,6 +1053,16 @@ public class PantheonCommandTest extends CommandTestAbstract {
assertThat(commandErrorOutput.toString()).isEmpty();
}
@Test
public void helpShouldDisplayFastSyncOptions() {
parseCommand("--help");
verifyZeroInteractions(mockRunnerBuilder);
assertThat(commandOutput.toString()).contains("--fast-sync-min-peers");
assertThat(commandErrorOutput.toString()).isEmpty();
}
@Test
public void parsesValidFastSyncTimeoutOption() {

Loading…
Cancel
Save