added --privacy-flexible-groups-enabled alternative name (#1437)

* added --privacy-flexible-groups-enabled as an alias for --privacy-onchain-groups-enabled

Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
pull/1441/head
Sally MacFarlane 4 years ago committed by GitHub
parent e5f5e7f4d5
commit 68bf62dd1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 8
      besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java
  3. 23
      besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java

@ -33,6 +33,7 @@ Hyperledger Besu is moving its versioning scheme to [CalVer](https://calver.org/
* Added `--start-block` and `--end-block` to the `blocks import` subcommand [\#1399](https://github.com/hyperledger/besu/pull/1399)
* Added support for multi-tenancy when using the early access feature of [onchain privacy group management](https://besu.hyperledger.org/en/stable/Concepts/Privacy/Onchain-PrivacyGroups/)
* Fixed memory leak in eth/65 subprotocol behavior. It is now enabled by default. [\#1420](https://github.com/hyperledger/besu/pull/1420), [#1348](https://github.com/hyperledger/besu/pull/1348), [#1321](https://github.com/hyperledger/besu/pull/1321)
* Added `--privacy-flexible-groups-enabled` as an alternative for `--privacy-onchain-groups-enabled` CLI option
### Bug Fixes

@ -888,9 +888,9 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
private final Boolean migratePrivateDatabase = false;
@Option(
names = {"--privacy-onchain-groups-enabled"},
description = "Enable onchain privacy groups (default: ${DEFAULT-VALUE})")
private final Boolean isOnchainPrivacyGroupEnabled = false;
names = {"--privacy-flexible-groups-enabled", "--privacy-onchain-groups-enabled"},
description = "Enable flexible (onchain) privacy groups (default: ${DEFAULT-VALUE})")
private final Boolean isFlexiblePrivacyGroupsEnabled = false;
@Option(
names = {"--target-gas-limit"},
@ -1840,7 +1840,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
privacyParametersBuilder.setEnabled(true);
privacyParametersBuilder.setEnclaveUrl(privacyUrl);
privacyParametersBuilder.setMultiTenancyEnabled(isPrivacyMultiTenancyEnabled);
privacyParametersBuilder.setOnchainPrivacyGroupsEnabled(isOnchainPrivacyGroupEnabled);
privacyParametersBuilder.setOnchainPrivacyGroupsEnabled(isFlexiblePrivacyGroupsEnabled);
final boolean hasPrivacyPublicKey = privacyPublicKeyFile != null;
if (hasPrivacyPublicKey && !isPrivacyMultiTenancyEnabled) {

@ -3129,6 +3129,29 @@ public class BesuCommandTest extends CommandTestAbstract {
assertThat(privacyParameters.isOnchainPrivacyGroupsEnabled()).isEqualTo(true);
}
@Test
public void flexiblePrivacyGroupEnabledFlagValueIsSet() {
parseCommand(
"--privacy-enabled",
"--privacy-public-key-file",
ENCLAVE_PUBLIC_KEY_PATH,
"--privacy-flexible-groups-enabled",
"--min-gas-price",
"0");
final ArgumentCaptor<PrivacyParameters> privacyParametersArgumentCaptor =
ArgumentCaptor.forClass(PrivacyParameters.class);
verify(mockControllerBuilder).privacyParameters(privacyParametersArgumentCaptor.capture());
verify(mockControllerBuilder).build();
assertThat(commandOutput.toString()).isEmpty();
assertThat(commandErrorOutput.toString()).isEmpty();
final PrivacyParameters privacyParameters = privacyParametersArgumentCaptor.getValue();
assertThat(privacyParameters.isOnchainPrivacyGroupsEnabled()).isEqualTo(true);
}
@Test
public void privacyMarkerTransactionSigningKeyFileRequiredIfMinGasPriceNonZero() {
parseCommand("--privacy-enabled", "--privacy-public-key-file", ENCLAVE_PUBLIC_KEY_PATH);

Loading…
Cancel
Save