Fix reading tx-pool-min-score option from configuration file (#7623)

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
pull/7664/head
Fabio Di Fabio 2 months ago committed by GitHub
parent f1da4e77e6
commit 3e0e5cdc1f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 6
      besu/src/main/java/org/hyperledger/besu/cli/util/TomlConfigurationDefaultProvider.java
  3. 18
      besu/src/test/java/org/hyperledger/besu/cli/options/TransactionPoolOptionsTest.java

@ -16,6 +16,7 @@
- Fix for `debug_traceCall` to handle transactions without specified gas price. [#7510](https://github.com/hyperledger/besu/pull/7510)
- Corrects a regression where custom plugin services are not initialized correctly. [#7625](https://github.com/hyperledger/besu/pull/7625)
- Fix for IBFT2 chains using the BONSAI DB format [#7631](https://github.com/hyperledger/besu/pull/7631)
- Fix reading `tx-pool-min-score` option from configuration file [#7623](https://github.com/hyperledger/besu/pull/7623)
## 24.9.1

@ -120,7 +120,11 @@ public class TomlConfigurationDefaultProvider implements IDefaultValueProvider {
}
private boolean isNumericType(final Class<?> type) {
return type.equals(Integer.class)
return type.equals(Byte.class)
|| type.equals(byte.class)
|| type.equals(Short.class)
|| type.equals(short.class)
|| type.equals(Integer.class)
|| type.equals(int.class)
|| type.equals(Long.class)
|| type.equals(long.class)

@ -427,6 +427,24 @@ public class TransactionPoolOptionsTest
Byte.toString(minScore));
}
@Test
public void minScoreWorksConfigFile() throws IOException {
final byte minScore = -10;
final Path tempConfigFilePath =
createTempFile(
"config",
String.format(
"""
tx-pool-min-score=%s
""",
minScore));
internalTestSuccess(
config -> assertThat(config.getMinScore()).isEqualTo(minScore),
"--config-file",
tempConfigFilePath.toString());
}
@Test
public void minScoreNonByteValueReturnError() {
final var overflowMinScore = Integer.toString(-300);

Loading…
Cancel
Save