Skip to content

Commit

Permalink
update v1.6.0 upgrade handler add zone by local denom
Browse files Browse the repository at this point in the history
  • Loading branch information
Duong Minh Ngoc committed Mar 5, 2024
1 parent 62f89c9 commit f723673
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/upgrades/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ func V010600UpgradeHandler(
appKeepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
appKeepers.InterchainstakingKeeper.IterateZones(ctx, func(index int64, zone *icstypes.Zone) (stop bool) {
appKeepers.InterchainstakingKeeper.SetLocalDenomZoneMapping(ctx, zone)
return false
})
migrations := map[string]string{
"quick1a7n7z45gs0dut2syvkszffgwmgps6scqen3e5l": "quick1h0sqndv2y4xty6uk0sv4vckgyc5aa7n5at7fll",
"quick1m0anwr4kcz0y9s65czusun2ahw35g3humv4j7f": "quick1n4g6037cjm0e0v2nvwj2ngau7pk758wtwk6lwq",
Expand Down
5 changes: 5 additions & 0 deletions app/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,4 +370,9 @@ func (s *AppTestSuite) TestV010600UpgradeHandler() {
s.Require().True(ok)
s.Require().Equal(int64(5000000000), vestMigratedB.OriginalVesting.AmountOf("uqck").Int64())
s.Require().Equal(float64(864000), vestMigratedB.VestingPeriods[0].Duration().Seconds())

zone, existed := app.InterchainstakingKeeper.GetLocalDenomZoneMapping(ctx, "uqatom")
s.Require().True(existed)
s.Require().Equal(zone.ChainId, "cosmoshub-4")
s.Require().Equal(zone.ConnectionId, "connection-77001")
}

0 comments on commit f723673

Please sign in to comment.