Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,8 @@ var SetEventAuthorities = operations.NewOperation(
)

type SetCurserInput struct {
Curser solana.PublicKey
RMNRemote solana.PublicKey
RMNRemoteConfigPDA solana.PublicKey
Curser solana.PublicKey
RMNRemote solana.PublicKey
}

var SetCurser = operations.NewOperation(
Expand All @@ -321,11 +320,20 @@ var SetCurser = operations.NewOperation(

authority := GetAuthority(chain, input.RMNRemote)

configPDA, _, err := state.FindRMNRemoteConfigPDA(input.RMNRemote)
if err != nil {
return sequences.OnChainOutput{}, fmt.Errorf("failed to find RMNRemoteConfig PDA: %w", err)
}
cursesPDA, _, err := state.FindRMNRemoteCursesPDA(input.RMNRemote)
if err != nil {
return sequences.OnChainOutput{}, fmt.Errorf("failed to find RMNRemoteCurses PDA: %w", err)
}

ixn, err := rmn163.NewSetCurserInstruction(
input.Curser,
input.RMNRemoteConfigPDA,
configPDA,
cursesPDA,
authority,
solana.SystemProgramID,
).ValidateAndBuild()
if err != nil {
return sequences.OnChainOutput{}, fmt.Errorf("failed to build set curser instruction: %w", err)
Expand Down
11 changes: 2 additions & 9 deletions chains/solana/deployment/v1_6_0/sequences/set_rmn_curser.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"github.com/Masterminds/semver/v3"
"github.com/gagliardetto/solana-go"
rmnops "github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment/v1_6_0/operations/rmn_remote"
"github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/state"
"github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences"
cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain"
"github.com/smartcontractkit/chainlink-deployments-framework/datastore"
Expand Down Expand Up @@ -35,18 +34,12 @@ var SetRMNRemoteCurser = cldf_ops.NewSequence(
}
rmnPubkey := solana.PublicKeyFromBytes(rmnAddrBytes)

rmnConfigPDA, _, err := state.FindRMNRemoteConfigPDA(rmnPubkey)
if err != nil {
return sequences.OnChainOutput{}, fmt.Errorf("failed to find RMNRemote config PDA: %w", err)
}

out, err := cldf_ops.ExecuteOperation(b,
rmnops.SetCurser,
chain,
rmnops.SetCurserInput{
Curser: input.Curser,
RMNRemote: rmnPubkey,
RMNRemoteConfigPDA: rmnConfigPDA,
Curser: input.Curser,
RMNRemote: rmnPubkey,
},
)
if err != nil {
Expand Down
Loading