Remove remnants of the old dev mode. (#1307)

It's now entirely handled through settings in the genesis config which --network DEV handles so no need for an additional boolean devMode flag.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
Adrian Sutton 6 years ago committed by GitHub
parent b5a269301e
commit db1115672d
  1. 1
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/node/ThreadPantheonNodeRunner.java
  2. 1
      pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java
  3. 15
      pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonControllerBuilder.java
  4. 1
      pantheon/src/test/java/tech/pegasys/pantheon/cli/CommandTestAbstract.java
  5. 3
      pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java

@ -72,7 +72,6 @@ public class ThreadPantheonNodeRunner implements PantheonNodeRunner {
.ethNetworkConfig(ethNetworkConfig)
.miningParameters(node.getMiningParameters())
.privacyParameters(node.getPrivacyParameters())
.devMode(node.isDevMode())
.nodePrivateKeyFile(KeyPairUtil.getDefaultKeyFile(node.homeDirectory()))
.metricsSystem(noOpMetricsSystem)
.maxPendingTransactions(PendingTransactions.MAX_PENDING_TRANSACTIONS)

@ -699,7 +699,6 @@ public class PantheonCommand implements DefaultCommandValues, Runnable {
.ethNetworkConfig(updateNetworkConfig(getNetwork()))
.miningParameters(
new MiningParameters(coinbase, minTransactionGasPrice, extraData, isMiningEnabled))
.devMode(NetworkName.DEV.equals(getNetwork()))
.maxPendingTransactions(txPoolMaxSize)
.nodePrivateKeyFile(nodePrivateKeyFile())
.metricsSystem(metricsSystem.get())

@ -41,7 +41,6 @@ public class PantheonControllerBuilder {
private Path homePath;
private EthNetworkConfig ethNetworkConfig;
private MiningParameters miningParameters;
private boolean devMode;
private File nodePrivateKeyFile;
private MetricsSystem metricsSystem;
private PrivacyParameters privacyParameters;
@ -80,11 +79,6 @@ public class PantheonControllerBuilder {
return this;
}
public PantheonControllerBuilder devMode(final boolean devMode) {
this.devMode = devMode;
return this;
}
public PantheonControllerBuilder nodePrivateKeyFile(final File nodePrivateKeyFile) {
this.nodePrivateKeyFile = nodePrivateKeyFile;
return this;
@ -124,13 +118,8 @@ public class PantheonControllerBuilder {
final StorageProvider storageProvider =
RocksDbStorageProvider.create(rocksDbConfiguration, metricsSystem);
final GenesisConfigFile genesisConfigFile;
if (devMode) {
genesisConfigFile = GenesisConfigFile.development();
} else {
final String genesisConfig = ethNetworkConfig.getGenesisConfig();
genesisConfigFile = GenesisConfigFile.fromConfig(genesisConfig);
}
final String genesisConfig = ethNetworkConfig.getGenesisConfig();
final GenesisConfigFile genesisConfigFile = GenesisConfigFile.fromConfig(genesisConfig);
final Clock clock = Clock.systemUTC();
return PantheonController.fromConfig(
genesisConfigFile,

@ -110,7 +110,6 @@ public abstract class CommandTestAbstract {
when(mockControllerBuilder.homePath(any())).thenReturn(mockControllerBuilder);
when(mockControllerBuilder.ethNetworkConfig(any())).thenReturn(mockControllerBuilder);
when(mockControllerBuilder.miningParameters(any())).thenReturn(mockControllerBuilder);
when(mockControllerBuilder.devMode(anyBoolean())).thenReturn(mockControllerBuilder);
when(mockControllerBuilder.maxPendingTransactions(any())).thenReturn(mockControllerBuilder);
when(mockControllerBuilder.nodePrivateKeyFile(any())).thenReturn(mockControllerBuilder);
when(mockControllerBuilder.metricsSystem(any())).thenReturn(mockControllerBuilder);

@ -161,7 +161,6 @@ public class PantheonCommandTest extends CommandTestAbstract {
verify(mockControllerBuilder).homePath(isNotNull());
verify(mockControllerBuilder).ethNetworkConfig(networkArg.capture());
verify(mockControllerBuilder).miningParameters(miningArg.capture());
verify(mockControllerBuilder).devMode(eq(false));
verify(mockControllerBuilder).nodePrivateKeyFile(isNotNull());
verify(mockControllerBuilder).build();
@ -605,7 +604,6 @@ public class PantheonCommandTest extends CommandTestAbstract {
verify(mockRunnerBuilder).metricsConfiguration(eq(metricsConfiguration));
verify(mockRunnerBuilder).build();
verify(mockControllerBuilder).devMode(eq(false));
verify(mockControllerBuilder)
.maxPendingTransactions(eq(PendingTransactions.MAX_PENDING_TRANSACTIONS));
verify(mockControllerBuilder).build();
@ -2002,7 +2000,6 @@ public class PantheonCommandTest extends CommandTestAbstract {
final ArgumentCaptor<EthNetworkConfig> networkArg =
ArgumentCaptor.forClass(EthNetworkConfig.class);
verify(mockControllerBuilder).devMode(eq(true));
verify(mockControllerBuilder).ethNetworkConfig(networkArg.capture());
verify(mockControllerBuilder).build();

Loading…
Cancel
Save