-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ibc-hooks middleware (#159)
- Loading branch information
Showing
8 changed files
with
105 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package v3_2 | ||
|
||
import ( | ||
"github.com/OmniFlix/omniflixhub/v3/app/upgrades" | ||
store "github.com/cosmos/cosmos-sdk/store/types" | ||
ibchookstypes "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7/types" | ||
) | ||
|
||
const UpgradeName = "v3.2-test" | ||
|
||
var Upgrade = upgrades.Upgrade{ | ||
UpgradeName: UpgradeName, | ||
CreateUpgradeHandler: CreateV3_2UpgradeHandler, | ||
StoreUpgrades: store.StoreUpgrades{ | ||
Added: []string{ibchookstypes.ModuleName}, | ||
}, | ||
} |
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,28 @@ | ||
package v3_2 | ||
|
||
import ( | ||
"github.com/OmniFlix/omniflixhub/v3/app/keepers" | ||
"github.com/OmniFlix/omniflixhub/v3/app/upgrades" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" | ||
) | ||
|
||
func CreateV3_2UpgradeHandler( | ||
mm *module.Manager, | ||
cfg module.Configurator, | ||
_ upgrades.BaseAppParamManager, | ||
keepers *keepers.AppKeepers, | ||
) upgradetypes.UpgradeHandler { | ||
return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { | ||
ctx.Logger().Info("running migrations ...") | ||
// Run migrations before applying any other state changes. | ||
// NOTE: DO NOT PUT ANY STATE CHANGES BEFORE RunMigrations(). | ||
versionMap, err := mm.RunMigrations(ctx, cfg, fromVM) | ||
if err != nil { | ||
return nil, err | ||
} | ||
ctx.Logger().Info("Upgrade complete") | ||
return versionMap, nil | ||
} | ||
} |
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