diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0a546eaf652..5cffaffe854 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -103,8 +103,9 @@ core/scripts/gateway @smartcontractkit/dev-services # Deployment tooling # Initially the common structures owned by CCIP -/integration-tests/deployment @smartcontractkit/ccip +/integration-tests/deployment @smartcontractkit/ccip @smartcontractkit/keystone /integration-tests/deployment/ccip @smartcontractkit/ccip +/integration-tests/deployment/keystone @smartcontractkit/keystone # TODO: As more products add their deployment logic here, add the team as an owner # CI/CD diff --git a/integration-tests/deployment/keystone/changeset/0004_configure_contracts.go b/integration-tests/deployment/keystone/changeset/configure_contracts.go similarity index 88% rename from integration-tests/deployment/keystone/changeset/0004_configure_contracts.go rename to integration-tests/deployment/keystone/changeset/configure_contracts.go index 3db0be0a666..796a4247969 100644 --- a/integration-tests/deployment/keystone/changeset/0004_configure_contracts.go +++ b/integration-tests/deployment/keystone/changeset/configure_contracts.go @@ -9,8 +9,7 @@ import ( kslib "github.com/smartcontractkit/chainlink/integration-tests/deployment/keystone" ) -// func Apply0004(lggr logger.Logger, env deployment.Environment, ab deployment.AddressBook, registryChainSel uint64) (deployment.ChangesetOutput, error) { -func Apply0004(lggr logger.Logger, req *kslib.ConfigureContractsRequest) (deployment.ChangesetOutput, error) { +func ConfigureInitialContracts(lggr logger.Logger, req *kslib.ConfigureContractsRequest) (deployment.ChangesetOutput, error) { if err := req.Validate(); err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("failed to validate request: %w", err) } diff --git a/integration-tests/deployment/keystone/changeset/0003_deploy_forwarder.go b/integration-tests/deployment/keystone/changeset/deploy_forwarder.go similarity index 86% rename from integration-tests/deployment/keystone/changeset/0003_deploy_forwarder.go rename to integration-tests/deployment/keystone/changeset/deploy_forwarder.go index adb71dc97f3..7f5bb83a375 100644 --- a/integration-tests/deployment/keystone/changeset/0003_deploy_forwarder.go +++ b/integration-tests/deployment/keystone/changeset/deploy_forwarder.go @@ -8,8 +8,7 @@ import ( kslib "github.com/smartcontractkit/chainlink/integration-tests/deployment/keystone" ) -func Apply0003(lggr logger.Logger, env deployment.Environment, ab deployment.AddressBook, registryChainSel uint64) (deployment.ChangesetOutput, error) { - +func DeployForwarder(lggr logger.Logger, env deployment.Environment, ab deployment.AddressBook, registryChainSel uint64) (deployment.ChangesetOutput, error) { // expect OCR3 to be deployed & capabilities registry regAddrs, err := ab.AddressesForChain(registryChainSel) if err != nil { diff --git a/integration-tests/deployment/keystone/changeset/0003_deploy_forwarder_test.go b/integration-tests/deployment/keystone/changeset/deploy_forwarder_test.go similarity index 91% rename from integration-tests/deployment/keystone/changeset/0003_deploy_forwarder_test.go rename to integration-tests/deployment/keystone/changeset/deploy_forwarder_test.go index 4814698acd9..fc74b68dd16 100644 --- a/integration-tests/deployment/keystone/changeset/0003_deploy_forwarder_test.go +++ b/integration-tests/deployment/keystone/changeset/deploy_forwarder_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/integration-tests/deployment/memory" ) -func TestApply0003(t *testing.T) { +func TestDeployForwarder(t *testing.T) { t.Parallel() lggr := logger.Test(t) @@ -33,7 +33,7 @@ func TestApply0003(t *testing.T) { } deployment.NewMemoryAddressBookFromMap(m) // capabilities registry and ocr3 must be deployed on registry chain - _, err := changeset.Apply0003(lggr, env, ab, registrySel) + _, err := changeset.DeployForwarder(lggr, env, ab, registrySel) require.Error(t, err) }) @@ -45,7 +45,7 @@ func TestApply0003(t *testing.T) { } deployment.NewMemoryAddressBookFromMap(m) // capabilities registry and ocr3 must be deployed on registry chain - _, err := changeset.Apply0003(lggr, env, ab, registrySel) + _, err := changeset.DeployForwarder(lggr, env, ab, registrySel) require.Error(t, err) }) @@ -59,7 +59,7 @@ func TestApply0003(t *testing.T) { err = ab.Save(registrySel, "0x0000000000000000000000000000000000000002", kslb.OCR3CapabilityTypeVersion) require.NoError(t, err) // deploy forwarder - resp, err := changeset.Apply0003(lggr, env, ab, registrySel) + resp, err := changeset.DeployForwarder(lggr, env, ab, registrySel) require.NoError(t, err) require.NotNil(t, resp) // registry, ocr3, forwarder should be deployed on registry chain diff --git a/integration-tests/deployment/keystone/changeset/0002_deploy_ocr3.go b/integration-tests/deployment/keystone/changeset/deploy_ocr3.go similarity index 88% rename from integration-tests/deployment/keystone/changeset/0002_deploy_ocr3.go rename to integration-tests/deployment/keystone/changeset/deploy_ocr3.go index aa106f0a8fb..51566787bd0 100644 --- a/integration-tests/deployment/keystone/changeset/0002_deploy_ocr3.go +++ b/integration-tests/deployment/keystone/changeset/deploy_ocr3.go @@ -8,7 +8,7 @@ import ( kslib "github.com/smartcontractkit/chainlink/integration-tests/deployment/keystone" ) -func Apply0002(lggr logger.Logger, env deployment.Environment, ab deployment.AddressBook, registryChainSel uint64) (deployment.ChangesetOutput, error) { +func DeployOCR3(lggr logger.Logger, env deployment.Environment, ab deployment.AddressBook, registryChainSel uint64) (deployment.ChangesetOutput, error) { // must have capabilities registry deployed regAddrs, err := ab.AddressesForChain(registryChainSel) if err != nil { diff --git a/integration-tests/deployment/keystone/changeset/0002_deploy_ocr3_test.go b/integration-tests/deployment/keystone/changeset/deploy_ocr3_test.go similarity index 90% rename from integration-tests/deployment/keystone/changeset/0002_deploy_ocr3_test.go rename to integration-tests/deployment/keystone/changeset/deploy_ocr3_test.go index f985258b3c6..eb7e34e7bcd 100644 --- a/integration-tests/deployment/keystone/changeset/0002_deploy_ocr3_test.go +++ b/integration-tests/deployment/keystone/changeset/deploy_ocr3_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/integration-tests/deployment/memory" ) -func TestApply0002(t *testing.T) { +func TestDeployOCR3(t *testing.T) { t.Parallel() lggr := logger.Test(t) ab := deployment.NewMemoryAddressBook() @@ -27,13 +27,13 @@ func TestApply0002(t *testing.T) { registrySel := env.AllChainSelectors()[0] // err if no capabilities registry on chain 0 - _, err := changeset.Apply0002(lggr, env, ab, registrySel) + _, err := changeset.DeployOCR3(lggr, env, ab, registrySel) require.Error(t, err) // fake capabilities registry err = ab.Save(registrySel, "0x0000000000000000000000000000000000000001", kslb.CapabilityRegistryTypeVersion) require.NoError(t, err) - resp, err := changeset.Apply0002(lggr, env, ab, registrySel) + resp, err := changeset.DeployOCR3(lggr, env, ab, registrySel) require.NoError(t, err) require.NotNil(t, resp) // OCR3 should be deployed on chain 0 diff --git a/integration-tests/deployment/keystone/changeset/0001_deploy_registry.go b/integration-tests/deployment/keystone/changeset/deploy_registry.go similarity index 78% rename from integration-tests/deployment/keystone/changeset/0001_deploy_registry.go rename to integration-tests/deployment/keystone/changeset/deploy_registry.go index 887ef2de009..d161c3f6cdd 100644 --- a/integration-tests/deployment/keystone/changeset/0001_deploy_registry.go +++ b/integration-tests/deployment/keystone/changeset/deploy_registry.go @@ -8,7 +8,7 @@ import ( kslib "github.com/smartcontractkit/chainlink/integration-tests/deployment/keystone" ) -func Apply0001(lggr logger.Logger, env deployment.Environment, ab deployment.AddressBook, registryChainSel uint64) (deployment.ChangesetOutput, error) { +func DeployCapabilityRegistry(lggr logger.Logger, env deployment.Environment, ab deployment.AddressBook, registryChainSel uint64) (deployment.ChangesetOutput, error) { c, ok := env.Chains[registryChainSel] if !ok { return deployment.ChangesetOutput{}, fmt.Errorf("chain not found in environment") diff --git a/integration-tests/deployment/keystone/changeset/0001_deploy_registry_test.go b/integration-tests/deployment/keystone/changeset/deploy_registry_test.go similarity index 89% rename from integration-tests/deployment/keystone/changeset/0001_deploy_registry_test.go rename to integration-tests/deployment/keystone/changeset/deploy_registry_test.go index 8aca7c09105..11e794a92eb 100644 --- a/integration-tests/deployment/keystone/changeset/0001_deploy_registry_test.go +++ b/integration-tests/deployment/keystone/changeset/deploy_registry_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/integration-tests/deployment/memory" ) -func TestApply0001(t *testing.T) { +func TestDeployCapabilityRegistry(t *testing.T) { t.Parallel() lggr := logger.Test(t) ab := deployment.NewMemoryAddressBook() @@ -24,7 +24,7 @@ func TestApply0001(t *testing.T) { env := memory.NewMemoryEnvironment(t, lggr, zapcore.DebugLevel, cfg) registrySel := env.AllChainSelectors()[0] - resp, err := changeset.Apply0001(lggr, env, ab, registrySel) + resp, err := changeset.DeployCapabilityRegistry(lggr, env, ab, registrySel) require.NoError(t, err) require.NotNil(t, resp) // capabilities registry should be deployed on chain 0 diff --git a/integration-tests/deployment/keystone/deploy.go b/integration-tests/deployment/keystone/deploy.go index e108bc6ba4e..514ff5ca395 100644 --- a/integration-tests/deployment/keystone/deploy.go +++ b/integration-tests/deployment/keystone/deploy.go @@ -497,11 +497,16 @@ func DecodeErr(encodedABI string, err error) error { var d rpc.DataError ok := errors.As(err, &d) if ok { - errStr, parseErr := deployment.ParseErrorFromABI(d.ErrorData().(string), encodedABI) + encErr, ok := d.ErrorData().(string) + if !ok { + return fmt.Errorf("error without error data: %s", d.Error()) + } + errStr, parseErr := deployment.ParseErrorFromABI(encErr, encodedABI) if parseErr != nil { - return fmt.Errorf("failed to decode error with abi: %w", parseErr) + return fmt.Errorf("failed to decode error '%s' with abi: %w", encErr, parseErr) } return fmt.Errorf("contract error: %s", errStr) + } return fmt.Errorf("cannot decode error with abi: %w", err) }