Skip to content

Commit

Permalink
refactor: limit breaking changes for next version (#22972)
Browse files Browse the repository at this point in the history
julienrbrt authored Dec 18, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 751679f commit ca55998
Showing 6 changed files with 24 additions and 152 deletions.
57 changes: 0 additions & 57 deletions .github/scripts/check-compat.sh

This file was deleted.

75 changes: 0 additions & 75 deletions .github/workflows/software-compat-v052.yml

This file was deleted.

3 changes: 1 addition & 2 deletions client/grpc_query_test.go
Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/testutil"
"github.com/cosmos/cosmos-sdk/runtime"
"github.com/cosmos/cosmos-sdk/testutil/integration"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
"github.com/cosmos/cosmos-sdk/testutil/x/counter"
counterkeeper "github.com/cosmos/cosmos-sdk/testutil/x/counter/keeper"
@@ -38,7 +37,7 @@ func (s *IntegrationTestSuite) SetupSuite() {

logger := log.NewNopLogger()
keys := storetypes.NewKVStoreKeys(countertypes.StoreKey)
cms := integration.CreateMultiStore(keys, logger)
cms := moduletestutil.CreateMultiStore(keys, logger)
s.ctx = sdk.NewContext(cms, true, logger)
cfg := moduletestutil.MakeTestEncodingConfig(testutil.CodecOptions{}, counter.AppModule{})
s.cdc = cfg.Codec
3 changes: 1 addition & 2 deletions tests/integration/distribution/migration_v4_test.go
Original file line number Diff line number Diff line change
@@ -26,7 +26,6 @@ import (
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
"github.com/cosmos/cosmos-sdk/runtime"
"github.com/cosmos/cosmos-sdk/testutil"
"github.com/cosmos/cosmos-sdk/testutil/integration"
sdk "github.com/cosmos/cosmos-sdk/types"
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
"github.com/cosmos/cosmos-sdk/x/auth"
@@ -75,7 +74,7 @@ func TestFundsMigration(t *testing.T) {
authtypes.StoreKey, banktypes.StoreKey, disttypes.StoreKey,
)
logger := log.NewTestLogger(t)
cms := integration.CreateMultiStore(keys, logger)
cms := moduletestutil.CreateMultiStore(keys, logger)
encCfg := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, auth.AppModule{}, bank.AppModule{}, distribution.AppModule{})
ctx := sdk.NewContext(cms, true, logger)
addressCodec := addresscodec.NewBech32Codec(sdk.Bech32MainPrefix)
19 changes: 3 additions & 16 deletions testutil/integration/helpers.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
package integration

import (
coretesting "cosmossdk.io/core/testing"
"cosmossdk.io/log"
"cosmossdk.io/store"
"cosmossdk.io/store/metrics"
storetypes "cosmossdk.io/store/types"
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
)

// CreateMultiStore is a helper for setting up multiple stores for provided modules.
func CreateMultiStore(keys map[string]*storetypes.KVStoreKey, logger log.Logger) storetypes.CommitMultiStore {
db := coretesting.NewMemDB()
cms := store.NewCommitMultiStore(db, logger, metrics.NewNoOpMetrics())

for key := range keys {
cms.MountStoreWithDB(keys[key], storetypes.StoreTypeIAVL, db)
}

_ = cms.LoadLatestVersion()
return cms
}
// Deprecated: use github.com/cosmos/cosmos-sdk/types/module/testutil.CreateMultiStore instead.
var CreateMultiStore = moduletestutil.CreateMultiStore
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
package testutil

import (
coretesting "cosmossdk.io/core/testing"
"cosmossdk.io/log"
"cosmossdk.io/store"
"cosmossdk.io/store/metrics"
storetypes "cosmossdk.io/store/types"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/testutil"
@@ -78,3 +84,16 @@ type TestTxBuilder struct {
func (b *TestTxBuilder) SetExtensionOptions(extOpts ...*types.Any) {
b.ExtOptions = extOpts
}

// CreateMultiStore is a helper for setting up multiple stores for provided modules.
func CreateMultiStore(keys map[string]*storetypes.KVStoreKey, logger log.Logger) storetypes.CommitMultiStore {
db := coretesting.NewMemDB()
cms := store.NewCommitMultiStore(db, logger, metrics.NewNoOpMetrics())

for key := range keys {
cms.MountStoreWithDB(keys[key], storetypes.StoreTypeIAVL, db)
}

_ = cms.LoadLatestVersion()
return cms
}

0 comments on commit ca55998

Please sign in to comment.