From 121b542d8b47b9c2d14c4bda0f5ec4e6e24ff0e5 Mon Sep 17 00:00:00 2001 From: Fabio Di Fabio Date: Wed, 17 Jan 2024 19:20:54 +0100 Subject: [PATCH] Fix tests Signed-off-by: Fabio Di Fabio --- .../test/java/org/hyperledger/besu/cli/BesuCommandTest.java | 3 +++ .../org/hyperledger/besu/cli/options/MiningOptionsTest.java | 2 +- besu/src/test/resources/everything_config.toml | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java b/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java index 26296556302..04d9f015530 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java @@ -95,6 +95,7 @@ import org.hyperledger.besu.plugin.services.rpc.PluginRpcRequest; import org.hyperledger.besu.util.number.Fraction; import org.hyperledger.besu.util.number.Percentage; +import org.hyperledger.besu.util.number.PositiveNumber; import org.hyperledger.besu.util.platform.PlatformDetector; import java.io.File; @@ -846,6 +847,8 @@ public void tomlThatConfiguresEverythingExceptPermissioningToml() throws IOExcep tomlResult.getDouble(tomlKey); } else if (Percentage.class.isAssignableFrom(optionSpec.type())) { tomlResult.getLong(tomlKey); + } else if (PositiveNumber.class.isAssignableFrom(optionSpec.type())) { + tomlResult.getLong(tomlKey); } else { tomlResult.getString(tomlKey); } diff --git a/besu/src/test/java/org/hyperledger/besu/cli/options/MiningOptionsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/options/MiningOptionsTest.java index f28a7b81882..4b1fdddb53a 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/options/MiningOptionsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/options/MiningOptionsTest.java @@ -315,7 +315,7 @@ public void posBlockCreationMaxTimeOutOfAllowedRange() { public void blockTxsSelectionMaxTimeDefaultValue() { internalTestSuccess( miningParams -> - assertThat(miningParams.getBlockTxsSelectionMaxTime()) + assertThat(miningParams.getNonPoaBlockTxsSelectionMaxTime()) .isEqualTo(DEFAULT_NON_POA_BLOCK_TXS_SELECTION_MAX_TIME)); } diff --git a/besu/src/test/resources/everything_config.toml b/besu/src/test/resources/everything_config.toml index c653f3f60fd..b8dae6c1889 100644 --- a/besu/src/test/resources/everything_config.toml +++ b/besu/src/test/resources/everything_config.toml @@ -142,6 +142,8 @@ min-priority-fee=0 min-block-occupancy-ratio=0.7 miner-stratum-host="0.0.0.0" miner-stratum-port=8008 +block-txs-selection-max-time=5000 +poa-block-txs-selection-max-time=75 Xminer-remote-sealers-limit=1000 Xminer-remote-sealers-hashrate-ttl=10 Xpos-block-creation-max-time=5