diff --git a/deployment/common/changeset/test_helpers.go b/deployment/common/changeset/test_helpers.go index 5e3dc928849..f4602a14c93 100644 --- a/deployment/common/changeset/test_helpers.go +++ b/deployment/common/changeset/test_helpers.go @@ -97,24 +97,15 @@ func ApplyChangesets(t *testing.T, e deployment.Environment, timelockContractsPe for _, prop := range out.MCMSTimelockProposals { mcmProp := proposalutils.SignMCMSTimelockProposal(t, e, &prop) // return the error so devs can ensure expected reversions - err = proposalutils.ExecuteMCMSProposalV2(t, e, mcmProp) - if err != nil { - return deployment.Environment{}, err - } - err = proposalutils.ExecuteMCMSTimelockProposalV2(t, e, &prop) - if err != nil { - return deployment.Environment{}, err - } + proposalutils.ExecuteMCMSProposalV2(t, e, mcmProp) + proposalutils.ExecuteMCMSTimelockProposalV2(t, e, &prop) } } if out.MCMSProposals != nil { for _, prop := range out.MCMSProposals { p := proposalutils.SignMCMSProposal(t, e, &prop) // return the error so devs can ensure expected reversions - err = proposalutils.ExecuteMCMSProposalV2(t, e, p) - if err != nil { - return deployment.Environment{}, err - } + proposalutils.ExecuteMCMSProposalV2(t, e, p) } } currentEnv = deployment.Environment{ diff --git a/deployment/common/proposalutils/mcms_test_helpers.go b/deployment/common/proposalutils/mcms_test_helpers.go index c5a62193872..42028c3ea77 100644 --- a/deployment/common/proposalutils/mcms_test_helpers.go +++ b/deployment/common/proposalutils/mcms_test_helpers.go @@ -2,7 +2,6 @@ package proposalutils import ( "crypto/ecdsa" - "fmt" "math/big" "slices" "testing" @@ -184,7 +183,7 @@ func SignMCMSProposal(t *testing.T, env deployment.Environment, proposal *mcmsli } // ExecuteMCMSProposalV2 - Executes an MCMS proposal on a chain. For timelock proposal, use ExecuteMCMSTimelockProposalV2 instead. -func ExecuteMCMSProposalV2(t *testing.T, env deployment.Environment, proposal *mcmslib.Proposal) error { +func ExecuteMCMSProposalV2(t *testing.T, env deployment.Environment, proposal *mcmslib.Proposal) { t.Log("Executing proposal") encoders, err := proposal.GetEncoders() @@ -228,9 +227,7 @@ func ExecuteMCMSProposalV2(t *testing.T, env deployment.Environment, proposal *m for chainSelector := range executorsMap { t.Logf("[ExecuteMCMSProposalV2] Setting root on chain %d...", chainSelector) root, err := executable.SetRoot(env.GetContext(), chainSelector) - if err != nil { - return fmt.Errorf("[ExecuteMCMSProposalV2] SetRoot failed: %w", err) - } + require.NoError(t, err, "[ExecuteMCMSProposalV2] SetRoot failed") family, err := chainsel.GetSelectorFamily(uint64(chainSelector)) require.NoError(t, err) @@ -241,9 +238,7 @@ func ExecuteMCMSProposalV2(t *testing.T, env deployment.Environment, proposal *m evmTransaction := root.RawTransaction.(*gethtypes.Transaction) t.Logf("[ExecuteMCMSProposalV2] SetRoot EVM tx hash: %s", evmTransaction.Hash().String()) _, err = chain.Confirm(evmTransaction) - if err != nil { - return fmt.Errorf("[ExecuteMCMSProposalV2] Confirm failed: %w", err) - } + require.NoError(t, err, "[ExecuteMCMSProposalV2] Confirm failed") } } @@ -251,9 +246,7 @@ func ExecuteMCMSProposalV2(t *testing.T, env deployment.Environment, proposal *m for i, op := range proposal.Operations { t.Logf("[ExecuteMCMSProposalV2] Executing operation index=%d on chain %d...", i, uint64(op.ChainSelector)) result, err := executable.Execute(env.GetContext(), i) - if err != nil { - return fmt.Errorf("[ExecuteMCMSProposalV2] Execute failed: %w", err) - } + require.NoError(t, err, "[ExecuteMCMSProposalV2] Execute failed") family, err := chainsel.GetSelectorFamily(uint64(op.ChainSelector)) require.NoError(t, err) @@ -263,18 +256,14 @@ func ExecuteMCMSProposalV2(t *testing.T, env deployment.Environment, proposal *m evmTransaction := result.RawTransaction.(*gethtypes.Transaction) t.Logf("[ExecuteMCMSProposalV2] Operation %d EVM tx hash: %s", i, evmTransaction.Hash().String()) _, err = chain.Confirm(evmTransaction) - if err != nil { - return fmt.Errorf("[ExecuteMCMSProposalV2] Confirm failed: %w", err) - } + require.NoError(t, err, "[ExecuteMCMSProposalV2] Confirm failed") } } - - return nil } // ExecuteMCMSTimelockProposalV2 - Includes an option to set callProxy to execute the calls through a proxy. // If the callProxy is not set, the calls will be executed directly to the timelock. -func ExecuteMCMSTimelockProposalV2(t *testing.T, env deployment.Environment, timelockProposal *mcmslib.TimelockProposal, opts ...mcmslib.Option) error { +func ExecuteMCMSTimelockProposalV2(t *testing.T, env deployment.Environment, timelockProposal *mcmslib.TimelockProposal, opts ...mcmslib.Option) { t.Log("Executing timelock proposal") // build a "chainSelector => executor" map @@ -317,9 +306,7 @@ func ExecuteMCMSTimelockProposalV2(t *testing.T, env deployment.Environment, tim } tx, err = timelockExecutable.Execute(env.GetContext(), i, opOpts...) - if err != nil { - return fmt.Errorf("[ExecuteMCMSTimelockProposalV2] Execute failed: %w", err) - } + require.NoError(t, err) family, err := chainsel.GetSelectorFamily(uint64(op.ChainSelector)) require.NoError(t, err) @@ -329,13 +316,9 @@ func ExecuteMCMSTimelockProposalV2(t *testing.T, env deployment.Environment, tim chain := env.Chains[uint64(op.ChainSelector)] evmTransaction := tx.RawTransaction.(*gethtypes.Transaction) _, err = chain.Confirm(evmTransaction) - if err != nil { - return fmt.Errorf("[ExecuteMCMSTimelockProposalV2] Confirm failed: %w", err) - } + require.NoError(t, err) } } - - return nil } func SingleGroupTimelockConfig(t *testing.T) commontypes.MCMSWithTimelockConfig {