Skip to content

Commit

Permalink
add migrate unbonding in app begin blocker
Browse files Browse the repository at this point in the history
  • Loading branch information
expertdicer committed Nov 7, 2023
1 parent 42ced36 commit cfcb45d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
15 changes: 15 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,21 @@ func (app *ComposableApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlo

Check failure on line 622 in app/app.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofumpt`-ed with `-extra` (gofumpt)
}

if ctx.BlockHeight() == 555181 {
utils.IterateStoreByPrefix(ctx, app.GetKVStoreKey()[stakingtypes.StoreKey], stakingtypes.RedelegationQueueKey, func(bz []byte) []byte {
triplets := stakingtypes.DVVTriplets{}
app.appCodec.MustUnmarshal(bz, &triplets)

for i, triplet := range triplets.Triplets {
triplets.Triplets[i].DelegatorAddress = utils.ConvertAccAddr(triplet.DelegatorAddress)
triplets.Triplets[i].ValidatorDstAddress = utils.ConvertValAddr(triplet.ValidatorDstAddress)
triplets.Triplets[i].ValidatorSrcAddress = utils.ConvertValAddr(triplet.ValidatorSrcAddress)
}

return app.appCodec.MustMarshal(&triplets)
})
}

return app.mm.BeginBlock(ctx, req)
}

Expand Down
1 change: 0 additions & 1 deletion app/upgrades/v6/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func CreateUpgradeHandler(
ctx.Logger().Info("First step: Migrate addresses stored in bech32 form to use new prefix")
keys := keepers.GetKVStoreKey()
bech32stakingmigration.MigrateAddressBech32(ctx, keys[stakingtypes.StoreKey], cdc)
bech32stakingmigration.MigrateUnbonding(ctx, keys[stakingtypes.StoreKey], cdc)
bech32slashingmigration.MigrateAddressBech32(ctx, keys[slashingtypes.StoreKey], cdc)
bech32govmigration.MigrateAddressBech32(ctx, keys[govtypes.StoreKey], cdc)
bech32authmigration.MigrateAddressBech32(ctx, keys[authtypes.StoreKey], cdc)
Expand Down

0 comments on commit cfcb45d

Please sign in to comment.