From 66a5e5ade8d672d86ef7eac58c58d0c009b6bf7e Mon Sep 17 00:00:00 2001 From: Philip Offtermatt Date: Fri, 19 Jul 2024 09:48:48 +0200 Subject: [PATCH] Add migration to initialize inactive vals --- x/ccv/provider/migrations/vX/migrations.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/x/ccv/provider/migrations/vX/migrations.go b/x/ccv/provider/migrations/vX/migrations.go index 9040c82ee2..b2b89f0fad 100644 --- a/x/ccv/provider/migrations/vX/migrations.go +++ b/x/ccv/provider/migrations/vX/migrations.go @@ -14,3 +14,11 @@ func InitializeMaxValidatorsForExistingConsumers(ctx sdk.Context, providerKeeper providerKeeper.SetValidatorSetCap(ctx, chainID, uint32(maxVals)) } } + +// InitializeAllowInactiveVals initializes the allow inactive validators parameter to be false +// for all existing consumer chains. +func InitializeAllowInactiveVals(ctx sdk.Context, providerKeeper providerkeeper.Keeper) { + for _, chainID := range providerKeeper.GetAllRegisteredConsumerChainIDs(ctx) { + providerKeeper.SetAllowInactiveValidators(ctx, chainID, false) + } +}