[MINOR] add genesis file name to config overview (#6297)

* add genesis file name to config overview

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

---------

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
pull/6309/head
Sally MacFarlane 11 months ago committed by GitHub
parent c9a41fa3e3
commit 0a98df2f11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 3
      besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java
  3. 16
      besu/src/main/java/org/hyperledger/besu/cli/ConfigurationOverviewBuilder.java
  4. 3
      besu/src/test/java/org/hyperledger/besu/cli/ConfigurationOverviewBuilderTest.java

@ -11,6 +11,7 @@
- Add error messages on authentication failures with username and password [#6212](https://github.com/hyperledger/besu/pull/6212)
- New `Sequenced` transaction pool. The pool is an evolution of the `legacy` pool and is likely to be more suitable to enterprise or permissioned chains than the `layered` transaction pool. Select to use this pool with `--tx-pool=sequenced`. Supports the same options as the `legacy` pool [#6211](https://github.com/hyperledger/besu/issues/6211)
- Set Ethereum Classic mainnet activation block for Spiral network upgrade [#6267](https://github.com/hyperledger/besu/pull/6267)
- Add custom genesis file name to config overview if specified [#6297](https://github.com/hyperledger/besu/pull/6297)
### Bug fixes

@ -3526,6 +3526,9 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
}
builder.setHasCustomGenesis(genesisFile != null);
if (genesisFile != null) {
builder.setCustomGenesis(genesisFile.getAbsolutePath());
}
builder.setNetworkId(ethNetworkConfig.getNetworkId());
builder

@ -42,6 +42,7 @@ public class ConfigurationOverviewBuilder {
private String network;
private BigInteger networkId;
private boolean hasCustomGenesis;
private String customGenesisFileName;
private String dataStorage;
private String syncMode;
private Integer rpcPort;
@ -98,6 +99,17 @@ public class ConfigurationOverviewBuilder {
return this;
}
/**
* Sets location of custom genesis file specified.
*
* @param customGenesisFileName the filename of the custom genesis file, only set if specified
* @return the builder
*/
public ConfigurationOverviewBuilder setCustomGenesis(final String customGenesisFileName) {
this.customGenesisFileName = customGenesisFileName;
return this;
}
/**
* Sets data storage.
*
@ -269,7 +281,9 @@ public class ConfigurationOverviewBuilder {
}
if (hasCustomGenesis) {
lines.add("Network: Custom genesis file specified");
lines.add("Network: Custom genesis file");
lines.add(
customGenesisFileName == null ? "Custom genesis file is null" : customGenesisFileName);
}
if (networkId != null) {

@ -58,8 +58,9 @@ class ConfigurationOverviewBuilderTest {
assertThat(networkSet).contains("Network: foobar");
builder.setHasCustomGenesis(true);
builder.setCustomGenesis("file.name");
final String genesisSet = builder.build();
assertThat(genesisSet).contains("Network: Custom genesis file specified");
assertThat(genesisSet).contains("Network: Custom genesis file");
assertThat(genesisSet).doesNotContain("Network: foobar");
}

Loading…
Cancel
Save