Skip to content

Commit 2d5540d

Browse files
committed
override signers
1 parent c1d38ba commit 2d5540d

File tree

1 file changed

+12
-0
lines changed
  • chains/solana/deployment/v1_6_0/operations/mcms

1 file changed

+12
-0
lines changed

chains/solana/deployment/v1_6_0/operations/mcms/mcms.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,10 @@ func initMCM(b operations.Bundle, deps Deps, in InitMCMInput) (MCMOutput, error)
337337
}
338338

339339
encodedAddress := mcms_solana.ContractAddress(in.MCM, mcms_solana.PDASeed(seed))
340+
upgradeAuthority, err := utils.GetUpgradeAuthority(deps.Chain.Client, in.MCM)
341+
if err != nil {
342+
return MCMOutput{}, fmt.Errorf("failed to get upgrade authority: %w", err)
343+
}
340344

341345
var configurer *mcms_solana.Configurer
342346
if len(ixns) > 0 {
@@ -350,6 +354,14 @@ func initMCM(b operations.Bundle, deps Deps, in InitMCMInput) (MCMOutput, error)
350354
}
351355
if tx.Hash == "" {
352356
instructions := tx.RawData.([]solana.Instruction)
357+
// override authority to upgrade authority if different from deployer
358+
for _, ixn := range instructions {
359+
for _, account := range ixn.Accounts() {
360+
if account.PublicKey == deps.Chain.DeployerKey.PublicKey() {
361+
account.PublicKey = upgradeAuthority
362+
}
363+
}
364+
}
353365
batch, err := utils.BuildMCMSBatchOperation(
354366
deps.Chain.Selector,
355367
instructions,

0 commit comments

Comments
 (0)