add deprecation warnings to help and log messages (#7902)

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
pull/7945/head
Sally MacFarlane 1 week ago committed by GitHub
parent 27592b5299
commit 58fbbe3c37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 20
      besu/src/main/java/org/hyperledger/besu/cli/options/PermissionsOptions.java

@ -56,32 +56,40 @@ public class PermissionsOptions {
"Account permissioning config TOML file (default: a file named \"permissions_config.toml\" in the Besu data folder)") "Account permissioning config TOML file (default: a file named \"permissions_config.toml\" in the Besu data folder)")
private String accountPermissionsConfigFile = null; private String accountPermissionsConfigFile = null;
private static final String DEPRECATION_PREFIX =
"Deprecated. Onchain permissioning is deprecated. See CHANGELOG for alternative options. ";
@CommandLine.Option( @CommandLine.Option(
names = {"--permissions-nodes-contract-address"}, names = {"--permissions-nodes-contract-address"},
description = "Address of the node permissioning smart contract", description = DEPRECATION_PREFIX + "Address of the node permissioning smart contract",
arity = "1") arity = "1")
private final Address permissionsNodesContractAddress = null; private final Address permissionsNodesContractAddress = null;
@CommandLine.Option( @CommandLine.Option(
names = {"--permissions-nodes-contract-version"}, names = {"--permissions-nodes-contract-version"},
description = "Version of the EEA Node Permissioning interface (default: ${DEFAULT-VALUE})") description =
DEPRECATION_PREFIX
+ "Version of the EEA Node Permissioning interface (default: ${DEFAULT-VALUE})")
private final Integer permissionsNodesContractVersion = 1; private final Integer permissionsNodesContractVersion = 1;
@CommandLine.Option( @CommandLine.Option(
names = {"--permissions-nodes-contract-enabled"}, names = {"--permissions-nodes-contract-enabled"},
description = "Enable node level permissions via smart contract (default: ${DEFAULT-VALUE})") description =
DEPRECATION_PREFIX
+ "Enable node level permissions via smart contract (default: ${DEFAULT-VALUE})")
private final Boolean permissionsNodesContractEnabled = false; private final Boolean permissionsNodesContractEnabled = false;
@CommandLine.Option( @CommandLine.Option(
names = {"--permissions-accounts-contract-address"}, names = {"--permissions-accounts-contract-address"},
description = "Address of the account permissioning smart contract", description = DEPRECATION_PREFIX + "Address of the account permissioning smart contract",
arity = "1") arity = "1")
private final Address permissionsAccountsContractAddress = null; private final Address permissionsAccountsContractAddress = null;
@CommandLine.Option( @CommandLine.Option(
names = {"--permissions-accounts-contract-enabled"}, names = {"--permissions-accounts-contract-enabled"},
description = description =
"Enable account level permissions via smart contract (default: ${DEFAULT-VALUE})") DEPRECATION_PREFIX
+ "Enable account level permissions via smart contract (default: ${DEFAULT-VALUE})")
private final Boolean permissionsAccountsContractEnabled = false; private final Boolean permissionsAccountsContractEnabled = false;
/** Default constructor. */ /** Default constructor. */
@ -151,6 +159,7 @@ public class PermissionsOptions {
SmartContractPermissioningConfiguration.createDefault(); SmartContractPermissioningConfiguration.createDefault();
if (Boolean.TRUE.equals(permissionsNodesContractEnabled)) { if (Boolean.TRUE.equals(permissionsNodesContractEnabled)) {
logger.warn("Onchain (contract) node permissioning options are " + DEPRECATION_PREFIX);
if (permissionsNodesContractAddress == null) { if (permissionsNodesContractAddress == null) {
throw new CommandLine.ParameterException( throw new CommandLine.ParameterException(
commandLine, commandLine,
@ -170,6 +179,7 @@ public class PermissionsOptions {
} }
if (Boolean.TRUE.equals(permissionsAccountsContractEnabled)) { if (Boolean.TRUE.equals(permissionsAccountsContractEnabled)) {
logger.warn("Onchain (contract) account permissioning options are " + DEPRECATION_PREFIX);
if (permissionsAccountsContractAddress == null) { if (permissionsAccountsContractAddress == null) {
throw new CommandLine.ParameterException( throw new CommandLine.ParameterException(
commandLine, commandLine,

Loading…
Cancel
Save