Skip to content

Commit

Permalink
Fix: correctly convert percentage options in TOML configuration file (h…
Browse files Browse the repository at this point in the history
…yperledger#5886)

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
  • Loading branch information
fab-10 authored and NickSneo committed Nov 12, 2023
1 parent cdbfe21 commit 0c8f4a1
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 0c8f4a1

Please sign in to comment.