diff --git a/integration-tests/common/common.go b/integration-tests/common/common.go index 220042fd1..b12782425 100644 --- a/integration-tests/common/common.go +++ b/integration-tests/common/common.go @@ -1,11 +1,8 @@ package common import ( - "bytes" - "encoding/hex" "fmt" "math/big" - "sort" "strings" "testing" "time" @@ -13,12 +10,8 @@ import ( "github.com/gagliardetto/solana-go" "github.com/google/uuid" "github.com/lib/pq" - "golang.org/x/crypto/curve25519" "gopkg.in/guregu/null.v4" - "github.com/smartcontractkit/libocr/offchainreporting2/confighelper" - "github.com/smartcontractkit/libocr/offchainreporting2/types" - ctfconfig "github.com/smartcontractkit/chainlink-testing-framework/config" ctf_test_env "github.com/smartcontractkit/chainlink-testing-framework/docker/test_env" "github.com/smartcontractkit/chainlink-testing-framework/k8s/environment" @@ -106,15 +99,6 @@ type NodeKeysBundle struct { TXKey *client.TxKey } -// OCR2 keys are in format OCR2__ -func stripKeyPrefix(key string) string { - chunks := strings.Split(key, "_") - if len(chunks) == 3 { - return chunks[2] - } - return key -} - func New(testConfig *tc.TestConfig) *Common { var c *Common @@ -193,42 +177,6 @@ func (c *Common) CreateNodeKeysBundle(nodes []*client.ChainlinkClient) ([]client return nkb, nil } -func createOracleIdentities(nkb []client.NodeKeysBundle) ([]confighelper.OracleIdentityExtra, error) { - oracleIdentities := make([]confighelper.OracleIdentityExtra, 0) - for _, nodeKeys := range nkb { - offChainPubKeyTemp, err := hex.DecodeString(stripKeyPrefix(nodeKeys.OCR2Key.Data.Attributes.OffChainPublicKey)) - if err != nil { - return nil, err - } - onChainPubKey, err := hex.DecodeString(stripKeyPrefix(nodeKeys.OCR2Key.Data.Attributes.OnChainPublicKey)) - if err != nil { - return nil, err - } - cfgPubKeyTemp, err := hex.DecodeString(stripKeyPrefix(nodeKeys.OCR2Key.Data.Attributes.ConfigPublicKey)) - if err != nil { - return nil, err - } - cfgPubKeyBytes := [curve25519.PointSize]byte{} - copy(cfgPubKeyBytes[:], cfgPubKeyTemp) - offChainPubKey := [curve25519.PointSize]byte{} - copy(offChainPubKey[:], offChainPubKeyTemp) - oracleIdentities = append(oracleIdentities, confighelper.OracleIdentityExtra{ - OracleIdentity: confighelper.OracleIdentity{ - OffchainPublicKey: offChainPubKey, - OnchainPublicKey: onChainPubKey, - PeerID: nodeKeys.PeerID, - TransmitAccount: types.Account(nodeKeys.TXKey.Data.Attributes.PublicKey), - }, - ConfigEncryptionPublicKey: cfgPubKeyBytes, - }) - } - // program sorts oracles (need to pre-sort to allow correct onchainConfig generation) - sort.Slice(oracleIdentities, func(i, j int) bool { - return bytes.Compare(oracleIdentities[i].OracleIdentity.OnchainPublicKey, oracleIdentities[j].OracleIdentity.OnchainPublicKey) < 0 - }) - return oracleIdentities, nil -} - func FundOracles(c *solclient.Client, nkb []client.NodeKeysBundle, amount *big.Float) error { for _, nk := range nkb { addr := nk.TXKey.Data.Attributes.PublicKey diff --git a/integration-tests/go.mod b/integration-tests/go.mod index ceb775d6a..5ebe9c12f 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -23,7 +23,6 @@ require ( github.com/smartcontractkit/seth v1.0.11 github.com/stretchr/testify v1.9.0 github.com/testcontainers/testcontainers-go v0.28.0 - golang.org/x/crypto v0.22.0 golang.org/x/exp v0.0.0-20240213143201-ec583247a57a golang.org/x/sync v0.6.0 golang.org/x/text v0.14.0 @@ -434,6 +433,7 @@ require ( go.uber.org/zap v1.26.0 // indirect go4.org/netipx v0.0.0-20230125063823-8449b0a6169f // indirect golang.org/x/arch v0.7.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/mod v0.15.0 // indirect golang.org/x/net v0.24.0 // indirect golang.org/x/oauth2 v0.17.0 // indirect