Skip to content

Commit

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

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
  • Loading branch information
fab-10 authored Sep 17, 2023
1 parent 76459c2 commit 80d9ada
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 80d9ada

Please sign in to comment.