From f8ebeb6af31d98f94ce73edade6da2ebab7b2456 Mon Sep 17 00:00:00 2001 From: guibescos <59208140+guibescos@users.noreply.github.com> Date: Thu, 3 Oct 2024 12:08:59 +0800 Subject: [PATCH] fix: make deactivate stake consistent by taking in comma separated keys (#1986) * go * update args --- .../xc_admin/packages/xc_admin_cli/src/index.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/governance/xc_admin/packages/xc_admin_cli/src/index.ts b/governance/xc_admin/packages/xc_admin_cli/src/index.ts index ae273f093..1c88be327 100644 --- a/governance/xc_admin/packages/xc_admin_cli/src/index.ts +++ b/governance/xc_admin/packages/xc_admin_cli/src/index.ts @@ -386,7 +386,7 @@ multisigCommand( "Deactivate the delegated stake from the account" ) .requiredOption( - "-s, --stake-accounts ", + "-s, --stake-accounts ", "stake accounts to be deactivated" ) .action(async (options: any) => { @@ -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, });