[MINOR] removed shoulds (#924)

* removed shoulds

* added P2P and RPC to coding conventions

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
Sally MacFarlane 6 years ago committed by GitHub
parent de56bcde42
commit 3090bfbaf5
  1. 4
      CODING-CONVENTIONS.md
  2. 32
      pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

@ -66,7 +66,7 @@ To create understandable, self-documenting code:
- Keep methods and classes short and focused on a single responsibility. Preferable maximum lengths:
* Lambdas: 1 - 3 lines
* Methods: less than 50 lines
* Anonymous classes: less than a 50 lines
* Anonymous classes: less than 50 lines
* Inner classes: not much more than 50 lines
* Classes: a few hundred lines
- Be thoughtfully organised in terms of method order, package structure, and module usage
@ -78,6 +78,8 @@ To create understandable, self-documenting code:
* tx -> Transaction
* IBFT -> Istanbul Byzantine Fault Tolerant (a consensus protocol)
* EVM -> Ethereum Virtual Machine
* P2P -> Peer to Peer
* RPC -> Remote Procedure Call
# 3.2 Creating Code for Constant Refactoring and Evolving Design

@ -148,7 +148,7 @@ public class PantheonCommand implements DefaultCommandValues, Runnable {
// Completely disables P2P within Pantheon.
@Option(
names = {"--p2p-enabled"},
description = "Enable/disable all P2P functionality (default: ${DEFAULT-VALUE})",
description = "Enable P2P functionality (default: ${DEFAULT-VALUE})",
arity = "1")
private final Boolean p2pEnabled = true;
@ -236,8 +236,7 @@ public class PantheonCommand implements DefaultCommandValues, Runnable {
@Option(
names = {"--rpc-http-enabled"},
description =
"Set if the JSON-RPC HTTP service should be started (default: ${DEFAULT-VALUE})")
description = "Set to start the JSON-RPC HTTP service (default: ${DEFAULT-VALUE})")
private final Boolean isRpcHttpEnabled = false;
@Option(
@ -268,19 +267,18 @@ public class PantheonCommand implements DefaultCommandValues, Runnable {
arity = "1..*",
converter = RpcApisConverter.class,
description =
"Comma separated APIs to enable on JSON-RPC HTTP service (default: ${DEFAULT-VALUE})")
"Comma separated list of APIs to enable on JSON-RPC HTTP service (default: ${DEFAULT-VALUE})")
private final Collection<RpcApi> rpcHttpApis = DEFAULT_JSON_RPC_APIS;
@Option(
names = {"--rpc-http-authentication-enabled"},
description =
"Set if the JSON-RPC HTTP service should require authentication (default: ${DEFAULT-VALUE})")
"Require authentication for the JSON-RPC HTTP service (default: ${DEFAULT-VALUE})")
private final Boolean isRpcHttpAuthenticationEnabled = false;
@Option(
names = {"--rpc-ws-enabled"},
description =
"Set if the JSON-RPC WebSocket service should be started (default: ${DEFAULT-VALUE})")
description = "Set to start the JSON-RPC WebSocket service (default: ${DEFAULT-VALUE})")
private final Boolean isRpcWsEnabled = false;
@Option(
@ -304,7 +302,7 @@ public class PantheonCommand implements DefaultCommandValues, Runnable {
arity = "1..*",
converter = RpcApisConverter.class,
description =
"Comma separated APIs to enable on JSON-RPC WebSocket service (default: ${DEFAULT-VALUE})")
"Comma separated list of APIs to enable on JSON-RPC WebSocket service (default: ${DEFAULT-VALUE})")
private final Collection<RpcApi> rpcWsApis = DEFAULT_JSON_RPC_APIS;
private Long rpcWsRefreshDelay;
@ -333,12 +331,12 @@ public class PantheonCommand implements DefaultCommandValues, Runnable {
@Option(
names = {"--rpc-ws-authentication-enabled"},
description =
"Set if the JSON-RPC WebSocket service should require authentication (default: ${DEFAULT-VALUE})")
"Require authentication for the JSON-RPC WebSocket service (default: ${DEFAULT-VALUE})")
private final Boolean isRpcWsAuthenticationEnabled = false;
@Option(
names = {"--metrics-enabled"},
description = "Set if the metrics exporter should be started (default: ${DEFAULT-VALUE})")
description = "Set to start the metrics exporter (default: ${DEFAULT-VALUE})")
private final Boolean isMetricsEnabled = false;
@Option(
@ -357,8 +355,7 @@ public class PantheonCommand implements DefaultCommandValues, Runnable {
@Option(
names = {"--metrics-push-enabled"},
description =
"Set if the metrics push gateway integration should be started (default: ${DEFAULT-VALUE})")
description = "Enable the metrics push gateway integration (default: ${DEFAULT-VALUE})")
private final Boolean isMetricsPushEnabled = false;
@Option(
@ -406,7 +403,7 @@ public class PantheonCommand implements DefaultCommandValues, Runnable {
@Option(
names = {"--miner-enabled"},
description = "Set if node should perform mining (default: ${DEFAULT-VALUE})")
description = "Set if node will perform mining (default: ${DEFAULT-VALUE})")
private final Boolean isMiningEnabled = false;
@Option(
@ -435,13 +432,12 @@ public class PantheonCommand implements DefaultCommandValues, Runnable {
@Option(
names = {"--permissions-nodes-enabled"},
description = "Set if node level permissions should be enabled (default: ${DEFAULT-VALUE})")
description = "Enable node level permissions (default: ${DEFAULT-VALUE})")
private final Boolean permissionsNodesEnabled = false;
@Option(
names = {"--permissions-accounts-enabled"},
description =
"Set if account level permissions should be enabled (default: ${DEFAULT-VALUE})")
description = "Enable account level permissions (default: ${DEFAULT-VALUE})")
private final Boolean permissionsAccountsEnabled = false;
@Option(
@ -452,7 +448,7 @@ public class PantheonCommand implements DefaultCommandValues, Runnable {
@Option(
names = {"--privacy-enabled"},
description = "Set if private transaction should be enabled (default: ${DEFAULT-VALUE})")
description = "Enable private transactions (default: ${DEFAULT-VALUE})")
private final Boolean privacyEnabled = false;
@Option(
@ -774,7 +770,7 @@ public class PantheonCommand implements DefaultCommandValues, Runnable {
privacyParameters.setPublicKeyUsingFile(privacyPublicKeyFile());
} else {
throw new ParameterException(
commandLine, "Please specify Enclave public Key file path to Enable Privacy");
commandLine, "Please specify Enclave public key file path to enable privacy");
}
privacyParameters.setPrivacyAddress(privacyPrecompiledAddress);
}

Loading…
Cancel
Save