Skip to content

Commit f8ebeb6

Browse files
authored
fix: make deactivate stake consistent by taking in comma separated keys (#1986)
* go * update args
1 parent 7643f98 commit f8ebeb6

File tree

1 file changed

+9
-4
lines changed
  • governance/xc_admin/packages/xc_admin_cli/src

1 file changed

+9
-4
lines changed

governance/xc_admin/packages/xc_admin_cli/src/index.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ multisigCommand(
386386
"Deactivate the delegated stake from the account"
387387
)
388388
.requiredOption(
389-
"-s, --stake-accounts <accounts...>",
389+
"-s, --stake-accounts <comma_separated_stake_account>",
390390
"stake accounts to be deactivated"
391391
)
392392
.action(async (options: any) => {
@@ -395,10 +395,15 @@ multisigCommand(
395395
const authorizedPubkey: PublicKey = await vault.getVaultAuthorityPDA(
396396
cluster
397397
);
398-
const instructions = options.stakeAccounts.reduce(
399-
(instructions: TransactionInstruction[], stakeAccount: string) => {
398+
399+
const stakeAccounts = options.stakeAccounts
400+
? options.stakeAccounts.split(",").map((m: string) => new PublicKey(m))
401+
: [];
402+
403+
const instructions = stakeAccounts.reduce(
404+
(instructions: TransactionInstruction[], stakeAccount: PublicKey) => {
400405
const transaction = StakeProgram.deactivate({
401-
stakePubkey: new PublicKey(stakeAccount),
406+
stakePubkey: stakeAccount,
402407
authorizedPubkey,
403408
});
404409

0 commit comments

Comments
 (0)