From 968a1b3553524d5dc7b4c86f687bd5fd28e94b39 Mon Sep 17 00:00:00 2001 From: Pablo Date: Thu, 25 Jun 2026 22:04:23 -0600 Subject: [PATCH 1/2] chore: move opsutils back to legacy folder --- .gitignore | 2 ++ legacy/mcms/changesets/deploy_mcms_with_timelock.go | 2 +- .../internal/family/evm/changesets/deploy_mcms_with_timelock.go | 2 +- legacy/mcms/internal/family/evm/changesets/grant_timelock.go | 2 +- .../mcms/internal/family/evm/operations/op_deploy_call_proxy.go | 2 +- .../mcms/internal/family/evm/operations/op_deploy_timelock.go | 2 +- legacy/mcms/internal/family/evm/operations/op_grant_role.go | 2 +- legacy/mcms/internal/family/evm/operations/op_set_config_mcm.go | 2 +- legacy/mcms/internal/family/evm/operations/ops_deploy_mcm.go | 2 +- .../family/evm/sequences/seq_grant_roles_for_timelock.go | 2 +- .../mcms/internal/family/evm/sequences/seq_mcm_with_config.go | 2 +- {mcms/evm => legacy/mcms}/operations/oputils.go | 0 {mcms/evm => legacy/mcms}/operations/oputils_test.go | 2 +- mcms/evm/grant-role/operation.go | 2 +- mcms/evm/grant-role/operation_test.go | 2 +- 15 files changed, 15 insertions(+), 13 deletions(-) rename {mcms/evm => legacy/mcms}/operations/oputils.go (100%) rename {mcms/evm => legacy/mcms}/operations/oputils_test.go (99%) diff --git a/.gitignore b/.gitignore index 57fe6ce..68525fa 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,5 @@ go.work.sum .idea/ .vscode/ .gocache/ +.golangci-cache/ +.gomodcache/ diff --git a/legacy/mcms/changesets/deploy_mcms_with_timelock.go b/legacy/mcms/changesets/deploy_mcms_with_timelock.go index bbfa816..60237a6 100644 --- a/legacy/mcms/changesets/deploy_mcms_with_timelock.go +++ b/legacy/mcms/changesets/deploy_mcms_with_timelock.go @@ -21,9 +21,9 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/operations" evmchangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/internal/family/evm/changesets" + evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/evm" solchangesets "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/solana/changesets" - evmops "github.com/smartcontractkit/cld-changesets/mcms/evm/operations" ) // migrateAddressBookWithQualifiers migrates an address book to a data store, diff --git a/legacy/mcms/internal/family/evm/changesets/deploy_mcms_with_timelock.go b/legacy/mcms/internal/family/evm/changesets/deploy_mcms_with_timelock.go index 4878100..55e6554 100644 --- a/legacy/mcms/internal/family/evm/changesets/deploy_mcms_with_timelock.go +++ b/legacy/mcms/internal/family/evm/changesets/deploy_mcms_with_timelock.go @@ -12,8 +12,8 @@ import ( opevm "github.com/smartcontractkit/cld-changesets/legacy/mcms/internal/family/evm/operations" seqevm "github.com/smartcontractkit/cld-changesets/legacy/mcms/internal/family/evm/sequences" + evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" evmstate "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/evm" - evmops "github.com/smartcontractkit/cld-changesets/mcms/evm/operations" ) // DeployMCMSOption is a function that modifies a TypeAndVersion before or after deployment. diff --git a/legacy/mcms/internal/family/evm/changesets/grant_timelock.go b/legacy/mcms/internal/family/evm/changesets/grant_timelock.go index baad6bd..f358bdb 100644 --- a/legacy/mcms/internal/family/evm/changesets/grant_timelock.go +++ b/legacy/mcms/internal/family/evm/changesets/grant_timelock.go @@ -21,7 +21,7 @@ import ( "github.com/smartcontractkit/cld-changesets/internal/mcmsrole" seqevm "github.com/smartcontractkit/cld-changesets/legacy/mcms/internal/family/evm/sequences" - evmops "github.com/smartcontractkit/cld-changesets/mcms/evm/operations" + evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" ) // GrantRolesForTimelock grants RBACTimelock roles to the MCMS contracts in timelockContracts. diff --git a/legacy/mcms/internal/family/evm/operations/op_deploy_call_proxy.go b/legacy/mcms/internal/family/evm/operations/op_deploy_call_proxy.go index 5b210c5..7251e06 100644 --- a/legacy/mcms/internal/family/evm/operations/op_deploy_call_proxy.go +++ b/legacy/mcms/internal/family/evm/operations/op_deploy_call_proxy.go @@ -9,7 +9,7 @@ import ( zkbindings "github.com/smartcontractkit/mcms/sdk/zksync/bindings" "github.com/smartcontractkit/cld-changesets/internal/semvers" - "github.com/smartcontractkit/cld-changesets/mcms/evm/operations" + "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" ) type OpDeployCallProxyInput struct { diff --git a/legacy/mcms/internal/family/evm/operations/op_deploy_timelock.go b/legacy/mcms/internal/family/evm/operations/op_deploy_timelock.go index 63923a3..6e9c8d8 100644 --- a/legacy/mcms/internal/family/evm/operations/op_deploy_timelock.go +++ b/legacy/mcms/internal/family/evm/operations/op_deploy_timelock.go @@ -11,7 +11,7 @@ import ( zkbindings "github.com/smartcontractkit/mcms/sdk/zksync/bindings" "github.com/smartcontractkit/cld-changesets/internal/semvers" - "github.com/smartcontractkit/cld-changesets/mcms/evm/operations" + "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" ) type OpDeployTimelockInput struct { diff --git a/legacy/mcms/internal/family/evm/operations/op_grant_role.go b/legacy/mcms/internal/family/evm/operations/op_grant_role.go index 86df913..2e1ef7b 100644 --- a/legacy/mcms/internal/family/evm/operations/op_grant_role.go +++ b/legacy/mcms/internal/family/evm/operations/op_grant_role.go @@ -9,7 +9,7 @@ import ( mcmscontracts "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/contracts/mcms" "github.com/smartcontractkit/mcms/sdk/evm/bindings" - "github.com/smartcontractkit/cld-changesets/mcms/evm/operations" + "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" ) type OpGrantRoleInput struct { diff --git a/legacy/mcms/internal/family/evm/operations/op_set_config_mcm.go b/legacy/mcms/internal/family/evm/operations/op_set_config_mcm.go index 86cb848..ebc07ac 100644 --- a/legacy/mcms/internal/family/evm/operations/op_set_config_mcm.go +++ b/legacy/mcms/internal/family/evm/operations/op_set_config_mcm.go @@ -9,7 +9,7 @@ import ( bindings "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" mcmscontracts "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/contracts/mcms" - "github.com/smartcontractkit/cld-changesets/mcms/evm/operations" + "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" ) type OpEVMSetConfigMCMInput struct { diff --git a/legacy/mcms/internal/family/evm/operations/ops_deploy_mcm.go b/legacy/mcms/internal/family/evm/operations/ops_deploy_mcm.go index e8f39b8..9bf0347 100644 --- a/legacy/mcms/internal/family/evm/operations/ops_deploy_mcm.go +++ b/legacy/mcms/internal/family/evm/operations/ops_deploy_mcm.go @@ -9,7 +9,7 @@ import ( zkbindings "github.com/smartcontractkit/mcms/sdk/zksync/bindings" "github.com/smartcontractkit/cld-changesets/internal/semvers" - "github.com/smartcontractkit/cld-changesets/mcms/evm/operations" + "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" ) type OpEVMDeployMCMOutput struct { diff --git a/legacy/mcms/internal/family/evm/sequences/seq_grant_roles_for_timelock.go b/legacy/mcms/internal/family/evm/sequences/seq_grant_roles_for_timelock.go index faae1a8..2c1791e 100644 --- a/legacy/mcms/internal/family/evm/sequences/seq_grant_roles_for_timelock.go +++ b/legacy/mcms/internal/family/evm/sequences/seq_grant_roles_for_timelock.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/cld-changesets/internal/mcmsrole" opevmlegacy "github.com/smartcontractkit/cld-changesets/legacy/mcms/internal/family/evm/operations" - evmops "github.com/smartcontractkit/cld-changesets/mcms/evm/operations" + evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" ) type SeqGrantRolesTimelockDeps struct { diff --git a/legacy/mcms/internal/family/evm/sequences/seq_mcm_with_config.go b/legacy/mcms/internal/family/evm/sequences/seq_mcm_with_config.go index 2378498..fa667e8 100644 --- a/legacy/mcms/internal/family/evm/sequences/seq_mcm_with_config.go +++ b/legacy/mcms/internal/family/evm/sequences/seq_mcm_with_config.go @@ -15,7 +15,7 @@ import ( mcmsTypes "github.com/smartcontractkit/mcms/types" opevmlegacy "github.com/smartcontractkit/cld-changesets/legacy/mcms/internal/family/evm/operations" - evmops "github.com/smartcontractkit/cld-changesets/mcms/evm/operations" + evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" ) type SeqDeployMCMWithConfigInput struct { diff --git a/mcms/evm/operations/oputils.go b/legacy/mcms/operations/oputils.go similarity index 100% rename from mcms/evm/operations/oputils.go rename to legacy/mcms/operations/oputils.go diff --git a/mcms/evm/operations/oputils_test.go b/legacy/mcms/operations/oputils_test.go similarity index 99% rename from mcms/evm/operations/oputils_test.go rename to legacy/mcms/operations/oputils_test.go index ebac34b..d3eaa97 100644 --- a/mcms/evm/operations/oputils_test.go +++ b/legacy/mcms/operations/oputils_test.go @@ -27,8 +27,8 @@ import ( mcmstypes "github.com/smartcontractkit/mcms/types" mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" + evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" evmstate "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/evm" - evmops "github.com/smartcontractkit/cld-changesets/mcms/evm/operations" ) func TestCloneTransactOptsWithGas(t *testing.T) { diff --git a/mcms/evm/grant-role/operation.go b/mcms/evm/grant-role/operation.go index 0961722..beb16f6 100644 --- a/mcms/evm/grant-role/operation.go +++ b/mcms/evm/grant-role/operation.go @@ -9,7 +9,7 @@ import ( mcmscontracts "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/contracts/mcms" "github.com/smartcontractkit/mcms/sdk/evm/bindings" - evmops "github.com/smartcontractkit/cld-changesets/mcms/evm/operations" + evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" ) // OpGrantRoleInput is the input to OpGrantRole. diff --git a/mcms/evm/grant-role/operation_test.go b/mcms/evm/grant-role/operation_test.go index b9b9e53..d42e527 100644 --- a/mcms/evm/grant-role/operation_test.go +++ b/mcms/evm/grant-role/operation_test.go @@ -16,9 +16,9 @@ import ( mcmsevmsdk "github.com/smartcontractkit/mcms/sdk/evm" "github.com/smartcontractkit/cld-changesets/internal/mcmsrole" + evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" timelockops "github.com/smartcontractkit/cld-changesets/mcms/evm/deploy/v1_0_0/operations/rbac_timelock" evmgrantrole "github.com/smartcontractkit/cld-changesets/mcms/evm/grant-role" - evmops "github.com/smartcontractkit/cld-changesets/mcms/evm/operations" ) // TestOpGrantRole deploys a timelock with the deployer as admin and grants the From d5645bf623172422df331080c92246e2e25ee7b9 Mon Sep 17 00:00:00 2001 From: Pablo Date: Thu, 25 Jun 2026 22:14:49 -0600 Subject: [PATCH 2/2] fix: move into separate pkg to avoid import cycle --- .../changesets/deploy_mcms_with_timelock.go | 2 +- .../changesets/deploy_mcms_with_timelock.go | 2 +- .../family/evm/changesets/grant_timelock.go | 2 +- .../evm/operations/op_deploy_call_proxy.go | 6 +- .../evm/operations/op_deploy_timelock.go | 6 +- .../family/evm/operations/op_grant_role.go | 4 +- .../evm/operations/op_set_config_mcm.go | 4 +- .../family/evm/operations/ops_deploy_mcm.go | 14 ++-- .../sequences/seq_grant_roles_for_timelock.go | 2 +- .../evm/sequences/seq_mcm_with_config.go | 2 +- .../mcms/{operations => oputils}/oputils.go | 2 +- .../{operations => oputils}/oputils_test.go | 84 +++++++++---------- mcms/evm/grant-role/operation.go | 2 +- mcms/evm/grant-role/operation_test.go | 2 +- 14 files changed, 67 insertions(+), 67 deletions(-) rename legacy/mcms/{operations => oputils}/oputils.go (99%) rename legacy/mcms/{operations => oputils}/oputils_test.go (76%) diff --git a/legacy/mcms/changesets/deploy_mcms_with_timelock.go b/legacy/mcms/changesets/deploy_mcms_with_timelock.go index 60237a6..3d9ec92 100644 --- a/legacy/mcms/changesets/deploy_mcms_with_timelock.go +++ b/legacy/mcms/changesets/deploy_mcms_with_timelock.go @@ -21,7 +21,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/operations" evmchangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/internal/family/evm/changesets" - evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" + evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/oputils" "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/evm" solchangesets "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/solana/changesets" ) diff --git a/legacy/mcms/internal/family/evm/changesets/deploy_mcms_with_timelock.go b/legacy/mcms/internal/family/evm/changesets/deploy_mcms_with_timelock.go index 55e6554..6f09c1b 100644 --- a/legacy/mcms/internal/family/evm/changesets/deploy_mcms_with_timelock.go +++ b/legacy/mcms/internal/family/evm/changesets/deploy_mcms_with_timelock.go @@ -12,7 +12,7 @@ import ( opevm "github.com/smartcontractkit/cld-changesets/legacy/mcms/internal/family/evm/operations" seqevm "github.com/smartcontractkit/cld-changesets/legacy/mcms/internal/family/evm/sequences" - evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" + evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/oputils" evmstate "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/evm" ) diff --git a/legacy/mcms/internal/family/evm/changesets/grant_timelock.go b/legacy/mcms/internal/family/evm/changesets/grant_timelock.go index f358bdb..aa6d297 100644 --- a/legacy/mcms/internal/family/evm/changesets/grant_timelock.go +++ b/legacy/mcms/internal/family/evm/changesets/grant_timelock.go @@ -21,7 +21,7 @@ import ( "github.com/smartcontractkit/cld-changesets/internal/mcmsrole" seqevm "github.com/smartcontractkit/cld-changesets/legacy/mcms/internal/family/evm/sequences" - evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" + evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/oputils" ) // GrantRolesForTimelock grants RBACTimelock roles to the MCMS contracts in timelockContracts. diff --git a/legacy/mcms/internal/family/evm/operations/op_deploy_call_proxy.go b/legacy/mcms/internal/family/evm/operations/op_deploy_call_proxy.go index 7251e06..b0b862e 100644 --- a/legacy/mcms/internal/family/evm/operations/op_deploy_call_proxy.go +++ b/legacy/mcms/internal/family/evm/operations/op_deploy_call_proxy.go @@ -9,20 +9,20 @@ import ( zkbindings "github.com/smartcontractkit/mcms/sdk/zksync/bindings" "github.com/smartcontractkit/cld-changesets/internal/semvers" - "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" + "github.com/smartcontractkit/cld-changesets/legacy/mcms/oputils" ) type OpDeployCallProxyInput struct { Timelock common.Address `json:"timelock"` } -var OpDeployCallProxy = operations.NewEVMDeployOperation( +var OpDeployCallProxy = oputils.NewEVMDeployOperation( "evm-call-proxy-deploy", semver.MustParse("1.0.0"), "Deploys CallProxy contract on the specified EVM chains", mcmscontracts.CallProxy, bindings.CallProxyMetaData, - &operations.ContractOpts{ + &oputils.ContractOpts{ Version: &semvers.V1_0_0, EVMBytecode: common.FromHex(bindings.CallProxyBin), ZkSyncVMBytecode: zkbindings.CallProxyZkBytecode, diff --git a/legacy/mcms/internal/family/evm/operations/op_deploy_timelock.go b/legacy/mcms/internal/family/evm/operations/op_deploy_timelock.go index 6e9c8d8..00858a9 100644 --- a/legacy/mcms/internal/family/evm/operations/op_deploy_timelock.go +++ b/legacy/mcms/internal/family/evm/operations/op_deploy_timelock.go @@ -11,7 +11,7 @@ import ( zkbindings "github.com/smartcontractkit/mcms/sdk/zksync/bindings" "github.com/smartcontractkit/cld-changesets/internal/semvers" - "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" + "github.com/smartcontractkit/cld-changesets/legacy/mcms/oputils" ) type OpDeployTimelockInput struct { @@ -23,13 +23,13 @@ type OpDeployTimelockInput struct { Bypassers []common.Address `json:"bypassers"` // Bypasser of the timelock contract, usually the deployer key } -var OpDeployTimelock = operations.NewEVMDeployOperation( +var OpDeployTimelock = oputils.NewEVMDeployOperation( "evm-timelock-deploy", semver.MustParse("1.0.0"), "Deploys Timelock contract on the specified EVM chains", mcmscontracts.RBACTimelock, bindings.RBACTimelockMetaData, - &operations.ContractOpts{ + &oputils.ContractOpts{ Version: &semvers.V1_0_0, EVMBytecode: common.FromHex(bindings.RBACTimelockBin), ZkSyncVMBytecode: zkbindings.RBACTimelockZkBytecode, diff --git a/legacy/mcms/internal/family/evm/operations/op_grant_role.go b/legacy/mcms/internal/family/evm/operations/op_grant_role.go index 2e1ef7b..523cba0 100644 --- a/legacy/mcms/internal/family/evm/operations/op_grant_role.go +++ b/legacy/mcms/internal/family/evm/operations/op_grant_role.go @@ -9,7 +9,7 @@ import ( mcmscontracts "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/contracts/mcms" "github.com/smartcontractkit/mcms/sdk/evm/bindings" - "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" + "github.com/smartcontractkit/cld-changesets/legacy/mcms/oputils" ) type OpGrantRoleInput struct { @@ -17,7 +17,7 @@ type OpGrantRoleInput struct { RoleID [32]byte `json:"roleID"` } -var OpGrantRole = operations.NewEVMCallOperation( +var OpGrantRole = oputils.NewEVMCallOperation( "evm-timelock-grant-role", semver.MustParse("1.0.0"), "Grants specified role to the ManyChainMultiSig contract on the EVM Timelock contract", diff --git a/legacy/mcms/internal/family/evm/operations/op_set_config_mcm.go b/legacy/mcms/internal/family/evm/operations/op_set_config_mcm.go index ebc07ac..f71dc90 100644 --- a/legacy/mcms/internal/family/evm/operations/op_set_config_mcm.go +++ b/legacy/mcms/internal/family/evm/operations/op_set_config_mcm.go @@ -9,7 +9,7 @@ import ( bindings "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" mcmscontracts "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/contracts/mcms" - "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" + "github.com/smartcontractkit/cld-changesets/legacy/mcms/oputils" ) type OpEVMSetConfigMCMInput struct { @@ -19,7 +19,7 @@ type OpEVMSetConfigMCMInput struct { GroupParents [32]uint8 `json:"groupParents"` } -var OpEVMSetConfigMCM = operations.NewEVMCallOperation( +var OpEVMSetConfigMCM = oputils.NewEVMCallOperation( "evm-mcm-set-config", semver.MustParse("1.0.0"), "Sets Config on the deployed MCM contract", diff --git a/legacy/mcms/internal/family/evm/operations/ops_deploy_mcm.go b/legacy/mcms/internal/family/evm/operations/ops_deploy_mcm.go index 9bf0347..7dbee7f 100644 --- a/legacy/mcms/internal/family/evm/operations/ops_deploy_mcm.go +++ b/legacy/mcms/internal/family/evm/operations/ops_deploy_mcm.go @@ -9,20 +9,20 @@ import ( zkbindings "github.com/smartcontractkit/mcms/sdk/zksync/bindings" "github.com/smartcontractkit/cld-changesets/internal/semvers" - "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" + "github.com/smartcontractkit/cld-changesets/legacy/mcms/oputils" ) type OpEVMDeployMCMOutput struct { Address common.Address `json:"address"` } -var OpDeployProposerMCM = operations.NewEVMDeployOperation( +var OpDeployProposerMCM = oputils.NewEVMDeployOperation( "evm-proposer-mcm-deploy", semver.MustParse("1.0.0"), "Deploys Proposer MCM contract", mcmscontracts.ProposerManyChainMultisig, bindings.ManyChainMultiSigMetaData, - &operations.ContractOpts{ + &oputils.ContractOpts{ Version: &semvers.V1_0_0, EVMBytecode: common.FromHex(bindings.ManyChainMultiSigBin), ZkSyncVMBytecode: zkbindings.ManyChainMultiSigZkBytecode, @@ -32,13 +32,13 @@ var OpDeployProposerMCM = operations.NewEVMDeployOperation( }, ) -var OpDeployBypasserMCM = operations.NewEVMDeployOperation( +var OpDeployBypasserMCM = oputils.NewEVMDeployOperation( "evm-bypasser-mcm-deploy", semver.MustParse("1.0.0"), "Deploys Bypasser MCM contract", mcmscontracts.BypasserManyChainMultisig, bindings.ManyChainMultiSigMetaData, - &operations.ContractOpts{ + &oputils.ContractOpts{ Version: &semvers.V1_0_0, EVMBytecode: common.FromHex(bindings.ManyChainMultiSigBin), ZkSyncVMBytecode: zkbindings.ManyChainMultiSigZkBytecode, @@ -48,13 +48,13 @@ var OpDeployBypasserMCM = operations.NewEVMDeployOperation( }, ) -var OpDeployCancellerMCM = operations.NewEVMDeployOperation( +var OpDeployCancellerMCM = oputils.NewEVMDeployOperation( "evm-canceller-mcm-deploy", semver.MustParse("1.0.0"), "Deploys Canceller MCM contract", mcmscontracts.CancellerManyChainMultisig, bindings.ManyChainMultiSigMetaData, - &operations.ContractOpts{ + &oputils.ContractOpts{ Version: &semvers.V1_0_0, EVMBytecode: common.FromHex(bindings.ManyChainMultiSigBin), ZkSyncVMBytecode: zkbindings.ManyChainMultiSigZkBytecode, diff --git a/legacy/mcms/internal/family/evm/sequences/seq_grant_roles_for_timelock.go b/legacy/mcms/internal/family/evm/sequences/seq_grant_roles_for_timelock.go index 2c1791e..756e490 100644 --- a/legacy/mcms/internal/family/evm/sequences/seq_grant_roles_for_timelock.go +++ b/legacy/mcms/internal/family/evm/sequences/seq_grant_roles_for_timelock.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/cld-changesets/internal/mcmsrole" opevmlegacy "github.com/smartcontractkit/cld-changesets/legacy/mcms/internal/family/evm/operations" - evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" + evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/oputils" ) type SeqGrantRolesTimelockDeps struct { diff --git a/legacy/mcms/internal/family/evm/sequences/seq_mcm_with_config.go b/legacy/mcms/internal/family/evm/sequences/seq_mcm_with_config.go index fa667e8..a73425d 100644 --- a/legacy/mcms/internal/family/evm/sequences/seq_mcm_with_config.go +++ b/legacy/mcms/internal/family/evm/sequences/seq_mcm_with_config.go @@ -15,7 +15,7 @@ import ( mcmsTypes "github.com/smartcontractkit/mcms/types" opevmlegacy "github.com/smartcontractkit/cld-changesets/legacy/mcms/internal/family/evm/operations" - evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" + evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/oputils" ) type SeqDeployMCMWithConfigInput struct { diff --git a/legacy/mcms/operations/oputils.go b/legacy/mcms/oputils/oputils.go similarity index 99% rename from legacy/mcms/operations/oputils.go rename to legacy/mcms/oputils/oputils.go index 5a6ee40..193ba70 100644 --- a/legacy/mcms/operations/oputils.go +++ b/legacy/mcms/oputils/oputils.go @@ -1,4 +1,4 @@ -package operations +package oputils import ( "context" diff --git a/legacy/mcms/operations/oputils_test.go b/legacy/mcms/oputils/oputils_test.go similarity index 76% rename from legacy/mcms/operations/oputils_test.go rename to legacy/mcms/oputils/oputils_test.go index d3eaa97..51bdf0a 100644 --- a/legacy/mcms/operations/oputils_test.go +++ b/legacy/mcms/oputils/oputils_test.go @@ -1,4 +1,4 @@ -package operations_test +package oputils_test import ( "encoding/json" @@ -27,7 +27,7 @@ import ( mcmstypes "github.com/smartcontractkit/mcms/types" mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" - evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" + "github.com/smartcontractkit/cld-changesets/legacy/mcms/oputils" evmstate "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/evm" ) @@ -36,16 +36,16 @@ func TestCloneTransactOptsWithGas(t *testing.T) { orig := &bind.TransactOpts{GasLimit: 100, GasPrice: big.NewInt(123)} - cloned := evmops.CloneTransactOptsWithGas(orig, 200, 456) + cloned := oputils.CloneTransactOptsWithGas(orig, 200, 456) assert.NotSame(t, orig, cloned) assert.Equal(t, uint64(200), cloned.GasLimit) assert.Equal(t, big.NewInt(456), cloned.GasPrice) - cloned2 := evmops.CloneTransactOptsWithGas(orig, 0, 0) + cloned2 := oputils.CloneTransactOptsWithGas(orig, 0, 0) assert.Equal(t, orig.GasLimit, cloned2.GasLimit) assert.Equal(t, orig.GasPrice, cloned2.GasPrice) - assert.Nil(t, evmops.CloneTransactOptsWithGas(nil, 1, 1)) + assert.Nil(t, oputils.CloneTransactOptsWithGas(nil, 1, 1)) } func TestGasBoostConfigsForChainMap(t *testing.T) { @@ -55,24 +55,24 @@ func TestGasBoostConfigsForChainMap(t *testing.T) { gasBoostConfigs := map[uint64]cldfproposalutils.GasBoostConfig{ 1: {InitialGasLimit: 10}, } - cfgs := evmops.GasBoostConfigsForChainMap(chainMap, gasBoostConfigs) + cfgs := oputils.GasBoostConfigsForChainMap(chainMap, gasBoostConfigs) assert.Len(t, cfgs, 2) assert.NotNil(t, cfgs[1]) assert.Nil(t, cfgs[2]) - assert.Empty(t, evmops.GasBoostConfigsForChainMap[string](chainMap, nil)) - assert.Empty(t, evmops.GasBoostConfigsForChainMap[string](nil, gasBoostConfigs)) + assert.Empty(t, oputils.GasBoostConfigsForChainMap[string](chainMap, nil)) + assert.Empty(t, oputils.GasBoostConfigsForChainMap[string](nil, gasBoostConfigs)) } func TestGetBoostedGasForAttempt(t *testing.T) { t.Parallel() cfg := cldfproposalutils.GasBoostConfig{} - limit, price := evmops.GetBoostedGasForAttempt(cfg, 0) + limit, price := oputils.GetBoostedGasForAttempt(cfg, 0) assert.Equal(t, uint64(200_000), limit) assert.Equal(t, uint64(20_000_000_000), price) - limit, price = evmops.GetBoostedGasForAttempt(cfg, 2) + limit, price = oputils.GetBoostedGasForAttempt(cfg, 2) assert.Equal(t, uint64(200_000+2*50_000), limit) assert.Equal(t, uint64(20_000_000_000+2*10_000_000_000), price) @@ -82,7 +82,7 @@ func TestGetBoostedGasForAttempt(t *testing.T) { InitialGasPrice: 2000, GasPriceIncrement: 100, } - limit, price = evmops.GetBoostedGasForAttempt(cfg, 3) + limit, price = oputils.GetBoostedGasForAttempt(cfg, 3) assert.Equal(t, uint64(1000+3*100), limit) assert.Equal(t, uint64(2000+3*100), price) } @@ -91,10 +91,10 @@ func TestRetryWithGasBoost(t *testing.T) { t.Parallel() cfg := &cldfproposalutils.GasBoostConfig{InitialGasLimit: 1000, GasLimitIncrement: 100} - assert.NotNil(t, evmops.RetryDeploymentWithGasBoost[any](cfg)) - assert.NotNil(t, evmops.RetryDeploymentWithGasBoost[string](nil)) - assert.NotNil(t, evmops.RetryCallWithGasBoost[any](cfg)) - assert.NotNil(t, evmops.RetryCallWithGasBoost[string](nil)) + assert.NotNil(t, oputils.RetryDeploymentWithGasBoost[any](cfg)) + assert.NotNil(t, oputils.RetryDeploymentWithGasBoost[string](nil)) + assert.NotNil(t, oputils.RetryCallWithGasBoost[any](cfg)) + assert.NotNil(t, oputils.RetryCallWithGasBoost[string](nil)) } func TestContractOpts_Validate(t *testing.T) { @@ -102,34 +102,34 @@ func TestContractOpts_Validate(t *testing.T) { tests := []struct { desc string - opts *evmops.ContractOpts + opts *oputils.ContractOpts isZkSyncVM bool err string }{ { desc: "valid evm opts", - opts: &evmops.ContractOpts{Version: semver.MustParse("1.0.0"), EVMBytecode: []byte{0x01}}, + opts: &oputils.ContractOpts{Version: semver.MustParse("1.0.0"), EVMBytecode: []byte{0x01}}, isZkSyncVM: false, }, { desc: "valid zksyncvm opts", - opts: &evmops.ContractOpts{Version: semver.MustParse("1.0.0"), ZkSyncVMBytecode: []byte{0x05}}, + opts: &oputils.ContractOpts{Version: semver.MustParse("1.0.0"), ZkSyncVMBytecode: []byte{0x05}}, isZkSyncVM: true, }, { desc: "nil version", - opts: &evmops.ContractOpts{}, + opts: &oputils.ContractOpts{}, err: "version must be defined", }, { desc: "missing evm bytecode", - opts: &evmops.ContractOpts{Version: semver.MustParse("1.0.0")}, + opts: &oputils.ContractOpts{Version: semver.MustParse("1.0.0")}, isZkSyncVM: false, err: "evm bytecode must be defined", }, { desc: "missing zkSyncVM bytecode", - opts: &evmops.ContractOpts{Version: semver.MustParse("1.0.0")}, + opts: &oputils.ContractOpts{Version: semver.MustParse("1.0.0")}, isZkSyncVM: true, err: "zkSyncVM bytecode must be defined", }, @@ -166,27 +166,27 @@ func TestNewEVMDeployOperation_Errors(t *testing.T) { t.Run("nil metadata", func(t *testing.T) { t.Parallel() - op := evmops.NewEVMDeployOperation[any]("op-nil-meta", semver.MustParse("1.0.0"), "d", "T", nil, - &evmops.ContractOpts{Version: semver.MustParse("1.0.0"), EVMBytecode: []byte{0x01}}, noArgs) - _, err := operations.ExecuteOperation(bundle, op, chain, evmops.EVMDeployInput[any]{ChainSelector: sel}) + op := oputils.NewEVMDeployOperation[any]("op-nil-meta", semver.MustParse("1.0.0"), "d", "T", nil, + &oputils.ContractOpts{Version: semver.MustParse("1.0.0"), EVMBytecode: []byte{0x01}}, noArgs) + _, err := operations.ExecuteOperation(bundle, op, chain, oputils.EVMDeployInput[any]{ChainSelector: sel}) require.ErrorContains(t, err, "contract metadata must be provided") }) t.Run("no contract opts", func(t *testing.T) { t.Parallel() - op := evmops.NewEVMDeployOperation[any]("op-no-opts", semver.MustParse("1.0.0"), "d", + op := oputils.NewEVMDeployOperation[any]("op-no-opts", semver.MustParse("1.0.0"), "d", mcmscontracts.CallProxy, bindings.CallProxyMetaData, nil, noArgs) - _, err := operations.ExecuteOperation(bundle, op, chain, evmops.EVMDeployInput[any]{ChainSelector: sel}) + _, err := operations.ExecuteOperation(bundle, op, chain, oputils.EVMDeployInput[any]{ChainSelector: sel}) require.ErrorContains(t, err, "must define ContractOpts") }) t.Run("invalid contract opts", func(t *testing.T) { t.Parallel() - op := evmops.NewEVMDeployOperation[any]("op-bad-opts", semver.MustParse("1.0.0"), "d", + op := oputils.NewEVMDeployOperation[any]("op-bad-opts", semver.MustParse("1.0.0"), "d", mcmscontracts.CallProxy, bindings.CallProxyMetaData, nil, noArgs) - _, err := operations.ExecuteOperation(bundle, op, chain, evmops.EVMDeployInput[any]{ + _, err := operations.ExecuteOperation(bundle, op, chain, oputils.EVMDeployInput[any]{ ChainSelector: sel, - ContractOpts: &evmops.ContractOpts{}, + ContractOpts: &oputils.ContractOpts{}, }) require.ErrorContains(t, err, "version must be defined") }) @@ -194,12 +194,12 @@ func TestNewEVMDeployOperation_Errors(t *testing.T) { t.Run("deploy failure", func(t *testing.T) { t.Parallel() badArgs := func(any) []any { return []any{"not-an-address"} } - op := evmops.NewEVMDeployOperation[any]("op-deploy-fail", semver.MustParse("1.0.0"), "d", + op := oputils.NewEVMDeployOperation[any]("op-deploy-fail", semver.MustParse("1.0.0"), "d", mcmscontracts.CallProxy, bindings.CallProxyMetaData, - &evmops.ContractOpts{Version: semver.MustParse("1.0.0"), EVMBytecode: common.FromHex(bindings.CallProxyBin)}, + &oputils.ContractOpts{Version: semver.MustParse("1.0.0"), EVMBytecode: common.FromHex(bindings.CallProxyBin)}, badArgs) _, err := operations.ExecuteOperation(bundle, op, chain, - evmops.EVMDeployInput[any]{ChainSelector: sel}) + oputils.EVMDeployInput[any]{ChainSelector: sel}) require.Error(t, err) }) } @@ -213,10 +213,10 @@ func TestAddEVMCallSequenceToCSOutput_SequenceError(t *testing.T) { require.NoError(t, err) csOutput := cldf.ChangesetOutput{} - seqReport := operations.SequenceReport[string, map[uint64][]evmops.EVMCallOutput]{} + seqReport := operations.SequenceReport[string, map[uint64][]oputils.EVMCallOutput]{} seqErr := errors.New("sequence failed") - result, err := evmops.AddEVMCallSequenceToCSOutput( + result, err := oputils.AddEVMCallSequenceToCSOutput( *env, csOutput, seqReport, @@ -241,9 +241,9 @@ func TestAddEVMCallSequenceToCSOutput_NoMCMS(t *testing.T) { require.NoError(t, err) csOutput := cldf.ChangesetOutput{} - seqReport := operations.SequenceReport[string, map[uint64][]evmops.EVMCallOutput]{} + seqReport := operations.SequenceReport[string, map[uint64][]oputils.EVMCallOutput]{} - result, err := evmops.AddEVMCallSequenceToCSOutput( + result, err := oputils.AddEVMCallSequenceToCSOutput( *env, csOutput, seqReport, @@ -266,10 +266,10 @@ func TestAddEVMCallSequenceToCSOutput_AllConfirmed(t *testing.T) { require.NoError(t, err) csOutput := cldf.ChangesetOutput{} - seqReport := operations.SequenceReport[string, map[uint64][]evmops.EVMCallOutput]{} + seqReport := operations.SequenceReport[string, map[uint64][]oputils.EVMCallOutput]{} mcmsCfg := &cldfproposalutils.TimelockConfig{} - result, err := evmops.AddEVMCallSequenceToCSOutput( + result, err := oputils.AddEVMCallSequenceToCSOutput( *env, csOutput, seqReport, @@ -334,9 +334,9 @@ func TestAddEVMCallSequenceToCSOutput_ProposalCombination(t *testing.T) { MCMSTimelockProposals: []mcmslib.TimelockProposal{existingProposal1, existingProposal2}, } - seqReport := operations.SequenceReport[string, map[uint64][]evmops.EVMCallOutput]{ - Report: operations.Report[string, map[uint64][]evmops.EVMCallOutput]{ - Output: map[uint64][]evmops.EVMCallOutput{ + seqReport := operations.SequenceReport[string, map[uint64][]oputils.EVMCallOutput]{ + Report: operations.Report[string, map[uint64][]oputils.EVMCallOutput]{ + Output: map[uint64][]oputils.EVMCallOutput{ selector2: {{ To: common.HexToAddress("0x3333333333333333333333333333333333333333"), Data: []byte("new_call_data"), @@ -352,7 +352,7 @@ func TestAddEVMCallSequenceToCSOutput_ProposalCombination(t *testing.T) { MCMSAction: mcmstypes.TimelockActionSchedule, } - result, err := evmops.AddEVMCallSequenceToCSOutput( + result, err := oputils.AddEVMCallSequenceToCSOutput( rt.Environment(), csOutput, seqReport, diff --git a/mcms/evm/grant-role/operation.go b/mcms/evm/grant-role/operation.go index beb16f6..7728bdc 100644 --- a/mcms/evm/grant-role/operation.go +++ b/mcms/evm/grant-role/operation.go @@ -9,7 +9,7 @@ import ( mcmscontracts "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/contracts/mcms" "github.com/smartcontractkit/mcms/sdk/evm/bindings" - evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" + evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/oputils" ) // OpGrantRoleInput is the input to OpGrantRole. diff --git a/mcms/evm/grant-role/operation_test.go b/mcms/evm/grant-role/operation_test.go index d42e527..a311b6d 100644 --- a/mcms/evm/grant-role/operation_test.go +++ b/mcms/evm/grant-role/operation_test.go @@ -16,7 +16,7 @@ import ( mcmsevmsdk "github.com/smartcontractkit/mcms/sdk/evm" "github.com/smartcontractkit/cld-changesets/internal/mcmsrole" - evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/operations" + evmops "github.com/smartcontractkit/cld-changesets/legacy/mcms/oputils" timelockops "github.com/smartcontractkit/cld-changesets/mcms/evm/deploy/v1_0_0/operations/rbac_timelock" evmgrantrole "github.com/smartcontractkit/cld-changesets/mcms/evm/grant-role" )