Skip to content

Commit

Permalink
add default metadata during migration
Browse files Browse the repository at this point in the history
  • Loading branch information
mpoke committed Sep 9, 2024
1 parent 50bbbfe commit c53b2b0
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions x/ccv/provider/migrations/v8/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,20 @@ func MigrateLaunchedConsumerChains(ctx sdk.Context, store storetypes.KVStore, pk
// set ownership -- all existing chains are owned by gov
pk.SetConsumerOwnerAddress(ctx, consumerId, pk.GetAuthority())

// Note: ConsumerMetadata will be populated in the upgrade handler
// Note: InitializationParameters is not needed since the chain is already launched
// Note: ConsumerMetadata will be populated in the upgrade handler.
// Still, add some default values as every chain should have the metadata set.
if err := pk.SetConsumerMetadata(ctx, consumerId, providertypes.ConsumerMetadata{
Name: chainId,
Description: "TBA",
Metadata: "TBA",
}); err != nil {
return err
}
// Note: InitializationParameters are not needed since the chain is already launched.
// Just add the default values.
if err := pk.SetConsumerInitializationParameters(ctx, consumerId, providertypes.ConsumerInitializationParameters{}); err != nil {
return err
}

// migrate power shaping params
topNKey := providertypes.StringIdWithLenKey(LegacyTopNKeyPrefix, chainId)
Expand Down

0 comments on commit c53b2b0

Please sign in to comment.