Skip to content

Commit

Permalink
Fix solana-tokens check_payer_balances for distribute-stake (solana-l…
Browse files Browse the repository at this point in the history
…abs#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
  • Loading branch information
CriesofCarrots authored Sep 23, 2020
1 parent 1afb138 commit 6563726
Show file tree
Hide file tree
Showing 4 changed files with 613 additions and 59 deletions.
1 change: 1 addition & 0 deletions tokens/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
target/
*.csv
/farf/
8 changes: 4 additions & 4 deletions tokens/src/arg_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -208,7 +208,7 @@ where
.required(true)
.takes_value(true)
.value_name("FILE")
.help("Bids CSV file"),
.help("Allocations CSV file"),
),
)
.subcommand(
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tokens/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub struct DistributeTokensArgs {
}

pub struct StakeArgs {
pub sol_for_fees: f64,
pub unlocked_sol: f64,
pub stake_account_address: Pubkey,
pub stake_authority: Box<dyn Signer>,
pub withdraw_authority: Box<dyn Signer>,
Expand Down
Loading

0 comments on commit 6563726

Please sign in to comment.