Skip to content

Commit 5643200

Browse files
authored
fix sol forwarder operations to override default programID (#22179)
1 parent ed9af27 commit 5643200

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

  • deployment/cre/forwarder/solana/sequence/operation

deployment/cre/forwarder/solana/sequence/operation/operation.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ type (
9898

9999
func initForwarder(b operations.Bundle, deps Deps, in InitForwarderInput) (InitForwarderOutput, error) {
100100
var out InitForwarderOutput
101-
if ks_forwarder.ProgramID.IsZero() {
102-
ks_forwarder.ProgramID = in.ProgramID
103-
}
101+
// anchor-go bakes a default program id; deploy uses the keystone_forwarder keypair, which can differ.
102+
// NewInitializeInstruction uses this package var as the program id, so it must match deploy output.
103+
ks_forwarder.ProgramID = in.ProgramID
104104

105105
stateKey, err := solana.NewRandomPrivateKey()
106106
if err != nil {
@@ -180,9 +180,7 @@ func configureForwarder(b operations.Bundle, deps Deps, in ConfigureForwarderInp
180180
var out ConfigureForwarderOutput
181181

182182
var instructions solana.Instruction
183-
if ks_forwarder.ProgramID.IsZero() {
184-
ks_forwarder.ProgramID = in.ProgramID
185-
}
183+
ks_forwarder.ProgramID = in.ProgramID
186184

187185
configPDA := solana.MustPublicKeyFromBase58(in.ConfigPDA)
188186

0 commit comments

Comments
 (0)