diff --git a/shared/utils/cli/prompt.go b/shared/utils/cli/prompt.go index 3d7bb024b..39be0532e 100644 --- a/shared/utils/cli/prompt.go +++ b/shared/utils/cli/prompt.go @@ -58,8 +58,11 @@ func Select(initialPrompt string, options []string) (int, string) { // Get prompt prompt := initialPrompt + errPromptMsg := "Please enter a number corresponding to an option" + for i, option := range options { prompt += fmt.Sprintf("\n%d: %s", (i + 1), option) + errPromptMsg += fmt.Sprintf("\n%d: %s", (i + 1), option) } // Get expected response format @@ -70,7 +73,7 @@ func Select(initialPrompt string, options []string) (int, string) { expectedFormat := fmt.Sprintf("^(%s)$", strings.Join(optionNumbers, "|")) // Prompt user - response := Prompt(prompt, expectedFormat, "Please enter a number corresponding to an option") + response := Prompt(prompt, expectedFormat, errPromptMsg) // Get selected option index, _ := strconv.Atoi(response) diff --git a/stader-cli/node/utilize-sd.go b/stader-cli/node/utilize-sd.go index ef95f5c05..0b3f53398 100644 --- a/stader-cli/node/utilize-sd.go +++ b/stader-cli/node/utilize-sd.go @@ -136,7 +136,7 @@ Maximum utilization amount: %s %sPlease enter the amount of SD you wish to utilize from the SD Utility Pool:%s`, eth.DisplayAmountInUnits(sdStatus.PoolAvailableSDBalance, "sd"), eth.DisplayAmountInUnits(minUtility, "sd"), eth.DisplayAmountInUnits(maxUtility, "sd"), log.ColorYellow, log.ColorReset) - errMsg := fmt.Sprintf("Invalid input, please specify an amount within %f and %f SD range\n", minSd, maxSd) + errMsg := fmt.Sprintf("Invalid input, please specify an amount within %f and %f SD range", minSd, maxSd) utilityAmount, err := sd.PromptChooseSDWithMaxMin(msg, errMsg, minUtility, maxUtility) if err != nil { @@ -161,13 +161,12 @@ func PromptChooseSelfBondAmount(sdStatus *api.SdStatusResponse) (*big.Int, error minSd := eth.WeiToEth(amountToCollateralRemain) maxSd := eth.WeiToEth(sdRewardEligibleRemain) - msg := fmt.Sprintf(` -Minimum bond: %s + msg := fmt.Sprintf(`Minimum bond: %s Maximum bond: %s %sPlease enter the amount of SD you wish to deposit as collateral:%s`, eth.DisplayAmountInUnits(amountToCollateralRemain, "sd"), eth.DisplayAmountInUnits(sdRewardEligibleRemain, "sd"), log.ColorYellow, log.ColorReset) - errMsg := fmt.Sprintf("Invalid input, please specify an amount within %f and %f SD range\n", minSd, maxSd) + errMsg := fmt.Sprintf("Invalid input, please specify an amount within %f and %f SD range", minSd, maxSd) utilityAmount, err := sd.PromptChooseSDWithMaxMin(msg, errMsg, amountToCollateralRemain, sdRewardEligibleRemain) if err != nil { diff --git a/stader-cli/validator/deposit.go b/stader-cli/validator/deposit.go index 1b25d3482..b8e01571c 100644 --- a/stader-cli/validator/deposit.go +++ b/stader-cli/validator/deposit.go @@ -117,10 +117,9 @@ func nodeDeposit(c *cli.Context) error { return nil } - autoConfirm := c.Bool("yes") nounce := c.GlobalUint64("nonce") + err = node.DepositSdWithAmount(staderClient, selfBondAmount, true, nounce) - err = node.DepositSdWithAmount(staderClient, selfBondAmount, autoConfirm, nounce) if err != nil { return err }