Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rocketpool node stake-rpl reads incorrect selection #450

Closed
jduffey opened this issue Mar 2, 2024 · 0 comments
Closed

rocketpool node stake-rpl reads incorrect selection #450

jduffey opened this issue Mar 2, 2024 · 0 comments

Comments

@jduffey
Copy link
Contributor

jduffey commented Mar 2, 2024

Reproduction steps:

  • Run rocketpool node stake-rpl in order to select how much RPL to stake.
  • Example output:
Please choose an amount of RPL to stake:
1: The minimum minipool stake amount for an 8-ETH minipool (244.921431 RPL)?
2: The minimum minipool stake amount for a 16-ETH minipool (163.280954 RPL)?
3: Your entire RPL balance (265.331549 RPL)?
4: A custom amount
  • Select option 3 to stake the entire RPL balance
  • Observe that you're presented with the prompt, "Please enter an amount of RPL to stake:"
  • Cancel the interaction (e.g. Ctrl + C) and run the command again
  • Select option 4 to stake a custom amount
  • Observe that you're not presented with the option to select the amount of RPL and instead are prompted to select your gas price, as though the RPL amount has already been decided

I think the issue lies in rocketpool-cli/node/stake-rpl.go, line 210, where case 3 should be case 2; context:

// Prompt for amount option
amountOptions := []string{
	fmt.Sprintf("The minimum minipool stake amount for an 8-ETH minipool (%.6f RPL)?", math.RoundUp(eth.WeiToEth(minAmount8), 6)),
	fmt.Sprintf("The minimum minipool stake amount for a 16-ETH minipool (%.6f RPL)?", math.RoundUp(eth.WeiToEth(minAmount16), 6)),
	fmt.Sprintf("Your entire RPL balance (%.6f RPL)?", math.RoundDown(eth.WeiToEth(&rplBalance), 6)),
	"A custom amount",
}
selected, _ := cliutils.Select("Please choose an amount of RPL to stake:", amountOptions)
switch selected {
case 0:
	amountWei = minAmount8
case 1:
	amountWei = minAmount16
case 3:
	amountWei = &rplBalance
}
jduffey added a commit to jduffey/smartnode that referenced this issue Mar 2, 2024
…g user selection upon calling rocketpool node stake-rpl
0xfornax added a commit that referenced this issue Mar 4, 2024
Issue #450 - Bugfix when smartnode is reading user sele…
@0xfornax 0xfornax closed this as completed Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants