Skip to content

Commit

Permalink
Add migration to initialize inactive vals
Browse files Browse the repository at this point in the history
  • Loading branch information
p-offtermatt committed Jul 19, 2024
1 parent a71d46f commit 66a5e5a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions x/ccv/provider/migrations/vX/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit 66a5e5a

Please sign in to comment.