Skip to content

Commit

Permalink
fix: make deactivate stake consistent by taking in comma separated ke…
Browse files Browse the repository at this point in the history
…ys (#1986)

* go

* update args
  • Loading branch information
guibescos authored Oct 3, 2024
1 parent 7643f98 commit f8ebeb6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions governance/xc_admin/packages/xc_admin_cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ multisigCommand(
"Deactivate the delegated stake from the account"
)
.requiredOption(
"-s, --stake-accounts <accounts...>",
"-s, --stake-accounts <comma_separated_stake_account>",
"stake accounts to be deactivated"
)
.action(async (options: any) => {
Expand All @@ -395,10 +395,15 @@ multisigCommand(
const authorizedPubkey: PublicKey = await vault.getVaultAuthorityPDA(
cluster
);
const instructions = options.stakeAccounts.reduce(
(instructions: TransactionInstruction[], stakeAccount: string) => {

const stakeAccounts = options.stakeAccounts
? options.stakeAccounts.split(",").map((m: string) => new PublicKey(m))
: [];

const instructions = stakeAccounts.reduce(
(instructions: TransactionInstruction[], stakeAccount: PublicKey) => {
const transaction = StakeProgram.deactivate({
stakePubkey: new PublicKey(stakeAccount),
stakePubkey: stakeAccount,
authorizedPubkey,
});

Expand Down

0 comments on commit f8ebeb6

Please sign in to comment.