Skip to content

Commit

Permalink
Make corrections for InitGenesis handling to work
Browse files Browse the repository at this point in the history
  • Loading branch information
ValarDragon committed Nov 21, 2021
1 parent b577030 commit 54badee
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

* Upgraded Osmosis to Cosmos-sdk 0.44.3
* Add [Authz module](https://github.com/cosmos/cosmos-sdk/tree/master/x/authz/spec)
* Store block height in epochs module for debugging
* Allow zero-weight pool-incentive distribution records
* Fix bug in incentives epoch distribution events, used to use raw address, now uses bech32 addr
Expand Down
18 changes: 14 additions & 4 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,21 @@ func NewOsmosisApp(
for moduleName := range app.mm.Modules {
fromVM[moduleName] = 1
}
// override versions for _new_ modules as to not skip InitGenesis
fromVM[authz.ModuleName] = 0
fromVM[txfees.ModuleName] = 0
// override versions for authz module as to not skip InitGenesis
// for txfees module, we will override txfees ourselves.
delete(fromVM, authz.ModuleName)

return app.mm.RunMigrations(ctx, app.configurator, fromVM)
newVM, err := app.mm.RunMigrations(ctx, app.configurator, fromVM)
if err != nil {
return nil, err
}

// Override txfees genesis here
txfees.InitGenesis(ctx, app.TxFeesKeeper, txfeestypes.GenesisState{
Basedenom: app.StakingKeeper.BondDenom(ctx),
Feetokens: []txfeestypes.FeeToken{},
})
return newVM, nil
})

upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk()
Expand Down

0 comments on commit 54badee

Please sign in to comment.