Skip to content

Commit

Permalink
fix: e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
agparadiso committed Nov 20, 2024
1 parent 2529a20 commit 0806924
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
7 changes: 7 additions & 0 deletions core/cmd/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,13 @@ func (n ChainlinkAppFactory) NewApplication(ctx context.Context, cfg chainlink.G
return nil, errors.Wrap(err, "failed to ensure CSA key")
}

if cfg.Capabilities().WorkflowRegistry().Address() != "" {
err2 := keyStore.Workflow().EnsureKey(ctx)
if err2 != nil {
return nil, errors.Wrap(err2, "failed to ensure workflow key")
}
}

beholderAuthHeaders, csaPubKeyHex, err := keystore.BuildBeholderAuth(keyStore)
if err != nil {
return nil, errors.Wrap(err, "failed to build Beholder auth")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import (
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey"
ksMocks "github.com/smartcontractkit/chainlink/v2/core/services/keystore/mocks"
"github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers"
"github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata"
Expand Down Expand Up @@ -437,7 +438,13 @@ func setupNodeCCIP(
key, err := csakey.NewV2()
require.NoError(t, err)
csaKeyStore.On("GetAll").Return([]csakey.KeyV2{key}, nil)
keyStore := NewKsa(db, lggr, csaKeyStore)

workflowKeyStore := ksMocks.NewWorkflow(t)
wkey, err := workflowkey.New()
require.NoError(t, err)
workflowKeyStore.On("GetAll").Return([]workflowkey.Key{wkey}, nil)

keyStore := NewKsa(db, lggr, csaKeyStore, workflowKeyStore)

simEthKeyStore := testhelpers.EthKeyStoreSim{
ETHKS: keyStore.Eth(),
Expand Down Expand Up @@ -1053,17 +1060,23 @@ func DecodeExecOnChainConfig(encoded []byte) (v1_5_0.ExecOnchainConfig, error) {

type ksa struct {
keystore.Master
csa keystore.CSA
csa keystore.CSA
workflow keystore.Workflow
}

func (k *ksa) CSA() keystore.CSA {
return k.csa
}

func NewKsa(db *sqlx.DB, lggr logger.Logger, csa keystore.CSA) *ksa {
func (k *ksa) Workflow() keystore.Workflow {
return k.workflow
}

func NewKsa(db *sqlx.DB, lggr logger.Logger, csa keystore.CSA, workflow keystore.Workflow) *ksa {
return &ksa{
Master: keystore.New(db, clutils.FastScryptParams, lggr),
csa: csa,
Master: keystore.New(db, clutils.FastScryptParams, lggr),
csa: csa,
workflow: workflow,
}
}

Expand Down

0 comments on commit 0806924

Please sign in to comment.