-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from b-harvest/onboarding-middleware
feat: Onboarding IBC middleware
- Loading branch information
Showing
106 changed files
with
17,756 additions
and
118 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package v7 | ||
|
||
const ( | ||
//UpgradeName is the name of the upgrade to be associated with the chain upgrade | ||
UpgradeName = "v7.0.0" | ||
) |
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,40 @@ | ||
package v7 | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" | ||
|
||
coinswapkeeper "github.com/Canto-Network/Canto/v6/x/coinswap/keeper" | ||
coinswaptypes "github.com/Canto-Network/Canto/v6/x/coinswap/types" | ||
onboardingkeeper "github.com/Canto-Network/Canto/v6/x/onboarding/keeper" | ||
onboardingtypes "github.com/Canto-Network/Canto/v6/x/onboarding/types" | ||
) | ||
|
||
// CreateUpgradeHandler creates an SDK upgrade handler for v7 | ||
func CreateUpgradeHandler( | ||
mm *module.Manager, | ||
configurator module.Configurator, | ||
onboardingKeeper onboardingkeeper.Keeper, | ||
coinswapKeeper coinswapkeeper.Keeper, | ||
) upgradetypes.UpgradeHandler { | ||
return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { | ||
logger := ctx.Logger().With("upgrading to v7.0.0", UpgradeName) | ||
|
||
newVM, err := mm.RunMigrations(ctx, configurator, vm) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
onboardingParams := onboardingtypes.DefaultParams() | ||
onboardingKeeper.SetParams(ctx, onboardingParams) | ||
|
||
coinswapParams := coinswaptypes.DefaultParams() | ||
coinswapKeeper.SetParams(ctx, coinswapParams) | ||
coinswapKeeper.SetStandardDenom(ctx, "acanto") | ||
|
||
// Leave modules are as-is to avoid running InitGenesis. | ||
logger.Debug("running module migrations ...") | ||
return newVM, nil | ||
} | ||
} |
Oops, something went wrong.