Skip to content

Commit b022954

Browse files
authored
Merge pull request #770 from neutron-org/feat/v5.0.2-upgrade
v5.0.2 upgrade handler
2 parents 54a5cce + cca46e0 commit b022954

File tree

12 files changed

+398
-87
lines changed

12 files changed

+398
-87
lines changed

app/app.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"path/filepath"
1111
"time"
1212

13+
v502 "github.com/neutron-org/neutron/v5/app/upgrades/v5.0.2"
1314
dynamicfeestypes "github.com/neutron-org/neutron/v5/x/dynamicfees/types"
1415

1516
"github.com/skip-mev/feemarket/x/feemarket"
@@ -228,6 +229,7 @@ const (
228229
var (
229230
Upgrades = []upgrades.Upgrade{
230231
v500.Upgrade,
232+
v502.Upgrade,
231233
}
232234

233235
// DefaultNodeHome default home directories for the application daemon

app/upgrades/v5.0.2/constants.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package v502
2+
3+
import (
4+
storetypes "cosmossdk.io/store/types"
5+
6+
"github.com/neutron-org/neutron/v5/app/upgrades"
7+
)
8+
9+
const (
10+
// UpgradeName defines the on-chain upgrade name.
11+
UpgradeName = "v5.0.2"
12+
)
13+
14+
var Upgrade = upgrades.Upgrade{
15+
UpgradeName: UpgradeName,
16+
CreateUpgradeHandler: CreateUpgradeHandler,
17+
StoreUpgrades: storetypes.StoreUpgrades{},
18+
}

app/upgrades/v5.0.2/upgrades.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package v502
2+
3+
import (
4+
"context"
5+
"fmt"
6+
7+
upgradetypes "cosmossdk.io/x/upgrade/types"
8+
"github.com/cosmos/cosmos-sdk/codec"
9+
sdk "github.com/cosmos/cosmos-sdk/types"
10+
"github.com/cosmos/cosmos-sdk/types/module"
11+
12+
"github.com/neutron-org/neutron/v5/app/upgrades"
13+
)
14+
15+
func CreateUpgradeHandler(
16+
mm *module.Manager,
17+
configurator module.Configurator,
18+
_ *upgrades.UpgradeKeepers,
19+
_ upgrades.StoreKeys,
20+
_ codec.Codec,
21+
) upgradetypes.UpgradeHandler {
22+
return func(c context.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
23+
ctx := sdk.UnwrapSDKContext(c)
24+
25+
ctx.Logger().Info("Starting module migrations...")
26+
27+
vm, err := mm.RunMigrations(ctx, configurator, vm)
28+
if err != nil {
29+
return vm, err
30+
}
31+
32+
ctx.Logger().Info(fmt.Sprintf("Migration {%s} applied", UpgradeName))
33+
return vm, nil
34+
}
35+
}

app/upgrades/v5.0.2/upgrades_test.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package v502_test
2+
3+
import (
4+
"testing"
5+
6+
upgradetypes "cosmossdk.io/x/upgrade/types"
7+
"github.com/stretchr/testify/require"
8+
"github.com/stretchr/testify/suite"
9+
10+
v502 "github.com/neutron-org/neutron/v5/app/upgrades/v5.0.2"
11+
"github.com/neutron-org/neutron/v5/testutil"
12+
)
13+
14+
type UpgradeTestSuite struct {
15+
testutil.IBCConnectionTestSuite
16+
}
17+
18+
func TestKeeperTestSuite(t *testing.T) {
19+
suite.Run(t, new(UpgradeTestSuite))
20+
}
21+
22+
func (suite *UpgradeTestSuite) SetupTest() {
23+
suite.IBCConnectionTestSuite.SetupTest()
24+
}
25+
26+
func (suite *UpgradeTestSuite) TestOracleUpgrade() {
27+
app := suite.GetNeutronZoneApp(suite.ChainA)
28+
ctx := suite.ChainA.GetContext().WithChainID("neutron-1")
29+
t := suite.T()
30+
31+
upgrade := upgradetypes.Plan{
32+
Name: v502.UpgradeName,
33+
Info: "some text here",
34+
Height: 100,
35+
}
36+
require.NoError(t, app.UpgradeKeeper.ApplyUpgrade(ctx, upgrade))
37+
}

go.mod

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
11
module github.com/neutron-org/neutron/v5
22

3-
go 1.22.6
3+
go 1.22.7
4+
5+
toolchain go1.22.9
46

57
require (
68
cosmossdk.io/client/v2 v2.0.0-beta.4
79
cosmossdk.io/core v0.11.1
810
cosmossdk.io/errors v1.0.1
911
cosmossdk.io/log v1.4.1
1012
cosmossdk.io/math v1.4.0
11-
cosmossdk.io/store v1.1.0
13+
cosmossdk.io/store v1.1.1
1214
cosmossdk.io/x/evidence v0.1.1
1315
cosmossdk.io/x/feegrant v0.1.1
1416
cosmossdk.io/x/tx v0.13.5
1517
cosmossdk.io/x/upgrade v0.1.4
1618
github.com/CosmWasm/wasmd v0.53.0
1719
github.com/CosmWasm/wasmvm/v2 v2.1.3
18-
github.com/cometbft/cometbft v0.38.11
20+
github.com/cometbft/cometbft v0.38.15
1921
github.com/cosmos/admin-module/v2 v2.0.0-20240430142959-8b3328d1b1a2
2022
github.com/cosmos/cosmos-db v1.0.2
2123
github.com/cosmos/cosmos-proto v1.0.0-beta.5
22-
github.com/cosmos/cosmos-sdk v0.50.9
24+
github.com/cosmos/cosmos-sdk v0.50.10
2325
github.com/cosmos/gogoproto v1.7.0
2426
github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.2
2527
github.com/cosmos/ibc-go/modules/capability v1.0.1
2628
github.com/cosmos/ibc-go/v8 v8.5.2
2729
github.com/cosmos/ics23/go v0.11.0
28-
github.com/cosmos/interchain-security/v5 v5.1.1
30+
github.com/cosmos/interchain-security/v5 v5.2.0
2931
github.com/gogo/protobuf v1.3.3
3032
github.com/golang/mock v1.6.0
3133
github.com/golang/protobuf v1.5.4
@@ -38,7 +40,7 @@ require (
3840
github.com/rs/zerolog v1.33.0
3941
github.com/skip-mev/block-sdk/v2 v2.1.5
4042
github.com/skip-mev/feemarket v1.1.1
41-
github.com/skip-mev/slinky v1.0.12
43+
github.com/skip-mev/slinky v1.0.13
4244
github.com/spf13/cast v1.7.0
4345
github.com/spf13/cobra v1.8.1
4446
github.com/spf13/pflag v1.0.5
@@ -72,8 +74,6 @@ require (
7274
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
7375
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
7476
github.com/bits-and-blooms/bitset v1.13.0 // indirect
75-
github.com/btcsuite/btcd v0.22.0-beta // indirect
76-
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
7777
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
7878
github.com/cespare/xxhash/v2 v2.3.0 // indirect
7979
github.com/chzyer/readline v1.5.1 // indirect
@@ -84,15 +84,15 @@ require (
8484
github.com/cockroachdb/pebble v1.1.1 // indirect
8585
github.com/cockroachdb/redact v1.1.5 // indirect
8686
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
87-
github.com/cometbft/cometbft-db v0.12.0 // indirect
87+
github.com/cometbft/cometbft-db v0.14.1 // indirect
8888
github.com/cosmos/btcutil v1.0.5 // indirect
8989
github.com/cosmos/go-bip39 v1.0.0 // indirect
9090
github.com/cosmos/gogogateway v1.2.0 // indirect
9191
github.com/cosmos/iavl v1.2.0 // indirect
9292
github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect
9393
github.com/danieljoos/wincred v1.2.0 // indirect
9494
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
95-
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
95+
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
9696
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
9797
github.com/dgraph-io/badger/v4 v4.2.0 // indirect
9898
github.com/dgraph-io/ristretto v0.1.1 // indirect
@@ -115,7 +115,7 @@ require (
115115
github.com/golang/glog v1.2.2 // indirect
116116
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
117117
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
118-
github.com/google/btree v1.1.2 // indirect
118+
github.com/google/btree v1.1.3 // indirect
119119
github.com/google/flatbuffers v1.12.1 // indirect
120120
github.com/google/go-cmp v0.6.0 // indirect
121121
github.com/google/gofuzz v1.2.0 // indirect
@@ -156,7 +156,7 @@ require (
156156
github.com/manifoldco/promptui v0.9.0 // indirect
157157
github.com/mattn/go-colorable v0.1.13 // indirect
158158
github.com/mattn/go-isatty v0.0.20 // indirect
159-
github.com/minio/highwayhash v1.0.2 // indirect
159+
github.com/minio/highwayhash v1.0.3 // indirect
160160
github.com/mitchellh/go-homedir v1.1.0 // indirect
161161
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
162162
github.com/mitchellh/mapstructure v1.5.0 // indirect
@@ -167,17 +167,17 @@ require (
167167
github.com/opencontainers/go-digest v1.0.0 // indirect
168168
github.com/oxyno-zeta/gomock-extra-matcher v1.2.0 // indirect
169169
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
170-
github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect
170+
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect
171171
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
172172
github.com/prometheus/client_model v0.6.1 // indirect
173-
github.com/prometheus/common v0.55.0 // indirect
173+
github.com/prometheus/common v0.60.1 // indirect
174174
github.com/prometheus/procfs v0.15.1 // indirect
175175
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
176176
github.com/rogpeppe/go-internal v1.12.0 // indirect
177-
github.com/rs/cors v1.8.3 // indirect
177+
github.com/rs/cors v1.11.1 // indirect
178178
github.com/sagikazarmark/locafero v0.4.0 // indirect
179179
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
180-
github.com/sasha-s/go-deadlock v0.3.1 // indirect
180+
github.com/sasha-s/go-deadlock v0.3.5 // indirect
181181
github.com/shamaton/msgpack/v2 v2.2.0 // indirect
182182
github.com/sourcegraph/conc v0.3.0 // indirect
183183
github.com/spf13/afero v1.11.0 // indirect
@@ -198,12 +198,12 @@ require (
198198
go.uber.org/mock v0.4.0 // indirect
199199
go.uber.org/multierr v1.11.0 // indirect
200200
go.uber.org/zap v1.27.0 // indirect
201-
golang.org/x/crypto v0.26.0 // indirect
202-
golang.org/x/net v0.28.0 // indirect
201+
golang.org/x/crypto v0.28.0 // indirect
202+
golang.org/x/net v0.30.0 // indirect
203203
golang.org/x/oauth2 v0.23.0 // indirect
204204
golang.org/x/sync v0.8.0 // indirect
205-
golang.org/x/sys v0.24.0 // indirect
206-
golang.org/x/term v0.23.0 // indirect
205+
golang.org/x/sys v0.26.0 // indirect
206+
golang.org/x/term v0.25.0 // indirect
207207
golang.org/x/text v0.19.0 // indirect
208208
golang.org/x/time v0.5.0 // indirect
209209
google.golang.org/api v0.186.0 // indirect
@@ -220,9 +220,9 @@ require (
220220
replace (
221221
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0
222222
github.com/CosmWasm/wasmd => github.com/neutron-org/wasmd v0.53.0-neutron
223-
github.com/cometbft/cometbft => github.com/neutron-org/cometbft v0.0.0-20241111105801-a7fe160b0b62
223+
github.com/btcsuite/btcd/btcec/v2 => github.com/btcsuite/btcd/btcec/v2 v2.3.2
224224
github.com/cosmos/admin-module/v2 => github.com/neutron-org/admin-module/v2 v2.0.2
225-
github.com/cosmos/cosmos-sdk => github.com/neutron-org/cosmos-sdk v0.50.9-neutron.0.20240924163649-207f347e9c53
225+
github.com/cosmos/cosmos-sdk => github.com/neutron-org/cosmos-sdk v0.50.10-neutron
226226
// explicitely replace iavl to v1.2.0 cause sometimes go mod tidy uses not right version
227227
github.com/cosmos/iavl => github.com/cosmos/iavl v1.2.0
228228
github.com/cosmos/interchain-security/v5 => github.com/cosmos/interchain-security/v5 v5.0.0-20240802125602-fa1e09444aae

0 commit comments

Comments
 (0)