Skip to content

Commit 5a6c16f

Browse files
authored
Merge pull request #761 from rocket-pool/issue-756-dialog-not-cancelled-properly
Issue 756 dialog not cancelled properly
2 parents 4a5b2f3 + 431ed2f commit 5a6c16f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

rocketpool-cli/pdao/utils.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
func parseFloat(c *cli.Context, name string, value string, isFraction bool) (*big.Int, error) {
1414
var floatValue float64
1515
if c.Bool("raw") {
16-
val, err := cliutils.ValidateBigInt(name, value)
16+
val, err := cliutils.ValidatePositiveWeiAmount(name, value)
1717
if err != nil {
1818
return nil, err
1919
}
@@ -35,8 +35,12 @@ func parseFloat(c *cli.Context, name string, value string, isFraction bool) (*bi
3535
trueVal := eth.EthToWei(floatValue)
3636
fmt.Printf("Your value will be multiplied by 10^18 to be used in the contracts, which results in:\n\n\t[%s]\n\n", trueVal.String())
3737
if !(c.Bool("yes") || cliutils.Confirm("Please make sure this is what you want and does not have any floating-point errors.\n\nIs this result correct?")) {
38-
fmt.Println("Cancelled. Please try again with the '--raw' flag and provide an explicit value instead.")
39-
return nil, nil
38+
value = cliutils.Prompt("Please enter the wei amount:", "^[0-9]+$", "Invalid amount")
39+
val, err := cliutils.ValidatePositiveWeiAmount(name, value)
40+
if err != nil {
41+
return nil, err
42+
}
43+
return val, nil
4044
}
4145
return trueVal, nil
4246
}

0 commit comments

Comments
 (0)