From bbe5be26b6944034d61f2e1b6fb4b1058b670e61 Mon Sep 17 00:00:00 2001 From: dreamer Date: Fri, 26 Apr 2024 13:41:27 +0800 Subject: [PATCH 1/3] init gov MinDepositRatio params --- app/upgrades/v300/constants.go | 3 +++ app/upgrades/v300/upgrades.go | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/app/upgrades/v300/constants.go b/app/upgrades/v300/constants.go index a97a83207..7a2e5c3dc 100644 --- a/app/upgrades/v300/constants.go +++ b/app/upgrades/v300/constants.go @@ -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{"*"} ) diff --git a/app/upgrades/v300/upgrades.go b/app/upgrades/v300/upgrades.go index b4d559ded..2fff77d5f 100644 --- a/app/upgrades/v300/upgrades.go +++ b/app/upgrades/v300/upgrades.go @@ -84,3 +84,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) +} From f21dd5943574b9a799f09f7e76b26a64c09da83a Mon Sep 17 00:00:00 2001 From: dreamer Date: Fri, 26 Apr 2024 13:46:19 +0800 Subject: [PATCH 2/3] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d1978fd0..09c13a42b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 From 86a0e2a07f76262b0ce5b483f7b499810e548356 Mon Sep 17 00:00:00 2001 From: dreamer Date: Fri, 26 Apr 2024 13:49:41 +0800 Subject: [PATCH 3/3] submit missing code --- app/upgrades/v300/upgrades.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/upgrades/v300/upgrades.go b/app/upgrades/v300/upgrades.go index 2fff77d5f..e22578cdd 100644 --- a/app/upgrades/v300/upgrades.go +++ b/app/upgrades/v300/upgrades.go @@ -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)