-
Notifications
You must be signed in to change notification settings - Fork 41
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 #283 from persistenceOne/release/v10.4.0
Release v10.4.0
- Loading branch information
Showing
6 changed files
with
171 additions
and
107 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package v10_4_0 | ||
|
||
import ( | ||
store "github.com/cosmos/cosmos-sdk/store/types" | ||
|
||
"github.com/persistenceOne/persistenceCore/v10/app/upgrades" | ||
) | ||
|
||
const ( | ||
// UpgradeName defines the on-chain upgrade name. | ||
UpgradeName = "v10.4.0" | ||
) | ||
|
||
var Upgrade = upgrades.Upgrade{ | ||
UpgradeName: UpgradeName, | ||
CreateUpgradeHandler: CreateUpgradeHandler, | ||
StoreUpgrades: store.StoreUpgrades{ | ||
Added: []string{}, | ||
}, | ||
} |
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,42 @@ | ||
package v10_4_0 | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" | ||
|
||
"github.com/persistenceOne/persistenceCore/v10/app/upgrades" | ||
) | ||
|
||
func CreateUpgradeHandler(args upgrades.UpgradeHandlerArgs) upgradetypes.UpgradeHandler { | ||
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { | ||
ctx.Logger().Info("running upgrade handler") | ||
|
||
for _, hc := range args.Keepers.LiquidStakeIBCKeeper.GetAllHostChains(ctx) { | ||
switch hc.ChainId { | ||
case "cosmoshub-4": | ||
upperLimit, _ := sdk.NewDecFromStr("1.01") | ||
lowerLimit, _ := sdk.NewDecFromStr("0.80") | ||
hc.Params.UpperCValueLimit = upperLimit | ||
hc.Params.LowerCValueLimit = lowerLimit | ||
args.Keepers.LiquidStakeIBCKeeper.SetHostChain(ctx, hc) | ||
|
||
case "osmosis-1": | ||
upperLimit, _ := sdk.NewDecFromStr("1.01") | ||
lowerLimit, _ := sdk.NewDecFromStr("0.97") | ||
hc.Params.UpperCValueLimit = upperLimit | ||
hc.Params.LowerCValueLimit = lowerLimit | ||
args.Keepers.LiquidStakeIBCKeeper.SetHostChain(ctx, hc) | ||
|
||
default: | ||
upperLimit, _ := sdk.NewDecFromStr("1.01") | ||
lowerLimit, _ := sdk.NewDecFromStr("0.80") | ||
hc.Params.UpperCValueLimit = upperLimit | ||
hc.Params.LowerCValueLimit = lowerLimit | ||
args.Keepers.LiquidStakeIBCKeeper.SetHostChain(ctx, hc) | ||
} | ||
} | ||
|
||
return args.ModuleManager.RunMigrations(ctx, args.Configurator, vm) | ||
} | ||
} |
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
Oops, something went wrong.