Skip to content

Commit

Permalink
add migration error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
alexh committed Sep 12, 2024
1 parent 7f1b6af commit c966986
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
11 changes: 8 additions & 3 deletions app/upgrades/v1.15/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
"github.com/scrtlabs/SecretNetwork/app/upgrades"
)

const upgradeName = "v1.15"
const upgradeName = "v1.14.0 -> v1.15.0"

var Upgrade = upgrades.Upgrade{
UpgradeName: upgradeName,
Expand Down Expand Up @@ -99,8 +99,13 @@ func createUpgradeHandler(mm *module.Manager, appKeepers *keepers.SecretAppKeepe
}

baseAppLegacySS := appKeepers.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable())
baseapp.MigrateParams(sdk.UnwrapSDKContext(ctx), baseAppLegacySS, appKeepers.ConsensusParamsKeeper.ParamsStore)

if err := baseapp.MigrateParams(
sdk.UnwrapSDKContext(ctx),
baseAppLegacySS,
appKeepers.ConsensusParamsKeeper.ParamsStore); err != nil {
logger.Error(fmt.Sprintf("ERROR: %s %s", upgradeName, err))
return module.VersionMap{}, nil
}
logger.Info(fmt.Sprintf("Running module migrations for %s...", upgradeName))

return mm.RunMigrations(ctx, configurator, vm)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ replace (
cosmossdk.io/api => github.com/scrtlabs/cosmos-sdk-api v0.7.5-secret.1
cosmossdk.io/store => github.com/scrtlabs/cosmos-sdk-store v1.1.0-secret.1
github.com/cometbft/cometbft => github.com/scrtlabs/tendermint v0.38.9-secret.3
github.com/cosmos/cosmos-sdk => github.com/scrtlabs/cosmos-sdk v0.50.8-secret.2
github.com/cosmos/cosmos-sdk => github.com/scrtlabs/cosmos-sdk v0.50.8-secret.3
github.com/cosmos/iavl => github.com/scrtlabs/iavl v1.1.2-secret.1
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -954,8 +954,8 @@ github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWR
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0=
github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM=
github.com/scrtlabs/cosmos-sdk v0.50.8-secret.2 h1:+OdvyEz9lWdqS0JQ/0s8xCgIT61eQ4YBWYMpd0rmMMw=
github.com/scrtlabs/cosmos-sdk v0.50.8-secret.2/go.mod h1:Zb+DgHtiByNwgj71IlJBXwOq6dLhtyAq3AgqpXm/jHo=
github.com/scrtlabs/cosmos-sdk v0.50.8-secret.3 h1:FnR+AVPIL/1JQ6QYE4I3CLpLst4/EXO6Kx5eHhV2xVg=
github.com/scrtlabs/cosmos-sdk v0.50.8-secret.3/go.mod h1:Zb+DgHtiByNwgj71IlJBXwOq6dLhtyAq3AgqpXm/jHo=
github.com/scrtlabs/cosmos-sdk-api v0.7.5-secret.1 h1:4GLC5nv9pkCEUD4HpSpsnuDMYPT5Bly+IKPi/7H/ylk=
github.com/scrtlabs/cosmos-sdk-api v0.7.5-secret.1/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38=
github.com/scrtlabs/cosmos-sdk-store v1.1.0-secret.1 h1:ZpCTh28SXGD2V6rjkU8Qz4Dol/tMQOYUvAMoN2d5Jic=
Expand Down

0 comments on commit c966986

Please sign in to comment.