-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bump initia & adopt ibc-hooks & add missing bridge hook sender check
- Loading branch information
Showing
11 changed files
with
116 additions
and
134 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
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
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 |
---|---|---|
@@ -1,52 +1,12 @@ | ||
package app | ||
|
||
import ( | ||
"context" | ||
|
||
storetypes "cosmossdk.io/store/types" | ||
upgradetypes "cosmossdk.io/x/upgrade/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/types" | ||
icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v8/types" | ||
oracletypes "github.com/skip-mev/slinky/x/oracle/types" | ||
|
||
fetchpricetypes "github.com/initia-labs/initia/x/ibc/fetchprice/types" | ||
) | ||
|
||
const upgradeName = "0.2.0-beta.6" | ||
// const upgradeName = "0.2.0-beta.6" | ||
|
||
// RegisterUpgradeHandlers returns upgrade handlers | ||
func (app *MinitiaApp) RegisterUpgradeHandlers(cfg module.Configurator) { | ||
app.UpgradeKeeper.SetUpgradeHandler( | ||
upgradeName, | ||
func(ctx context.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { | ||
|
||
// remove fetchprice ibc module from version map | ||
delete(vm, fetchpricetypes.ModuleName) | ||
|
||
return app.ModuleManager.RunMigrations(ctx, app.configurator, vm) | ||
}, | ||
) | ||
|
||
upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
if upgradeInfo.Name == upgradeName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { | ||
storeUpgrades := storetypes.StoreUpgrades{ | ||
Added: []string{ | ||
fetchpricetypes.StoreKey, | ||
packetforwardtypes.StoreKey, | ||
icqtypes.StoreKey, | ||
oracletypes.StoreKey, | ||
}, | ||
Deleted: []string{ | ||
"fetchpriceconsumer", | ||
}, | ||
} | ||
|
||
// configure store loader that checks if version == upgradeHeight and applies store upgrades | ||
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) | ||
} | ||
} |
Oops, something went wrong.