File tree Expand file tree Collapse file tree 3 files changed +33
-7
lines changed
Expand file tree Collapse file tree 3 files changed +33
-7
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,15 @@ package v4
22
33import (
44 "context"
5+ "fmt"
56
67 upgradetypes "cosmossdk.io/x/upgrade/types"
78
89 "github.com/cosmos/cosmos-sdk/types/module"
10+ authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
11+ govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
12+ sdkgov "github.com/cosmos/cosmos-sdk/x/gov/types"
13+ sdkgovv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
914
1015 "github.com/atomone-hub/atomone/app/keepers"
1116)
@@ -23,8 +28,29 @@ func CreateUpgradeHandler(
2328 return vm , err
2429 }
2530
26- // TODO: add gov migrations.
31+ if err := initGovParams (ctx , keepers .GovKeeper ); err != nil {
32+ return vm , err
33+ }
2734
2835 return vm , nil
2936 }
3037}
38+
39+ // initGovParams initializes the missing gov modules added in AtomOne SDK v0.50.
40+ func initGovParams (ctx context.Context , govKeeper * govkeeper.Keeper ) error {
41+ params , err := govKeeper .Params .Get (ctx )
42+ if err != nil {
43+ return err
44+ }
45+
46+ defaultParams := sdkgovv1 .DefaultParams ()
47+ params .ProposalCancelRatio = defaultParams .ProposalCancelRatio
48+ params .ProposalCancelDest = authtypes .NewModuleAddress (sdkgov .ModuleName ).String ()
49+ params .MinDepositRatio = defaultParams .MinDepositRatio
50+
51+ if err := govKeeper .Params .Set (ctx , params ); err != nil {
52+ return fmt .Errorf ("failed to set gov params: %w" , err )
53+ }
54+
55+ return nil
56+ }
Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ go 1.24.5
44
55replace (
66 cosmossdk.io/x/feegrant => cosmossdk.io/x/feegrant v0.1.1
7- cosmossdk.io/x/upgrade => github.com/atomone-hub/cosmos-sdk/x/upgrade v0.1.5-atomone.1.0.20251209015833-fefb20ae5cb5
8- github.com/cosmos/cosmos-sdk => github.com/atomone-hub/cosmos-sdk v0.50.14-atomone.1.0.20251209015833-fefb20ae5cb5
7+ cosmossdk.io/x/upgrade => github.com/atomone-hub/cosmos-sdk/x/upgrade v0.1.5-atomone.1.0.20251209122831-78bba2652016
8+ github.com/cosmos/cosmos-sdk => github.com/atomone-hub/cosmos-sdk v0.50.14-atomone.1.0.20251209122831-78bba2652016
99 github.com/cosmos/ibc-go/v10 => github.com/cosmos/ibc-go/v10 v10.2.0
1010)
1111
Original file line number Diff line number Diff line change @@ -97,10 +97,10 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV
9797github.com/armon/go-metrics v0.4.1 /go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4 =
9898github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 /go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8 =
9999github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a /go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A =
100- github.com/atomone-hub/cosmos-sdk v0.50.14-atomone.1.0.20251209015833-fefb20ae5cb5 h1:jsRqkS0URJ+vXuwNCnzhFo3HkrBxD8Nf6R1faEdIROs =
101- github.com/atomone-hub/cosmos-sdk v0.50.14-atomone.1.0.20251209015833-fefb20ae5cb5 /go.mod h1:8v3OPuJUlCLNkm6VRWDsKlxIIMHpG80P+GASgCvW9XA =
102- github.com/atomone-hub/cosmos-sdk/x/upgrade v0.1.5-atomone.1.0.20251209015833-fefb20ae5cb5 h1:+c6yqhCtoE7VLOZIiUcpRVvIWl6viQZ6v6kEn7qEPdc =
103- github.com/atomone-hub/cosmos-sdk/x/upgrade v0.1.5-atomone.1.0.20251209015833-fefb20ae5cb5 /go.mod h1:9wFcVRdHssief/vHtEgaZT8ukTFzwd3+QDs6FnkLqbo =
100+ github.com/atomone-hub/cosmos-sdk v0.50.14-atomone.1.0.20251209122831-78bba2652016 h1:iLY7GyYSTTxdSqPmSZBxZFExLee5OY+x4xdHsI4CwG0 =
101+ github.com/atomone-hub/cosmos-sdk v0.50.14-atomone.1.0.20251209122831-78bba2652016 /go.mod h1:8v3OPuJUlCLNkm6VRWDsKlxIIMHpG80P+GASgCvW9XA =
102+ github.com/atomone-hub/cosmos-sdk/x/upgrade v0.1.5-atomone.1.0.20251209122831-78bba2652016 h1:gDwll365dXzUFbvAr+1tEFA7wfNz8v4JFwUNf8j/bgo =
103+ github.com/atomone-hub/cosmos-sdk/x/upgrade v0.1.5-atomone.1.0.20251209122831-78bba2652016 /go.mod h1:9wFcVRdHssief/vHtEgaZT8ukTFzwd3+QDs6FnkLqbo =
104104github.com/aws/aws-lambda-go v1.13.3 /go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU =
105105github.com/aws/aws-sdk-go v1.27.0 /go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo =
106106github.com/aws/aws-sdk-go-v2 v0.18.0 /go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g =
You can’t perform that action at this time.
0 commit comments