Skip to content

Commit

Permalink
Bump to libocr master 2271752fa829 (#537)
Browse files Browse the repository at this point in the history
Co-authored-by: aalu1418 <[email protected]>
  • Loading branch information
samsondav and aalu1418 authored Aug 10, 2023
1 parent d4a69ee commit 043913d
Show file tree
Hide file tree
Showing 7 changed files with 200 additions and 174 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ require (
github.com/google/uuid v1.3.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.15.0
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230801204930-f46c3ccc7815
github.com/smartcontractkit/libocr v0.0.0-20230606215712-82b910bef5c1
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230808141159-4e20b0757f3a
github.com/smartcontractkit/libocr v0.0.0-20230802221916-2271752fa829
github.com/stretchr/testify v1.8.4
go.uber.org/multierr v1.11.0
go.uber.org/zap v1.24.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,10 @@ github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5g
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230801204930-f46c3ccc7815 h1:X8RMerGDjQKoEv7/jfh27egjye6yKmXBIf3iqwBLxsI=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230801204930-f46c3ccc7815/go.mod h1:MfZBUifutkv3aK7abyw5YmTJbqt8iFwcQDFikrxC/uI=
github.com/smartcontractkit/libocr v0.0.0-20230606215712-82b910bef5c1 h1:caG9BWjnCxN/HPBA5ltDGadDraZAsjGIct4S8lh8D5c=
github.com/smartcontractkit/libocr v0.0.0-20230606215712-82b910bef5c1/go.mod h1:2lyRkw/qLQgUWlrWWmq5nj0y90rWeO6Y+v+fCakRgb0=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230808141159-4e20b0757f3a h1:8lHQYdub7q3LgD5ebQOA+usDyUqqiHvKEJPGQ8+FxMA=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230808141159-4e20b0757f3a/go.mod h1:Nt4mQh6z6q26jrM4FyQLq/2vBp1Sg3l5md3tBRdRLxg=
github.com/smartcontractkit/libocr v0.0.0-20230802221916-2271752fa829 h1:fzefK1SzoRSHzZduOCzIJ2kmkBMPKwIf3FgeBlw7Jjk=
github.com/smartcontractkit/libocr v0.0.0-20230802221916-2271752fa829/go.mod h1:2lyRkw/qLQgUWlrWWmq5nj0y90rWeO6Y+v+fCakRgb0=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
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 @@ -63,11 +63,11 @@ type ContractNodeInfo struct {
OCR2 *solclient.OCRv2
Store *solclient.Store
BootstrapNodeIdx int
BootstrapNode *client.Chainlink
BootstrapNode *client.ChainlinkK8sClient
BootstrapNodeKeysBundle client.NodeKeysBundle
BootstrapBridgeInfo BridgeInfo
NodesIdx []int
Nodes []*client.Chainlink
Nodes []*client.ChainlinkK8sClient
NodeKeysBundle []client.NodeKeysBundle
BridgeInfos []BridgeInfo
}
Expand Down Expand Up @@ -146,7 +146,7 @@ func New(env string) *Common {
return c
}

func (c *Common) CreateSolanaChainAndNode(nodes []*client.Chainlink) error {
func (c *Common) CreateSolanaChainAndNode(nodes []*client.ChainlinkClient) error {
for _, n := range nodes {
_, _, err := n.CreateSolanaChain(&client.SolanaChainAttributes{ChainID: c.ChainId})
if err != nil {
Expand All @@ -164,7 +164,7 @@ func (c *Common) CreateSolanaChainAndNode(nodes []*client.Chainlink) error {
return nil
}

func (c *Common) CreateNodeKeysBundle(nodes []*client.Chainlink) ([]client.NodeKeysBundle, error) {
func (c *Common) CreateNodeKeysBundle(nodes []*client.ChainlinkClient) ([]client.NodeKeysBundle, error) {
nkb := make([]client.NodeKeysBundle, 0)
for _, n := range nodes {
p2pkeys, err := n.MustReadP2PKeys()
Expand Down Expand Up @@ -237,7 +237,7 @@ func FundOracles(c *solclient.Client, nkb []client.NodeKeysBundle, amount *big.F
}

// OffChainConfigParamsFromNodes creates contracts.OffChainAggregatorV2Config
func OffChainConfigParamsFromNodes(nodes []*client.Chainlink, nkb []client.NodeKeysBundle) (contracts.OffChainAggregatorV2Config, error) {
func OffChainConfigParamsFromNodes(nodes []*client.ChainlinkK8sClient, nkb []client.NodeKeysBundle) (contracts.OffChainAggregatorV2Config, error) {
oi, err := createOracleIdentities(nkb)
if err != nil {
return contracts.OffChainAggregatorV2Config{}, err
Expand Down Expand Up @@ -280,7 +280,7 @@ func OffChainConfigParamsFromNodes(nodes []*client.Chainlink, nkb []client.NodeK
func CreateBridges(ContractsIdxMapToContractsNodeInfo map[int]*ContractNodeInfo, mockUrl string) error {
for i, nodesInfo := range ContractsIdxMapToContractsNodeInfo {
// Bootstrap node first
nodeContractPairID, err := BuildNodeContractPairID(nodesInfo.BootstrapNode, nodesInfo.OCR2.Address())
nodeContractPairID, err := BuildNodeContractPairID(nodesInfo.BootstrapNode.ChainlinkClient, nodesInfo.OCR2.Address())
if err != nil {
return err
}
Expand All @@ -307,7 +307,7 @@ func CreateBridges(ContractsIdxMapToContractsNodeInfo map[int]*ContractNodeInfo,
ContractsIdxMapToContractsNodeInfo[i].BootstrapBridgeInfo = BridgeInfo{ObservationSource: observationSource, JuelsSource: juelsSource}
// Other nodes later
for _, node := range nodesInfo.Nodes {
nodeContractPairID, err := BuildNodeContractPairID(node, nodesInfo.OCR2.Address())
nodeContractPairID, err := BuildNodeContractPairID(node.ChainlinkClient, nodesInfo.OCR2.Address())
if err != nil {
return err
}
Expand Down Expand Up @@ -401,7 +401,7 @@ func (c *Common) CreateJobsForContract(contractNodeInfo *ContractNodeInfo) error
return nil
}

func BuildNodeContractPairID(node *client.Chainlink, ocr2Addr string) (string, error) {
func BuildNodeContractPairID(node *client.ChainlinkClient, ocr2Addr string) (string, error) {
csaKeys, resp, err := node.ReadCSAKeys()
if err != nil {
return "", err
Expand Down
15 changes: 12 additions & 3 deletions integration-tests/common/test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func NewOCRv2State(t *testing.T, contracts int, namespacePrefix string, env stri

type OCRv2TestState struct {
Mu *sync.Mutex
ChainlinkNodes []*client.Chainlink
ChainlinkNodes []*client.ChainlinkK8sClient
ContractDeployer *solclient.ContractDeployer
LinkToken *solclient.LinkToken
Contracts []Contracts
Expand Down Expand Up @@ -232,7 +232,7 @@ func (m *OCRv2TestState) initializeNodesInContractsMap() {

// DeployContracts deploys contracts
func (m *OCRv2TestState) DeployContracts(contractsDir string) {
m.NodeKeysBundle, m.err = m.Common.CreateNodeKeysBundle(m.ChainlinkNodes)
m.NodeKeysBundle, m.err = m.Common.CreateNodeKeysBundle(m.GetChainlinkNodes())
require.NoError(m.T, m.err)
cd, err := solclient.NewContractDeployer(m.Client, m.Common.Env, nil)
require.NoError(m.T, err)
Expand Down Expand Up @@ -311,7 +311,7 @@ func (m *OCRv2TestState) DeployContracts(contractsDir string) {
// CreateJobs creating OCR jobs and EA stubs
func (m *OCRv2TestState) CreateJobs() {

m.err = m.Common.CreateSolanaChainAndNode(m.ChainlinkNodes)
m.err = m.Common.CreateSolanaChainAndNode(m.GetChainlinkNodes())
require.NoError(m.T, m.err)
m.err = CreateBridges(m.ContractsNodeSetup, m.Common.Env.URLs["qa_mock_adapter_internal"][0])
require.NoError(m.T, m.err)
Expand Down Expand Up @@ -561,3 +561,12 @@ func (m *OCRv2TestState) GauntletEnvToRemoteRunner() {
"VAULT_ADDRESS",
})
}

func (m *OCRv2TestState) GetChainlinkNodes() []*client.ChainlinkClient {
// retrieve client from K8s client
chainlinkNodes := []*client.ChainlinkClient{}
for i := range m.ChainlinkNodes {
chainlinkNodes = append(chainlinkNodes, m.ChainlinkNodes[i].ChainlinkClient)
}
return chainlinkNodes
}
Loading

0 comments on commit 043913d

Please sign in to comment.