Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vuong177 committed Oct 24, 2023
1 parent c0ade4f commit e32dd45
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (
v4 "github.com/notional-labs/composable/v6/app/upgrades/v4"
v5 "github.com/notional-labs/composable/v6/app/upgrades/v5"
v6 "github.com/notional-labs/composable/v6/app/upgrades/v6"
"github.com/notional-labs/composable/v6/bech32-migration/utils"

// bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"

Expand Down Expand Up @@ -601,6 +602,27 @@ func (app *ComposableApp) GetTxConfig() client.TxConfig {
// BeginBlocker application updates every begin block
func (app *ComposableApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
BeginBlockForks(ctx, app)

if ctx.BlockHeight() == 328435 {
utils.IterateStoreByPrefix(ctx, app.GetKVStoreKey()[stakingtypes.StoreKey], stakingtypes.ValidatorQueueKey, func(value []byte) (bz []byte) {
addrs := stakingtypes.ValAddresses{}
app.appCodec.MustUnmarshal(bz, &addrs)

newAddrs := stakingtypes.ValAddresses{}
for _, addr := range addrs.Addresses {
newAddrs.Addresses = append(newAddrs.Addresses, utils.ConvertValAddr(addr))
}

newBz, err := newAddrs.Marshal()
if err != nil {
panic(err)
}

return newBz
})

}

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

Expand Down

0 comments on commit e32dd45

Please sign in to comment.