diff --git a/integration-tests/common/common.go b/integration-tests/common/common.go index bf0887c4d..79e0d0aed 100644 --- a/integration-tests/common/common.go +++ b/integration-tests/common/common.go @@ -112,8 +112,15 @@ func New(testConfig *tc.TestConfig) *Common { privateKeyString := fmt.Sprintf("[%s]", formatBuffer([]byte(privateKey))) publicKey := privateKey.PublicKey().String() + if *testConfig.Common.Network == "mainnet" { + config = chainConfig.MainnetConfig() + } + if *testConfig.Common.Network == "devnet" { config = chainConfig.DevnetConfig() + } + + if *testConfig.Common.Network == "devnet" || *testConfig.Common.Network == "mainnet" { privateKeyString = *testConfig.Common.PrivateKey if len(*testConfig.Common.RPCURLs) > 0 { diff --git a/integration-tests/common/test_common.go b/integration-tests/common/test_common.go index d84070040..1c31f1f2d 100644 --- a/integration-tests/common/test_common.go +++ b/integration-tests/common/test_common.go @@ -117,7 +117,7 @@ func (m *OCRv2TestState) DeployCluster(contractsDir string) { m.Common.ChainDetails.RPCURLExternal = m.Common.Env.URLs["sol"][0] m.Common.ChainDetails.WSURLExternal = m.Common.Env.URLs["sol"][1] - if *m.Config.TestConfig.Common.Network == "devnet" { + if *m.Config.TestConfig.Common.Network == "devnet" || *m.Config.TestConfig.Common.Network == "mainnet"{ m.Common.ChainDetails.RPCUrls = *m.Config.TestConfig.Common.RPCURLs m.Common.ChainDetails.RPCURLExternal = (*m.Config.TestConfig.Common.RPCURLs)[0] m.Common.ChainDetails.WSURLExternal = (*m.Config.TestConfig.Common.WsURLs)[0] @@ -137,7 +137,7 @@ func (m *OCRv2TestState) DeployCluster(contractsDir string) { m.Common.ChainDetails.RPCURLExternal = sol.ExternalHTTPURL m.Common.ChainDetails.WSURLExternal = sol.ExternalWsURL - if *m.Config.TestConfig.Common.Network == "devnet" { + if *m.Config.TestConfig.Common.Network == "devnet" || *m.Config.TestConfig.Common.Network == "mainnet" { m.Common.ChainDetails.RPCUrls = *m.Config.TestConfig.Common.RPCURLs m.Common.ChainDetails.RPCURLExternal = (*m.Config.TestConfig.Common.RPCURLs)[0] m.Common.ChainDetails.WSURLExternal = (*m.Config.TestConfig.Common.WsURLs)[0] diff --git a/integration-tests/config/config.go b/integration-tests/config/config.go index 1b96b1f77..28a2b79cf 100644 --- a/integration-tests/config/config.go +++ b/integration-tests/config/config.go @@ -15,6 +15,16 @@ type ProgramAddresses struct { Store string } +func MainnetConfig() *Config { + return &Config{ + ChainName: "solana", + ChainID: "mainnet", + // Will be overridden if set in toml + RPCUrls: []string{"https://api.mainnet-beta.solana.com"}, + WSUrls: []string{"wss://api.mainnet-beta.solana.com"}, + } +} + func DevnetConfig() *Config { return &Config{ ChainName: "solana", diff --git a/integration-tests/smoke/ocr2_test.go b/integration-tests/smoke/ocr2_test.go index 92f6af18f..e9de5f60f 100644 --- a/integration-tests/smoke/ocr2_test.go +++ b/integration-tests/smoke/ocr2_test.go @@ -100,7 +100,7 @@ func startOCR2DataFeedsSmokeTest(t *testing.T, testname string, testenv map[stri err = sg.InstallDependencies() require.NoError(t, err, "Error installing gauntlet dependencies") - if *config.Common.Network == "devnet" { + if *config.Common.Network == "devnet" || *config.Common.Network == "mainnet" { state.Common.ChainDetails.ProgramAddresses.OCR2 = *config.SolanaConfig.OCR2ProgramID state.Common.ChainDetails.ProgramAddresses.AccessController = *config.SolanaConfig.AccessControllerProgramID state.Common.ChainDetails.ProgramAddresses.Store = *config.SolanaConfig.StoreProgramID diff --git a/integration-tests/soak/ocr2_test.go b/integration-tests/soak/ocr2_test.go index de0bc78a7..ccdc7b34b 100644 --- a/integration-tests/soak/ocr2_test.go +++ b/integration-tests/soak/ocr2_test.go @@ -93,7 +93,7 @@ func TestSolanaOCRV2Soak(t *testing.T) { err = sg.InstallDependencies() require.NoError(t, err, "Error installing gauntlet dependencies") - if *config.Common.Network == "devnet" { + if *config.Common.Network == "devnet" || *config.Common.Network == "mainnet" { state.Common.ChainDetails.ProgramAddresses.OCR2 = *config.SolanaConfig.OCR2ProgramID state.Common.ChainDetails.ProgramAddresses.AccessController = *config.SolanaConfig.AccessControllerProgramID state.Common.ChainDetails.ProgramAddresses.Store = *config.SolanaConfig.StoreProgramID diff --git a/integration-tests/testconfig/testconfig.go b/integration-tests/testconfig/testconfig.go index 36a86c4db..c9a5bd378 100644 --- a/integration-tests/testconfig/testconfig.go +++ b/integration-tests/testconfig/testconfig.go @@ -422,7 +422,7 @@ func (c *Common) Validate() error { if c.DevnetImage == nil { return fmt.Errorf("devnet_image must be set") } - case "devnet": + case "devnet", "mainnet": if c.PrivateKey == nil { return fmt.Errorf("private_key must be set") } @@ -434,7 +434,7 @@ func (c *Common) Validate() error { } default: - return fmt.Errorf("network must be either 'localnet' or 'devnet'") + return fmt.Errorf("network must be either 'localnet', 'devnet', or 'mainnet'") } if c.InsideK8s == nil {