Skip to content

Commit

Permalink
fix: Add gov proposal migration in v0.3.1 upgrade handler (#478)
Browse files Browse the repository at this point in the history
(cherry picked from commit 2965d45)

# Conflicts:
#	app/upgrades.go
  • Loading branch information
rbajollari authored and mergify[bot] committed Jul 16, 2024
1 parent 2d3ebd7 commit 7580950
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
Expand Down Expand Up @@ -186,9 +187,24 @@ func (app *App) registerUpgrade0_3_1Rc2(_ upgradetypes.Plan) {

func (app *App) registerUpgrade0_3_1(_ upgradetypes.Plan) {
const planName = "v0.3.1"

app.UpgradeKeeper.SetUpgradeHandler(planName,
<<<<<<< HEAD

Check failure on line 192 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / test-app-non-determinism

syntax error: unexpected <<, expected expression

Check failure on line 192 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / test-unit-cover

syntax error: unexpected <<, expected expression

Check failure on line 192 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / test-unit-cover

syntax error: unexpected <<, expected expression

Check failure on line 192 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / lint

syntax error: unexpected <<, expected expression

Check failure on line 192 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / lint

expected operand, found '<<' (typecheck)

Check failure on line 192 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / Analyze

syntax error: unexpected <<, expected expression
func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {

Check failure on line 193 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / test-app-non-determinism

syntax error: unexpected { at end of statement

Check failure on line 193 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / test-unit-cover

syntax error: unexpected { at end of statement

Check failure on line 193 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / test-unit-cover

syntax error: unexpected { at end of statement

Check failure on line 193 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / lint

syntax error: unexpected { at end of statement

Check failure on line 193 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / Analyze

syntax error: unexpected { at end of statement
ctx.Logger().Info("Upgrade handler execution", "name", planName)
=======

Check failure on line 195 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / test-app-non-determinism

syntax error: unexpected ==, expected }

Check failure on line 195 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / test-unit-cover

syntax error: unexpected ==, expected }

Check failure on line 195 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / test-unit-cover

syntax error: unexpected ==, expected }

Check failure on line 195 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / lint

syntax error: unexpected ==, expected }

Check failure on line 195 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / Analyze

syntax error: unexpected ==, expected }
func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {

Check failure on line 196 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / test-app-non-determinism

method has multiple receivers

Check failure on line 196 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / test-app-non-determinism

syntax error: unexpected (, expected name

Check failure on line 196 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / test-unit-cover

method has multiple receivers

Check failure on line 196 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / test-unit-cover

syntax error: unexpected (, expected name

Check failure on line 196 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / lint

method has multiple receivers

Check failure on line 196 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / lint

syntax error: unexpected (, expected name

Check failure on line 196 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / Analyze

method has multiple receivers

Check failure on line 196 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / Analyze

syntax error: unexpected (, expected name
sdkCtx := sdk.UnwrapSDKContext(ctx)

// migrate old proposals
govMigrator := govkeeper.NewMigrator(&app.GovKeeper, app.GetSubspace(govtypes.ModuleName))
err := govMigrator.Migrate2to3(sdkCtx)
if err != nil {

Check failure on line 202 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / lint

missing ',' in argument list (typecheck)
panic("failed to migrate governance module")
}

sdkCtx.Logger().Info("Upgrade handler execution", "name", planName)
>>>>>>> 2965d45 (fix: Add gov proposal migration in v0.3.1 upgrade handler (#478))

Check failure on line 207 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / test-app-non-determinism

syntax error: unexpected >>, expected }

Check failure on line 207 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / test-app-non-determinism

invalid character U+0023 '#'

Check failure on line 207 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / test-unit-cover

syntax error: unexpected >>, expected }

Check failure on line 207 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / test-unit-cover

invalid character U+0023 '#'

Check failure on line 207 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / lint

syntax error: unexpected >>, expected }

Check failure on line 207 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / lint

invalid character U+0023 '#' (typecheck)

Check failure on line 207 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / Analyze

syntax error: unexpected >>, expected }

Check failure on line 207 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / Analyze

invalid character U+0023 '#'
return app.mm.RunMigrations(ctx, app.configurator, fromVM)
},
)
Expand Down

0 comments on commit 7580950

Please sign in to comment.