-
Notifications
You must be signed in to change notification settings - Fork 112
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
V1 Improved node deposit
and node stake-rpl
flow
#694
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow percents but make the user pass -a 5%
instead of -a 5
, otherwise it's a POLA violation when someone passes -a 5
and it stakes 5% instead of 5 RPL
TIL what a POLA violation is. Nice catch, thank you Patches! |
c.String("amount") != "5%" && | ||
c.String("amount") != "10%" && | ||
c.String("amount") != "15%" && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we drop the magic values and just use strings.EndsWith(c.String("amount"), "%")
to determine if a percentage was passed? Then parse it and the actual amount.
fivePercentBorrowedRplStake.Div(fivePercentBorrowedRplStake, rplPrice) | ||
fivePercentBorrowedRplStake.Add(fivePercentBorrowedRplStake, big.NewInt(1)) | ||
response.FivePercentBorrowedRplStake = fivePercentBorrowedRplStake | ||
response.TenPercentBorrowedRplStake = new(big.Int).Mul(fivePercentBorrowedRplStake, big.NewInt(2)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just return the price and borrowed amount, and make the CLI calculate the percent of borrowed. This is an example of what I mean when I say the API over-fits the cli.
Included in this PR:
stake-rpl
, because changingnode.per.minipool.stake.minimum
to 0 broke the old selectionReintroduced the
-y
and-a
flags tonode deposit
for users who automate minipool deposits (10/10 foresight)node deposit
andcreate-vacant-minipool
uses ay/n
confirmation rather than prompting for a selection: