diff --git a/integration-tests/common/common.go b/integration-tests/common/common.go index 9734207d..dd9de27c 100644 --- a/integration-tests/common/common.go +++ b/integration-tests/common/common.go @@ -46,8 +46,8 @@ type Common struct { ChainId string NodeCount int TTL time.Duration - RPCUrl string - PrivateKey string + NodeUrl string + Mnemonic string Account string ObservationSource string JuelsPerFeeCoinSource string @@ -101,8 +101,8 @@ func NewCommon() *Common { ChainId: chainID, NodeCount: getNodeCount(), TTL: getTTL(), - RPCUrl: getEnv("RPC_URL"), - PrivateKey: getEnv("PRIVATE_KEY"), + NodeUrl: getEnv("NODE_URL"), + Mnemonic: getEnv("MNEMONIC"), Account: getEnv("ACCOUNT"), ObservationSource: observationSource, JuelsPerFeeCoinSource: juelsPerFeeCoinSource, @@ -121,8 +121,8 @@ func (c *Common) SetDefaultEnvironment(t *testing.T) { //if c.Testnet { //wasmdUrl = c.RPCUrl //} - if c.RPCUrl != "" { - wasmdUrl = c.RPCUrl + if c.NodeUrl != "" { + wasmdUrl = c.NodeUrl } baseTOML := fmt.Sprintf(`[[Cosmos]] Enabled = true diff --git a/integration-tests/gauntlet/gauntlet.go b/integration-tests/gauntlet/gauntlet.go index 3113972a..6258d691 100644 --- a/integration-tests/gauntlet/gauntlet.go +++ b/integration-tests/gauntlet/gauntlet.go @@ -74,8 +74,9 @@ func (cg *CosmosGauntlet) FetchGauntletJsonOutput() (*GauntletResponse, error) { } // SetupNetwork Sets up a new network and sets the NODE_URL for Devnet / Cosmos RPC -func (cg *CosmosGauntlet) SetupNetwork(addr string) error { - cg.G.AddNetworkConfigVar("NODE_URL", addr) +func (cg *CosmosGauntlet) SetupNetwork(nodeUrl string, mnemonic string) error { + cg.G.AddNetworkConfigVar("NODE_URL", nodeUrl) + cg.G.AddNetworkConfigVar("MNEMONIC", mnemonic) err := cg.G.WriteNetworkConfigMap(cg.dir + "packages-ts/gauntlet-cosmos-contracts/networks/") if err != nil { return err @@ -94,8 +95,8 @@ func (cg *CosmosGauntlet) InstallDependencies() error { return nil } -func (cg *CosmosGauntlet) UploadContract(name string) (int, error) { - _, err := cg.G.ExecCommand([]string{"upload", name}, *cg.options) +func (cg *CosmosGauntlet) UploadContracts(names []string) (int, error) { + _, err := cg.G.ExecCommand(append([]string{"upload"}, names...), *cg.options) if err != nil { return 0, err } @@ -169,16 +170,15 @@ func (cg *CosmosGauntlet) DeployOCR2ControllerContract(minSubmissionValue int64, } func (cg *CosmosGauntlet) DeployAccessControllerContract() (string, error) { - return "", errors.New("TODO") - // _, err := cg.G.ExecCommand([]string{"access_controller:deploy"}, *cg.options) - // if err != nil { - // return "", err - // } - // cg.gr, err = cg.FetchGauntletJsonOutput() - // if err != nil { - // return "", err - // } - // return cg.gr.Responses[0].Contract, nil + _, err := cg.G.ExecCommand([]string{"access_controller:deploy"}, *cg.options) + if err != nil { + return "", err + } + cg.gr, err = cg.FetchGauntletJsonOutput() + if err != nil { + return "", err + } + return cg.gr.Responses[0].Contract, nil } func (cg *CosmosGauntlet) DeployOCR2ProxyContract(aggregator string) (string, error) { diff --git a/integration-tests/ocr2_test.go b/integration-tests/ocr2_test.go index 5281acdc..1dec51e0 100644 --- a/integration-tests/ocr2_test.go +++ b/integration-tests/ocr2_test.go @@ -28,7 +28,7 @@ func TestOCRBasic(t *testing.T) { err = cg.InstallDependencies() require.NoError(t, err, "Failed to install gauntlet dependencies") - err = cg.SetupNetwork(commonConfig.RPCUrl) + err = cg.SetupNetwork(commonConfig.NodeUrl, commonConfig.Mnemonic) require.NoError(t, err, "Setting up gauntlet network should not fail") // TODO: uncomment once we are ready to test rounds @@ -37,7 +37,7 @@ func TestOCRBasic(t *testing.T) { // TODO: fund nodes if necessary // store the cw20_base contract so we have the token contract, and then deploy the LINK token. - _, err = cg.UploadContract("cw20_base") + _, err = cg.UploadContracts([]string{"cw20_base", "access_controller"}) require.NoError(t, err, "Could not upload cw20_base contract") linkTokenAddress, err := cg.DeployLinkTokenContract() @@ -74,7 +74,7 @@ func TestOCRBasic(t *testing.T) { _, err = cg.SetOCRBilling(observationPaymentGjuels, transmissionPaymentGjuels, ocrAddress) require.NoError(t, err, "Could not set OCR billing") - chainlinkClient, err := common.NewChainlinkClient(commonConfig.Env, commonConfig.ChainName, commonConfig.ChainId, commonConfig.RPCUrl) + chainlinkClient, err := common.NewChainlinkClient(commonConfig.Env, commonConfig.ChainName, commonConfig.ChainId, commonConfig.NodeUrl) require.NoError(t, err, "Could not create chainlink client") cfg, err := chainlinkClient.LoadOCR2Config([]string{commonConfig.Account})