prevent startup with privacy and goquorum modes enabled together (#1879)

Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
pull/1883/head
Sally MacFarlane 4 years ago committed by GitHub
parent 055f7ce357
commit eb1475959a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java
  2. 17
      besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java

@ -2041,6 +2041,10 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
if (isPruningEnabled()) { if (isPruningEnabled()) {
throw new ParameterException(commandLine, String.format("%s %s", "Pruning", errorSuffix)); throw new ParameterException(commandLine, String.format("%s %s", "Pruning", errorSuffix));
} }
if (isGoQuorumCompatibilityMode) {
throw new ParameterException(
commandLine, String.format("%s %s", "GoQuorum mode", errorSuffix));
}
if (isPrivacyMultiTenancyEnabled if (isPrivacyMultiTenancyEnabled
&& !jsonRpcConfiguration.isAuthenticationEnabled() && !jsonRpcConfiguration.isAuthenticationEnabled()

@ -3413,6 +3413,23 @@ public class BesuCommandTest extends CommandTestAbstract {
assertThat(commandOutput.toString()).isEmpty(); assertThat(commandOutput.toString()).isEmpty();
} }
@Test
public void privacyWithGoQuorumModeMustError() throws IOException {
final Path genesisFile =
createFakeGenesisFile(VALID_GENESIS_QUORUM_INTEROP_ENABLED_WITH_CHAINID);
parseCommand(
"--goquorum-compatibility-enabled",
"--privacy-enabled",
"--genesis-file",
genesisFile.toString(),
"--min-gas-price",
"0");
assertThat(commandErrorOutput.toString())
.contains("GoQuorum mode cannot be enabled with privacy.");
assertThat(commandOutput.toString()).isEmpty();
}
@Rule public TemporaryFolder testFolder = new TemporaryFolder(); @Rule public TemporaryFolder testFolder = new TemporaryFolder();
@Test @Test

Loading…
Cancel
Save