-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
64 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package v069dev | ||
|
||
import ( | ||
store "cosmossdk.io/store/types" | ||
"github.com/Nolus-Protocol/nolus-core/app/upgrades" | ||
) | ||
|
||
const ( | ||
// UpgradeName defines the on-chain upgrades name. | ||
UpgradeName = "v0.6.9-dev" | ||
) | ||
|
||
var Upgrade = upgrades.Upgrade{ | ||
UpgradeName: UpgradeName, | ||
CreateUpgradeHandler: CreateUpgradeHandler, | ||
StoreUpgrades: store.StoreUpgrades{ | ||
Added: []string{}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package v069dev | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/Nolus-Protocol/nolus-core/app/keepers" | ||
"github.com/Nolus-Protocol/nolus-core/x/tax/typesv2" | ||
|
||
upgradetypes "cosmossdk.io/x/upgrade/types" | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
) | ||
|
||
func CreateUpgradeHandler( | ||
mm *module.Manager, | ||
configurator module.Configurator, | ||
keepers *keepers.AppKeepers, | ||
codec codec.Codec, | ||
) upgradetypes.UpgradeHandler { | ||
return func(c context.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { | ||
ctx := sdk.UnwrapSDKContext(c) | ||
|
||
ctx.Logger().Info("[dev]Deleting proposal 281...") | ||
keepers.GovKeeper.DeleteProposal(ctx, 281) | ||
Check failure on line 26 in app/upgrades/v069-dev/upgrades.go GitHub Actions / Lint Go files
|
||
ctx.Logger().Info("[dev]Deleting proposal 282...") | ||
keepers.GovKeeper.DeleteProposal(ctx, 282) | ||
Check failure on line 28 in app/upgrades/v069-dev/upgrades.go GitHub Actions / Lint Go files
|
||
ctx.Logger().Info("[dev]Deleting proposal 283...") | ||
keepers.GovKeeper.DeleteProposal(ctx, 283) | ||
Check failure on line 30 in app/upgrades/v069-dev/upgrades.go GitHub Actions / Lint Go files
|
||
|
||
keepers.TaxKeeper.SetParams(ctx, typesv2.DefaultParams()) | ||
Check failure on line 32 in app/upgrades/v069-dev/upgrades.go GitHub Actions / Lint Go files
|
||
|
||
ctx.Logger().Info("Starting module migrations...") | ||
vm, err := mm.RunMigrations(ctx, configurator, vm) //nolint:contextcheck | ||
if err != nil { | ||
return vm, err | ||
} | ||
|
||
ctx.Logger().Info(fmt.Sprintf("Migration {%s} applied", UpgradeName)) | ||
return vm, nil | ||
} | ||
} |