-
Notifications
You must be signed in to change notification settings - Fork 178
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
livepeer_cli gas price validation #1602
Comments
This behavior occurs due to the implementation of the function readBigInt()
While it is clear why this is happening, namely, the function readBigInt loops until a valid value is parsed, it is unclear what a "better" behavior would be. A simple option that may make it more clear to the end user would be to supply a prompt to the function readBigInt so that each subsequent prompt indicates the value entered would still be the new gas price. Alternatively, we can just report an error. This issue is present on both the minimum and maximum gas price options. |
I think this makes sense. So, if the user presses enter, then the following would be displayed again:
so that it is clear that the next value entered will be for the gas price option. A flaw that is present for this option and all of the wizard options for that matter is that there is no way to exit out of the prompt to select another option without doing a CTRL+C and restarting |
Pretty much. Displaying an error is also a good idea, I think. Here's how it would look:
As for the CTRL+C question, I agree. Another thing to note, the CLI accepts negative values for these parameters. Is that intentional? E.g. I can set maxGasPrice to -1, bonding amount, etc. Also, this behavior affects a bunch of other CLI options (haven't completely listed them all), This fix would affect bonding amount, token transfer, rebond, and gas price settings. There are likely more affected options for parameters that are not set via readBigInt. A quick look at wizard.go would indicate as much. Not sure if this is in scope to be addressed as well or if this is worth another issue that has broader scope. |
Describe the bug
Seems like livepeer_cli accepts a new line as input, leading to unexpected behaviour
To Reproduce
choosing
15. Set Eth gas price
leads promptEnter new gas price in Wei (enter "0" for automatic)>
that expects a number.If for some reason the input is new line, the result is as follows :
That is some how misleading.
if at that point user decides to choose other option ( 1-17 ), livepeer_cli accepts that value as gas price for
15.
Screenshots
The text was updated successfully, but these errors were encountered: