From 0c8f4a19ff7d1181fbb7dc6ee627d06760ea3dfd Mon Sep 17 00:00:00 2001 From: Fabio Di Fabio Date: Mon, 18 Sep 2023 01:26:46 +0200 Subject: [PATCH] Fix: correctly convert percentage options in TOML configuration file (#5886) Signed-off-by: Fabio Di Fabio --- .../besu/cli/util/TomlConfigFileDefaultProvider.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/besu/src/main/java/org/hyperledger/besu/cli/util/TomlConfigFileDefaultProvider.java b/besu/src/main/java/org/hyperledger/besu/cli/util/TomlConfigFileDefaultProvider.java index 9ec3f1ef640..c765b7f5dfc 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/util/TomlConfigFileDefaultProvider.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/util/TomlConfigFileDefaultProvider.java @@ -15,6 +15,7 @@ package org.hyperledger.besu.cli.util; import org.hyperledger.besu.datatypes.Wei; +import org.hyperledger.besu.util.number.Fraction; import org.hyperledger.besu.util.number.Percentage; import java.io.File; @@ -92,6 +93,8 @@ private String getConfigurationValue(final OptionSpec optionSpec) { defaultValue = getNumericEntryAsString(optionSpec); } else if (optionSpec.type().equals(Percentage.class)) { defaultValue = getNumericEntryAsString(optionSpec); + } else if (optionSpec.type().equals(Fraction.class)) { + defaultValue = getNumericEntryAsString(optionSpec); } else { // else will be treated as String defaultValue = getEntryAsString(optionSpec); }