From 02d803e0f2a808bf8fe4c1cb0c907eafae78edc6 Mon Sep 17 00:00:00 2001 From: felipemadero Date: Fri, 18 Oct 2024 19:59:03 -0300 Subject: [PATCH] Continue on error remove validator (#2280) * contiunue if validator removal process already started * address PR comment --- pkg/validatormanager/removal.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/validatormanager/removal.go b/pkg/validatormanager/removal.go index 4713665fb..9cf8a610e 100644 --- a/pkg/validatormanager/removal.go +++ b/pkg/validatormanager/removal.go @@ -4,12 +4,14 @@ package validatormanager import ( _ "embed" + "errors" "math/big" "github.com/ava-labs/avalanche-cli/pkg/application" "github.com/ava-labs/avalanche-cli/pkg/contract" "github.com/ava-labs/avalanche-cli/pkg/evm" "github.com/ava-labs/avalanche-cli/pkg/models" + "github.com/ava-labs/avalanche-cli/pkg/ux" "github.com/ava-labs/avalanche-cli/sdk/interchain" "github.com/ava-labs/avalanchego/api/info" "github.com/ava-labs/avalanchego/ids" @@ -129,7 +131,10 @@ func InitValidatorRemoval( validationID, ) if err != nil { - return nil, ids.Empty, evm.TransactionError(tx, err, "failure initializing validator removal") + if !errors.Is(err, errInvalidValidatorStatus) { + return nil, ids.Empty, evm.TransactionError(tx, err, "failure initializing validator removal") + } + ux.Logger.PrintToUser("the validator removal process was already initialized. Proceesing to the next step") } aggregatorLogLevel, err := logging.ToLevel(aggregatorLogLevelStr)