Fix solana-tokens check_payer_balances for distribute-stake (#12380)

* Handle distribute-stakes properly

* Remove dry-run gating for balance checks

* Reword and simplify InsufficientFunds errors

* Split up test and add helpers

* Rename sol_for_fees -> unlocked_sol

* Refactor distribute_allocations to collect Messages

* Clippy

* Clean up dangling bids
This commit is contained in:
Tyera Eulberg
2020-09-22 20:39:05 -06:00
committed by GitHub
parent 1afb138a2c
commit 6563726f22
4 changed files with 613 additions and 59 deletions

View File

@@ -156,9 +156,9 @@ where
.help("Stake Account Address"),
)
.arg(
Arg::with_name("sol_for_fees")
Arg::with_name("unlocked_sol")
.default_value("1.0")
.long("sol-for-fees")
.long("unlocked-sol")
.takes_value(true)
.value_name("SOL_AMOUNT")
.help("Amount of SOL to put in system account to pay for fees"),
@@ -208,7 +208,7 @@ where
.required(true)
.takes_value(true)
.value_name("FILE")
.help("Bids CSV file"),
.help("Allocations CSV file"),
),
)
.subcommand(
@@ -327,7 +327,7 @@ fn parse_distribute_stake_args(
let stake_args = StakeArgs {
stake_account_address,
sol_for_fees: value_t_or_exit!(matches, "sol_for_fees", f64),
unlocked_sol: value_t_or_exit!(matches, "unlocked_sol", f64),
stake_authority,
withdraw_authority,
lockup_authority,