Skip to content

Commit e0a8b2e

Browse files
authored
[xc-admin] Enable remote program upgrade (#540)
* Checkpoint * Checkpoint * Format
1 parent 94e97e6 commit e0a8b2e

File tree

1 file changed

+13
-3
lines changed
  • governance/xc-admin/packages/xc-admin-cli/src

1 file changed

+13
-3
lines changed

governance/xc-admin/packages/xc-admin-cli/src/index.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,11 @@ mutlisigCommand("upgrade-program", "Upgrade a program from a buffer")
138138
const buffer: PublicKey = new PublicKey(options.buffer);
139139
const vault: PublicKey = new PublicKey(options.vault);
140140

141-
const squad = SquadsMesh.endpoint(getPythClusterApiUrl(cluster), wallet);
141+
const isRemote = isRemoteCluster(cluster);
142+
const squad = SquadsMesh.endpoint(
143+
getPythClusterApiUrl(getMultisigCluster(cluster)),
144+
wallet
145+
);
142146
const msAccount = await squad.getMultisig(vault);
143147
const vaultAuthority = squad.getAuthorityPDA(
144148
msAccount.publicKey,
@@ -162,11 +166,17 @@ mutlisigCommand("upgrade-program", "Upgrade a program from a buffer")
162166
{ pubkey: wallet.publicKey, isSigner: false, isWritable: true },
163167
{ pubkey: SYSVAR_RENT_PUBKEY, isSigner: false, isWritable: false },
164168
{ pubkey: SYSVAR_CLOCK_PUBKEY, isSigner: false, isWritable: false },
165-
{ pubkey: vaultAuthority, isSigner: true, isWritable: false },
169+
{ pubkey: mapKey(vaultAuthority), isSigner: true, isWritable: false },
166170
],
167171
};
168172

169-
await proposeInstructions(squad, vault, [proposalInstruction], false);
173+
await proposeInstructions(
174+
squad,
175+
vault,
176+
[proposalInstruction],
177+
isRemote,
178+
WORMHOLE_ADDRESS[getMultisigCluster(cluster)]
179+
);
170180
});
171181

172182
mutlisigCommand(

0 commit comments

Comments
 (0)