Skip to content

Commit

Permalink
Merge pull request #2928 from irisnet/fix/init-gov-params
Browse files Browse the repository at this point in the history
fix: init gov MinDepositRatio params
  • Loading branch information
mitch1024 authored Apr 26, 2024
2 parents 68c2f91 + 86a0e2a commit 3f51106
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* (IRISHub) [\#2918](https://github.com/irisnet/irishub/pull/2918) Adjusting the parameters of the ica module.
* (IRISHub) [\#2919](https://github.com/irisnet/irishub/pull/2919) Adjusting gov config.
* (IRISHub) [\#2924](https://github.com/irisnet/irishub/pull/2924) Update evm `AllowUnprotectedTxs` params.
* (IRISHub) [\#2928](https://github.com/irisnet/irishub/pull/2928) Initialize gov `MinDepositRatio` params.
* (IRISMod) [\#385](https://github.com/irisnet/irismod/pull/385) Bump cosmos-sdk to v0.47.9-ics-lsm.

## 2.1.0
Expand Down
3 changes: 3 additions & 0 deletions app/upgrades/v300/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@ var (
// BeaconContractAddress is the address of the beacon contract
BeaconContractAddress = ""

// MinDepositRatio is the minimum deposit ratio
MinDepositRatio = sdk.MustNewDecFromStr("0.01")

allowMessages = []string{"*"}
)
12 changes: 12 additions & 0 deletions app/upgrades/v300/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ func upgradeHandlerConstructor(
if err := mergeToken(ctx, box); err != nil {
return nil, err
}

if err := mergeGov(ctx, box); err != nil {
return nil, err
}
// initialize ICS27 module
initICAModule(ctx, m, fromVM)

Expand Down Expand Up @@ -84,3 +88,11 @@ func mergeToken(ctx sdk.Context, box upgrades.Toolbox) error {
params.Beacon = BeaconContractAddress
return box.TokenKeeper.SetParams(ctx, params)
}

func mergeGov(ctx sdk.Context, box upgrades.Toolbox) error {
ctx.Logger().Info("start to run gov module migrations...")

params := box.GovKeeper.GetParams(ctx)
params.MinDepositRatio = MinDepositRatio.String()
return box.GovKeeper.SetParams(ctx, params)
}

0 comments on commit 3f51106

Please sign in to comment.