Skip to content

Commit

Permalink
[MINOR] removed shoulds (#924)
Browse files Browse the repository at this point in the history
* removed shoulds

* added P2P and RPC to coding conventions

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
  • Loading branch information
macfarla authored Feb 20, 2019
1 parent de56bcd commit 3090bfb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
4 changes: 3 additions & 1 deletion CODING-CONVENTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public static class RpcApisConversionException extends Exception {
// 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;

Expand Down Expand Up @@ -236,8 +236,7 @@ public static class RpcApisConversionException extends Exception {

@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(
Expand Down Expand Up @@ -268,19 +267,18 @@ public static class RpcApisConversionException extends Exception {
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(
Expand All @@ -304,7 +302,7 @@ public static class RpcApisConversionException extends Exception {
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;
Expand Down Expand Up @@ -333,12 +331,12 @@ private Long configureRefreshDelay(final Long refreshDelay) {
@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(
Expand All @@ -357,8 +355,7 @@ private Long configureRefreshDelay(final Long refreshDelay) {

@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(
Expand Down Expand Up @@ -406,7 +403,7 @@ private Long configureRefreshDelay(final Long refreshDelay) {

@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(
Expand Down Expand Up @@ -435,13 +432,12 @@ private Long configureRefreshDelay(final Long refreshDelay) {

@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(
Expand All @@ -452,7 +448,7 @@ private Long configureRefreshDelay(final Long refreshDelay) {

@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(
Expand Down Expand Up @@ -774,7 +770,7 @@ private PrivacyParameters privacyParameters() throws IOException {
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);
}
Expand Down

0 comments on commit 3090bfb

Please sign in to comment.