Skip to content

Commit d94c10a

Browse files
authored
added v4patch2 upgrade handler (#1057)
1 parent bf019b8 commit d94c10a

File tree

12 files changed

+53
-156
lines changed

12 files changed

+53
-156
lines changed

app/app.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ import (
129129
appupgrade "github.com/CoreumFoundation/coreum/v4/app/upgrade"
130130
appupgradev4 "github.com/CoreumFoundation/coreum/v4/app/upgrade/v4"
131131
appupgradev4patch1 "github.com/CoreumFoundation/coreum/v4/app/upgrade/v4patch1"
132+
appupgradev4patch2 "github.com/CoreumFoundation/coreum/v4/app/upgrade/v4patch2"
132133
"github.com/CoreumFoundation/coreum/v4/docs"
133134
"github.com/CoreumFoundation/coreum/v4/pkg/config"
134135
"github.com/CoreumFoundation/coreum/v4/pkg/config/constant"
@@ -1122,6 +1123,7 @@ func New(
11221123
appupgradev4.New(appupgradev4.Name, app.ModuleManager, app.configurator, app.ConsensusParamsKeeper),
11231124
appupgradev4.New(appupgradev4.NameAlias, app.ModuleManager, app.configurator, app.ConsensusParamsKeeper),
11241125
appupgradev4patch1.New(appupgradev4patch1.Name, app.ModuleManager, app.configurator),
1126+
appupgradev4patch2.New(appupgradev4patch2.Name, app.ModuleManager, app.configurator),
11251127
}
11261128

11271129
upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk()

app/upgrade/v4patch2/upgrade.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package v4patch2
2+
3+
import (
4+
store "github.com/cosmos/cosmos-sdk/store/types"
5+
sdk "github.com/cosmos/cosmos-sdk/types"
6+
"github.com/cosmos/cosmos-sdk/types/module"
7+
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
8+
9+
"github.com/CoreumFoundation/coreum/v4/app/upgrade"
10+
)
11+
12+
// Name defines the upgrade name.
13+
const (
14+
Name = "v4patch2"
15+
)
16+
17+
// New makes an upgrade handler for v4patch1 upgrade.
18+
func New(name string, mm *module.Manager, configurator module.Configurator,
19+
) upgrade.Upgrade {
20+
return upgrade.Upgrade{
21+
Name: name,
22+
StoreUpgrades: store.StoreUpgrades{
23+
Added: []string{},
24+
},
25+
Upgrade: func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
26+
return mm.RunMigrations(ctx, configurator, vm)
27+
},
28+
}
29+
}

build/coreum/images.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ func ensureReleasedBinaries(ctx context.Context, deps types.DepsFunc) error {
8181
for _, binaryTool := range []tools.Name{
8282
tools.CoredV303,
8383
tools.CoredV401,
84+
tools.CoredV410,
8485
} {
8586
if err := tools.Ensure(ctx, binaryTool, tools.TargetPlatformLinuxLocalArchInDocker); err != nil {
8687
return err

build/coreum/tests.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func RunIntegrationTestsUpgrade(runUnsafe bool) types.CommandFunc {
7575

7676
znetConfig := defaultZNetConfig()
7777
znetConfig.Profiles = []string{apps.Profile3Cored, apps.ProfileIBC}
78-
znetConfig.CoredVersion = "v3.0.3"
78+
znetConfig.CoredVersion = "v4.1.0"
7979

8080
return runIntegrationTests(ctx, deps, runUnsafe, znetConfig, TestUpgrade, TestIBC, TestModules)
8181
}

build/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ replace (
3535
require (
3636
github.com/CoreumFoundation/coreum-tools v0.4.1-0.20240321120602-0a9c50facc68
3737
github.com/CoreumFoundation/coreum/v4 v4.0.0-20240213123712-d7d6a45ddb8f
38-
github.com/CoreumFoundation/crust v0.0.0-20241211095902-3aee46b7c4d6
38+
github.com/CoreumFoundation/crust v0.0.0-20241225103102-0cb70152a971
3939
github.com/iancoleman/strcase v0.3.0
4040
github.com/pkg/errors v0.9.1
4141
github.com/samber/lo v1.39.0

build/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,8 +629,8 @@ github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRr
629629
github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4=
630630
github.com/CoreumFoundation/coreum-tools v0.4.1-0.20240321120602-0a9c50facc68 h1:Tb9avuSQW3smVGrUnDh/Y+ML4eK802UsvJNZHsBgOGg=
631631
github.com/CoreumFoundation/coreum-tools v0.4.1-0.20240321120602-0a9c50facc68/go.mod h1:VD93vCHkxYaT/RhOesXTFgd/GQDW54tr0BqGi5JU1c0=
632-
github.com/CoreumFoundation/crust v0.0.0-20241211095902-3aee46b7c4d6 h1:cDeGm1Iwenf8fbKQNui26L8tAZKUuYZ7F2PpwjTA2F0=
633-
github.com/CoreumFoundation/crust v0.0.0-20241211095902-3aee46b7c4d6/go.mod h1:+tc+D5f9K7oNNtv8UazzNy8LheAhBG7UDc25JwY803Y=
632+
github.com/CoreumFoundation/crust v0.0.0-20241225103102-0cb70152a971 h1:+MG9e9HUNcCltJweulb/wvlFmnPrFBR1ZNQeSfWD8Xo=
633+
github.com/CoreumFoundation/crust v0.0.0-20241225103102-0cb70152a971/go.mod h1:+tc+D5f9K7oNNtv8UazzNy8LheAhBG7UDc25JwY803Y=
634634
github.com/CosmWasm/wasmd v0.46.0 h1:78kmiobbVE8JWBcM+ssxiFV2cS+4l9lmZQqPAQ0mA04=
635635
github.com/CosmWasm/wasmd v0.46.0/go.mod h1:BZFz+CFGdLNGomshb3IeccFyD4R+XbnS/mXpytOUyTA=
636636
github.com/CosmWasm/wasmvm v1.5.4 h1:Opqy65ubJ8bMsT08dn85VjRdsLJVPIAgIXif92qOMGc=

go.work.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,8 @@ github.com/CloudyKit/jet/v6 v6.2.0 h1:EpcZ6SR9n28BUGtNJSvlBqf90IpjeFr36Tizxhn/oM
317317
github.com/CloudyKit/jet/v6 v6.2.0/go.mod h1:d3ypHeIRNo2+XyqnGA8s+aphtcVpjP5hPwP/Lzo7Ro4=
318318
github.com/CoreumFoundation/crust v0.0.0-20240531092943-bab690541bbd h1:4nns+B+HSRdWLHSn8KHv1q4Y4/eNMvp8lyg4uA0/2Xg=
319319
github.com/CoreumFoundation/crust v0.0.0-20240531092943-bab690541bbd/go.mod h1:+tc+D5f9K7oNNtv8UazzNy8LheAhBG7UDc25JwY803Y=
320+
github.com/CoreumFoundation/crust v0.0.0-20241211095902-3aee46b7c4d6 h1:cDeGm1Iwenf8fbKQNui26L8tAZKUuYZ7F2PpwjTA2F0=
321+
github.com/CoreumFoundation/crust v0.0.0-20241211095902-3aee46b7c4d6/go.mod h1:+tc+D5f9K7oNNtv8UazzNy8LheAhBG7UDc25JwY803Y=
320322
github.com/CosmWasm/wasmd v0.40.0-rc.1/go.mod h1:uacdue6EGn9JA1TqBNHB3iCe4PCIChuFT23AzIl2VME=
321323
github.com/CosmWasm/wasmvm v1.2.3/go.mod h1:vW/E3h8j9xBQs9bCoijDuawKo9kCtxOaS8N8J7KFtkc=
322324
github.com/CosmWasm/wasmvm v1.5.0/go.mod h1:fXB+m2gyh4v9839zlIXdMZGeLAxqUdYdFQqYsTha2hc=

integration-tests/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ require (
2828
github.com/CoreumFoundation/coreum-tools v0.4.1-0.20230627094203-821c6a4eebab
2929
github.com/CoreumFoundation/coreum/v4 v4.0.0-00010101000000-000000000000
3030
github.com/CosmWasm/wasmd v0.46.0
31-
github.com/cometbft/cometbft v0.37.5
3231
github.com/cosmos/cosmos-sdk v0.47.15
3332
github.com/cosmos/gogoproto v1.7.0
3433
github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3
@@ -78,6 +77,7 @@ require (
7877
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
7978
github.com/cockroachdb/redact v1.1.5 // indirect
8079
github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect
80+
github.com/cometbft/cometbft v0.37.5 // indirect
8181
github.com/cometbft/cometbft-db v0.8.0 // indirect
8282
github.com/confio/ics23/go v0.9.0 // indirect
8383
github.com/consensys/bavard v0.1.13 // indirect

integration-tests/upgrade/wasmd_upgrade_test.go renamed to integration-tests/upgrade/cosmos_upgrade_test.go

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,22 @@ import (
1212
integrationtests "github.com/CoreumFoundation/coreum/v4/integration-tests"
1313
)
1414

15-
type wasmdUpgradeTest struct {
15+
type cosmosUpgradeTest struct {
1616
}
1717

18-
func (wut *wasmdUpgradeTest) Before(t *testing.T) {
18+
func (cut *cosmosUpgradeTest) Before(t *testing.T) {
1919
assertDependencyVersion(
2020
t,
21-
"github.com/CosmWasm/wasmd",
22-
"v0.45.",
23-
)
24-
assertDependencyVersion(
25-
t,
26-
"github.com/CosmWasm/wasmvm",
27-
"v1.5.2",
21+
"github.com/cosmos/cosmos-sdk",
22+
"v0.47.12",
2823
)
2924
}
3025

31-
func (wut *wasmdUpgradeTest) After(t *testing.T) {
32-
assertDependencyVersion(
33-
t,
34-
"github.com/CosmWasm/wasmd",
35-
"v0.46.0",
36-
)
26+
func (cut *cosmosUpgradeTest) After(t *testing.T) {
3727
assertDependencyVersion(
3828
t,
39-
"github.com/CosmWasm/wasmvm",
40-
"v1.5.4",
29+
"github.com/cosmos/cosmos-sdk",
30+
"v0.47.15",
4131
)
4232
}
4333

integration-tests/upgrade/ft_admin_field_test.go

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)