Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump common and fix Chain Writer name #561

Merged
merged 20 commits into from
Dec 2, 2024
Merged
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
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Languages
nodejs 18.6.0
yarn 1.22.19
golang 1.21.5
golang 1.23.3
python 3.9.13

# Tools
mockery 2.22.1
golangci-lint 1.61.0
golangci-lint 1.62.2
actionlint 1.6.12
shellcheck 0.8.0
scarb 2.6.5
Expand Down
16 changes: 8 additions & 8 deletions integration-tests/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/environment"
"github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/chainlink"
mock_adapter "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/mock-adapter"
"github.com/smartcontractkit/chainlink/integration-tests/client"
"github.com/smartcontractkit/chainlink/deployment/environment/nodeclient"
"github.com/smartcontractkit/chainlink/integration-tests/docker/test_env"
"github.com/smartcontractkit/chainlink/v2/core/services/job"

Expand Down Expand Up @@ -197,8 +197,8 @@ func (c *Common) TearDownLocalEnvironment(t *testing.T) {
log.Info().Msg("Tear down local stack complete.")
}

func (c *Common) CreateNodeKeysBundle(nodes []*client.ChainlinkClient) ([]client.NodeKeysBundle, error) {
nkb := make([]client.NodeKeysBundle, 0)
func (c *Common) CreateNodeKeysBundle(nodes []*nodeclient.ChainlinkClient) ([]nodeclient.NodeKeysBundle, error) {
nkb := make([]nodeclient.NodeKeysBundle, 0)
for _, n := range nodes {
p2pkeys, err := n.MustReadP2PKeys()
if err != nil {
Expand All @@ -215,7 +215,7 @@ func (c *Common) CreateNodeKeysBundle(nodes []*client.ChainlinkClient) ([]client
return nil, err
}

nkb = append(nkb, client.NodeKeysBundle{
nkb = append(nkb, nodeclient.NodeKeysBundle{
PeerID: peerID,
OCR2Key: *ocrKey,
TXKey: *txKey,
Expand All @@ -227,7 +227,7 @@ func (c *Common) CreateNodeKeysBundle(nodes []*client.ChainlinkClient) ([]client
// CreateJobsForContract Creates and sets up the boostrap jobs as well as OCR jobs
func (c *Common) CreateJobsForContract(cc *ChainlinkClient, observationSource string, juelsPerFeeCoinSource string, ocrControllerAddress string, accountAddresses []string) error {
// Define node[0] as bootstrap node
cc.bootstrapPeers = []client.P2PData{
cc.bootstrapPeers = []nodeclient.P2PData{
{
InternalIP: cc.ChainlinkNodes[0].InternalIP(),
InternalPort: c.RPCDetails.P2PPort,
Expand All @@ -249,7 +249,7 @@ func (c *Common) CreateJobsForContract(cc *ChainlinkClient, observationSource st
ContractConfigConfirmations: 1, // don't wait for confirmation on devnet
}
// Setting up bootstrap node
jobSpec := &client.OCR2TaskJobSpec{
jobSpec := &nodeclient.OCR2TaskJobSpec{
Name: fmt.Sprintf("starknet-OCRv2-%s-%s", "bootstrap", uuid.New().String()),
JobType: "bootstrap",
OCR2OracleSpec: oracleSpec,
Expand All @@ -265,7 +265,7 @@ func (c *Common) CreateJobsForContract(cc *ChainlinkClient, observationSource st
p2pBootstrappers = append(p2pBootstrappers, cc.bootstrapPeers[i].P2PV2Bootstrapper())
}

sourceValueBridge := &client.BridgeTypeAttributes{
sourceValueBridge := &nodeclient.BridgeTypeAttributes{
Name: "mockserver-bridge",
URL: c.RPCDetails.MockServerEndpoint + "/" + strings.TrimPrefix(c.RPCDetails.MockServerURL, "/"),
}
Expand Down Expand Up @@ -299,7 +299,7 @@ func (c *Common) CreateJobsForContract(cc *ChainlinkClient, observationSource st
},
}

jobSpec = &client.OCR2TaskJobSpec{
jobSpec = &nodeclient.OCR2TaskJobSpec{
Name: fmt.Sprintf("starknet-OCRv2-%d-%s", nIdx, uuid.New().String()),
JobType: "offchainreporting2",
OCR2OracleSpec: oracleSpec,
Expand Down
22 changes: 11 additions & 11 deletions integration-tests/common/test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink-testing-framework/lib/logging"
"github.com/smartcontractkit/chainlink/integration-tests/client"
"github.com/smartcontractkit/chainlink/deployment/environment/nodeclient"
test_env_integrations "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env"

test_env_starknet "github.com/smartcontractkit/chainlink-starknet/integration-tests/docker/testenv"
Expand All @@ -42,7 +42,7 @@ var (
type OCRv2TestState struct {
Account *AccountDetails
Clients *Clients
ChainlinkNodesK8s []*client.ChainlinkK8sClient
ChainlinkNodesK8s []*nodeclient.ChainlinkK8sClient
Common *Common
TestConfig *TestConfig
Contracts *Contracts
Expand Down Expand Up @@ -78,10 +78,10 @@ type Contracts struct {

// ChainlinkClient core node configs
type ChainlinkClient struct {
NKeys []client.NodeKeysBundle
ChainlinkNodes []*client.ChainlinkClient
bTypeAttr *client.BridgeTypeAttributes
bootstrapPeers []client.P2PData
NKeys []nodeclient.NodeKeysBundle
ChainlinkNodes []*nodeclient.ChainlinkClient
bTypeAttr *nodeclient.BridgeTypeAttributes
bootstrapPeers []nodeclient.P2PData
AccountAddresses []string
}

Expand Down Expand Up @@ -203,7 +203,7 @@ func (m *OCRv2TestState) DeployCluster() {
m.TestConfig.Resty = resty.New().SetBaseURL(m.Common.RPCDetails.RPCL2External)

if *m.Common.TestConfig.Common.InsideK8s {
m.ChainlinkNodesK8s, m.TestConfig.err = client.ConnectChainlinkNodes(m.Common.Env)
m.ChainlinkNodesK8s, m.TestConfig.err = nodeclient.ConnectChainlinkNodes(m.Common.Env)
require.NoError(m.TestConfig.T, m.TestConfig.err)
m.Clients.ChainlinkClient.ChainlinkNodes = m.GetChainlinkNodes()
m.Clients.ChainlinkClient.NKeys, m.TestConfig.err = m.Common.CreateNodeKeysBundle(m.Clients.ChainlinkClient.ChainlinkNodes)
Expand Down Expand Up @@ -272,13 +272,13 @@ func (m *OCRv2TestState) SetUpNodes() {
}

// GetNodeKeys Returns the node key bundles
func (m *OCRv2TestState) GetNodeKeys() []client.NodeKeysBundle {
func (m *OCRv2TestState) GetNodeKeys() []nodeclient.NodeKeysBundle {
return m.Clients.ChainlinkClient.NKeys
}

func (m *OCRv2TestState) GetChainlinkNodes() []*client.ChainlinkClient {
func (m *OCRv2TestState) GetChainlinkNodes() []*nodeclient.ChainlinkClient {
// retrieve client from K8s client
var chainlinkNodes []*client.ChainlinkClient
var chainlinkNodes []*nodeclient.ChainlinkClient
for i := range m.ChainlinkNodesK8s {
chainlinkNodes = append(chainlinkNodes, m.ChainlinkNodesK8s[i].ChainlinkClient)
}
Expand All @@ -289,7 +289,7 @@ func (m *OCRv2TestState) GetChainlinkClient() *ChainlinkClient {
return m.Clients.ChainlinkClient
}

func (m *OCRv2TestState) SetBridgeTypeAttrs(attr *client.BridgeTypeAttributes) {
func (m *OCRv2TestState) SetBridgeTypeAttrs(attr *nodeclient.BridgeTypeAttributes) {
m.Clients.ChainlinkClient.bTypeAttr = attr
}

Expand Down
Loading
Loading