-
Notifications
You must be signed in to change notification settings - Fork 226
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.18: Cli stake-split: adjust transfer amount if recipient has lamports (backport of #266) #369
Conversation
Cherry-pick of dff99d0 has failed:
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
This is a solana-cli-only change, which builds on (needs rebase on) #368 |
f4b52b8
to
a8a4550
Compare
* Remove incorrect check * Move to closure * Use match statement instead * Adjust rent_exempt_reserve by existing balance * Only transfer lamports if rent_exempt_reserve needs are greater than 0 * Rename variable for clarity * Add minimum-delegation check * Bump test split amount to meet arbitrary mock minimum-delegation amount (cherry picked from commit dff99d0) # Conflicts: # cli/src/stake.rs
a8a4550
to
a31ed98
Compare
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.
Approved for beta
…rts (backport of anza-xyz#266) (anza-xyz#369) Cli stake-split: adjust transfer amount if recipient has lamports (anza-xyz#266) * Remove incorrect check * Move to closure * Use match statement instead * Adjust rent_exempt_reserve by existing balance * Only transfer lamports if rent_exempt_reserve needs are greater than 0 * Rename variable for clarity * Add minimum-delegation check * Bump test split amount to meet arbitrary mock minimum-delegation amount (cherry picked from commit dff99d0) # Conflicts: # cli/src/stake.rs Co-authored-by: Tyera <[email protected]>
Problem
The #162 cli change permits split recipients that carry a lamports balance. However, the message builder below always funds the account with the full rent-exempt reserve regardless of such an existing balance.
Summary of Changes
Some refactoring to make cases easier to follow (review by commit will be best)
Subtract (saturating) any existing lamports balance from the transfer amount
This is an automatic backport of pull request #266 done by [Mergify](https://mergify.com).