diff --git a/app/upgrades.go b/app/upgrades.go index 0415b5b..d2f40d6 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -7,18 +7,14 @@ import ( "github.com/liftedinit/manifest-ledger/app/upgrades" "github.com/liftedinit/manifest-ledger/app/upgrades/next" - "github.com/liftedinit/manifest-ledger/app/upgrades/noop" ) // Upgrades list of chain upgrades -var Upgrades = []upgrades.Upgrade{next.NewUpgrade()} +var Upgrades []upgrades.Upgrade // RegisterUpgradeHandlers registers the chain upgrade handlers func (app *ManifestApp) RegisterUpgradeHandlers() { - if len(Upgrades) == 0 { - // always have a unique upgrade registered for the current version to test in system tests - Upgrades = append(Upgrades, noop.NewUpgrade(app.Version())) - } + Upgrades = append(Upgrades, next.NewUpgrade(app.Version())) keepers := upgrades.AppKeepers{AccountKeeper: app.AccountKeeper, BankKeeper: app.BankKeeper} // register all upgrade handlers diff --git a/app/upgrades/next/upgrades.go b/app/upgrades/next/upgrades.go index 0b7f249..d8b4303 100644 --- a/app/upgrades/next/upgrades.go +++ b/app/upgrades/next/upgrades.go @@ -7,14 +7,13 @@ import ( upgradetypes "cosmossdk.io/x/upgrade/types" "github.com/cosmos/cosmos-sdk/types/module" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/liftedinit/manifest-ledger/app/upgrades" ) -func NewUpgrade() upgrades.Upgrade { +func NewUpgrade(name string) upgrades.Upgrade { return upgrades.Upgrade{ - UpgradeName: "umfx-denom-metadata", + UpgradeName: name, CreateUpgradeHandler: CreateUpgradeHandler, StoreUpgrades: storetypes.StoreUpgrades{ Added: []string{}, @@ -26,32 +25,9 @@ func NewUpgrade() upgrades.Upgrade { func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, - keepers *upgrades.AppKeepers, + _ *upgrades.AppKeepers, ) upgradetypes.UpgradeHandler { return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - metadata := banktypes.Metadata{ - Description: "The Manifest Network token", - DenomUnits: []*banktypes.DenomUnit{ - { - Denom: "umfx", - Exponent: 0, - Aliases: []string{}, - }, - { - Denom: "mfx", - Exponent: 6, - Aliases: []string{}, - }, - }, - Base: "umfx", - Display: "MFX", - Symbol: "MFX", - Name: "Manifest Network Token", - } - - // Set the new metadata in the bank keeper - keepers.BankKeeper.SetDenomMetaData(ctx, metadata) - return mm.RunMigrations(ctx, configurator, fromVM) } } diff --git a/app/upgrades/noop/upgrades.go b/app/upgrades/noop/upgrades.go deleted file mode 100644 index 385a1b8..0000000 --- a/app/upgrades/noop/upgrades.go +++ /dev/null @@ -1,34 +0,0 @@ -package noop - -import ( - "context" - - storetypes "cosmossdk.io/store/types" - upgradetypes "cosmossdk.io/x/upgrade/types" - - "github.com/cosmos/cosmos-sdk/types/module" - - "github.com/liftedinit/manifest-ledger/app/upgrades" -) - -// NewUpgrade constructor -func NewUpgrade(semver string) upgrades.Upgrade { - return upgrades.Upgrade{ - UpgradeName: semver, - CreateUpgradeHandler: CreateUpgradeHandler, - StoreUpgrades: storetypes.StoreUpgrades{ - Added: []string{}, - Deleted: []string{}, - }, - } -} - -func CreateUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, - _ *upgrades.AppKeepers, -) upgradetypes.UpgradeHandler { - return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - return mm.RunMigrations(ctx, configurator, fromVM) - } -} diff --git a/go.mod b/go.mod index 5b39326..8a6dedd 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( cosmossdk.io/depinject v1.0.0 cosmossdk.io/errors v1.0.1 cosmossdk.io/log v1.3.1 - cosmossdk.io/math v1.3.0 + cosmossdk.io/math v1.4.0 cosmossdk.io/store v1.1.0 cosmossdk.io/tools/confix v0.1.1 cosmossdk.io/x/circuit v0.1.1 diff --git a/go.sum b/go.sum index d965e0f..aa8ff4f 100644 --- a/go.sum +++ b/go.sum @@ -200,8 +200,8 @@ cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= -cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= -cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= +cosmossdk.io/math v1.4.0 h1:XbgExXFnXmF/CccPPEto40gOO7FpWu9yWNAZPN3nkNQ= +cosmossdk.io/math v1.4.0/go.mod h1:O5PkD4apz2jZs4zqFdTr16e1dcaQCc5z6lkEnrrppuk= cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= cosmossdk.io/tools/confix v0.1.1 h1:aexyRv9+y15veH3Qw16lxQwo+ki7r2I+g0yNTEFEQM8= diff --git a/interchaintest/go.mod b/interchaintest/go.mod index 95a5247..8c227b2 100644 --- a/interchaintest/go.mod +++ b/interchaintest/go.mod @@ -16,7 +16,7 @@ replace ( ) require ( - cosmossdk.io/math v1.3.0 + cosmossdk.io/math v1.4.0 cosmossdk.io/x/upgrade v0.1.2 github.com/cockroachdb/errors v1.11.3 github.com/cosmos/cosmos-sdk v0.50.8 diff --git a/interchaintest/go.sum b/interchaintest/go.sum index 1d3a680..f08793d 100644 --- a/interchaintest/go.sum +++ b/interchaintest/go.sum @@ -200,8 +200,8 @@ cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= -cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= -cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= +cosmossdk.io/math v1.4.0 h1:XbgExXFnXmF/CccPPEto40gOO7FpWu9yWNAZPN3nkNQ= +cosmossdk.io/math v1.4.0/go.mod h1:O5PkD4apz2jZs4zqFdTr16e1dcaQCc5z6lkEnrrppuk= cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ=