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>
Signed-off-by: garyschulte <garyschulte@gmail.com>
  • Loading branch information
fab-10 authored and garyschulte committed Sep 20, 2023
1 parent ec846e2 commit 36df90a
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 36df90a

Please sign in to comment.