|
|
|
@ -1706,6 +1706,42 @@ public class BesuCommandTest extends CommandTestAbstract { |
|
|
|
|
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void checkValidDefaultFastSyncMinPeersOption() { |
|
|
|
|
parseCommand("--sync-mode", "FAST"); |
|
|
|
|
verify(mockControllerBuilder).synchronizerConfiguration(syncConfigurationCaptor.capture()); |
|
|
|
|
|
|
|
|
|
final SynchronizerConfiguration syncConfig = syncConfigurationCaptor.getValue(); |
|
|
|
|
assertThat(syncConfig.getSyncMode()).isEqualTo(SyncMode.FAST); |
|
|
|
|
assertThat(syncConfig.getFastSyncMinimumPeerCount()).isEqualTo(5); |
|
|
|
|
assertThat(commandOutput.toString(UTF_8)).isEmpty(); |
|
|
|
|
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void checkValidDefaultFastSyncMinPeersPreMergeOption() { |
|
|
|
|
parseCommand("--sync-mode", "FAST", "--network", "CLASSIC"); |
|
|
|
|
verify(mockControllerBuilder).synchronizerConfiguration(syncConfigurationCaptor.capture()); |
|
|
|
|
|
|
|
|
|
final SynchronizerConfiguration syncConfig = syncConfigurationCaptor.getValue(); |
|
|
|
|
assertThat(syncConfig.getSyncMode()).isEqualTo(SyncMode.FAST); |
|
|
|
|
assertThat(syncConfig.getFastSyncMinimumPeerCount()).isEqualTo(5); |
|
|
|
|
assertThat(commandOutput.toString(UTF_8)).isEmpty(); |
|
|
|
|
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void checkValidDefaultFastSyncMinPeersPostMergeOption() { |
|
|
|
|
parseCommand("--sync-mode", "FAST", "--network", "GOERLI"); |
|
|
|
|
verify(mockControllerBuilder).synchronizerConfiguration(syncConfigurationCaptor.capture()); |
|
|
|
|
|
|
|
|
|
final SynchronizerConfiguration syncConfig = syncConfigurationCaptor.getValue(); |
|
|
|
|
assertThat(syncConfig.getSyncMode()).isEqualTo(SyncMode.FAST); |
|
|
|
|
assertThat(syncConfig.getFastSyncMinimumPeerCount()).isEqualTo(1); |
|
|
|
|
assertThat(commandOutput.toString(UTF_8)).isEmpty(); |
|
|
|
|
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void parsesValidFastSyncMinPeersOption() { |
|
|
|
|
parseCommand("--sync-mode", "FAST", "--fast-sync-min-peers", "11"); |
|
|
|
@ -1718,6 +1754,30 @@ public class BesuCommandTest extends CommandTestAbstract { |
|
|
|
|
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void parsesValidFastSyncMinPeersOptionPreMerge() { |
|
|
|
|
parseCommand("--sync-mode", "FAST", "--network", "CLASSIC", "--fast-sync-min-peers", "11"); |
|
|
|
|
verify(mockControllerBuilder).synchronizerConfiguration(syncConfigurationCaptor.capture()); |
|
|
|
|
|
|
|
|
|
final SynchronizerConfiguration syncConfig = syncConfigurationCaptor.getValue(); |
|
|
|
|
assertThat(syncConfig.getSyncMode()).isEqualTo(SyncMode.FAST); |
|
|
|
|
assertThat(syncConfig.getFastSyncMinimumPeerCount()).isEqualTo(11); |
|
|
|
|
assertThat(commandOutput.toString(UTF_8)).isEmpty(); |
|
|
|
|
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void parsesValidFastSyncMinPeersOptionPostMerge() { |
|
|
|
|
parseCommand("--sync-mode", "FAST", "--network", "GOERLI", "--fast-sync-min-peers", "11"); |
|
|
|
|
verify(mockControllerBuilder).synchronizerConfiguration(syncConfigurationCaptor.capture()); |
|
|
|
|
|
|
|
|
|
final SynchronizerConfiguration syncConfig = syncConfigurationCaptor.getValue(); |
|
|
|
|
assertThat(syncConfig.getSyncMode()).isEqualTo(SyncMode.FAST); |
|
|
|
|
assertThat(syncConfig.getFastSyncMinimumPeerCount()).isEqualTo(11); |
|
|
|
|
assertThat(commandOutput.toString(UTF_8)).isEmpty(); |
|
|
|
|
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void parsesInvalidFastSyncMinPeersOptionWrongFormatShouldFail() { |
|
|
|
|
|
|
|
|
|