SDK upgrade to v0.50 (branch) (#1611)
* Start implementation * Add implementation + some e2e test * Fix lint * Squashed: sdk upgrade to v0.50 * rebuild protos with newer proto builder (cherry picked from commit fd8f4c1d0d2163f0a504356c16cd2d250f6218f3) * update ibc-go (cherry picked from commit fb8667960fbeedb7d242baa644572986a154d4b6) * bump cosmos-sdk and ibc in the v50 branch (#1616) * tidy * upgade ibc * remove the toolchain command * Bump sdk version * Use correct bech32 prefix * Bump SDK * Enable fraud system test again * Fix genesis param name * Fix import/export simulations * set log level for benchmarks (cherry picked from commit 1cfb93008c596db62d22aba882f37a469546bfb9) * Apply review comments * Remove gov beta1 helpers * Bump sdk version to latest in branch * Fix linter * Setup mergify for main * Update mergify for better branch name --------- Co-authored-by: Pino' Surace <pino.surace@live.it> Co-authored-by: Jacob Gadikian <jacobgadikian@gmail.com>
This commit is contained in:
@@ -1,15 +1,18 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
dbm "github.com/cometbft/cometbft-db"
|
||||
"github.com/cometbft/cometbft/libs/log"
|
||||
abci "github.com/cometbft/cometbft/abci/types"
|
||||
dbm "github.com/cosmos/cosmos-db"
|
||||
"github.com/cosmos/gogoproto/proto"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"cosmossdk.io/log"
|
||||
|
||||
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/msgservice"
|
||||
|
||||
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
|
||||
)
|
||||
@@ -18,16 +21,25 @@ var emptyWasmOpts []wasmkeeper.Option
|
||||
|
||||
func TestWasmdExport(t *testing.T) {
|
||||
db := dbm.NewMemDB()
|
||||
logger := log.NewTestLogger(t)
|
||||
gapp := NewWasmAppWithCustomOptions(t, false, SetupOptions{
|
||||
Logger: log.NewTMLogger(log.NewSyncWriter(os.Stdout)),
|
||||
Logger: logger.With("instance", "first"),
|
||||
DB: db,
|
||||
AppOpts: simtestutil.NewAppOptionsWithFlagHome(t.TempDir()),
|
||||
})
|
||||
gapp.Commit()
|
||||
|
||||
// finalize block so we have CheckTx state set
|
||||
_, err := gapp.FinalizeBlock(&abci.RequestFinalizeBlock{
|
||||
Height: 1,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
_, err = gapp.Commit()
|
||||
require.NoError(t, err)
|
||||
|
||||
// Making a new app object with the db, so that initchain hasn't been called
|
||||
newGapp := NewWasmApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, simtestutil.NewAppOptionsWithFlagHome(t.TempDir()), emptyWasmOpts)
|
||||
_, err := newGapp.ExportAppStateAndValidators(false, []string{}, nil)
|
||||
newGapp := NewWasmApp(logger, db, nil, true, simtestutil.NewAppOptionsWithFlagHome(t.TempDir()), emptyWasmOpts)
|
||||
_, err = newGapp.ExportAppStateAndValidators(false, []string{}, nil)
|
||||
require.NoError(t, err, "ExportAppStateAndValidators should not have an error")
|
||||
}
|
||||
|
||||
@@ -52,3 +64,18 @@ func TestGetMaccPerms(t *testing.T) {
|
||||
dup := GetMaccPerms()
|
||||
require.Equal(t, maccPerms, dup, "duplicated module account permissions differed from actual module account permissions")
|
||||
}
|
||||
|
||||
// TestMergedRegistry tests that fetching the gogo/protov2 merged registry
|
||||
// doesn't fail after loading all file descriptors.
|
||||
func TestMergedRegistry(t *testing.T) {
|
||||
r, err := proto.MergedRegistry()
|
||||
require.NoError(t, err)
|
||||
require.Greater(t, r.NumFiles(), 0)
|
||||
}
|
||||
|
||||
func TestProtoAnnotations(t *testing.T) {
|
||||
r, err := proto.MergedRegistry()
|
||||
require.NoError(t, err)
|
||||
err = msgservice.ValidateProtoAnnotations(r)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user