Skip to content

[WIP] Bump cosmos-sdk to v0.54.0 #2319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"path/filepath"
"sort"

abci "github.com/cometbft/cometbft/abci/types"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
tmproto "github.com/cometbft/cometbft/api/cometbft/types/v2"
abci "github.com/cometbft/cometbft/v2/abci/types"
dbm "github.com/cosmos/cosmos-db"
"github.com/cosmos/gogoproto/proto"
ica "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts"
Expand Down Expand Up @@ -960,7 +960,7 @@ func (app *WasmApp) setPostHandler() {
func (app *WasmApp) Name() string { return app.BaseApp.Name() }

// PreBlocker application updates every pre block
func (app *WasmApp) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) {
func (app *WasmApp) PreBlocker(ctx sdk.Context, _ *abci.FinalizeBlockRequest) (*sdk.ResponsePreBlock, error) {
return app.ModuleManager.PreBlock(ctx)
}

Expand All @@ -979,7 +979,7 @@ func (a *WasmApp) Configurator() module.Configurator {
}

// InitChainer application update at chain initialization
func (app *WasmApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) {
func (app *WasmApp) InitChainer(ctx sdk.Context, req *abci.InitChainRequest) (*abci.InitChainResponse, error) {
var genesisState GenesisState
if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
panic(err)
Expand Down
4 changes: 2 additions & 2 deletions app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package app
import (
"testing"

abci "github.com/cometbft/cometbft/abci/types"
abci "github.com/cometbft/cometbft/v2/abci/types"
dbm "github.com/cosmos/cosmos-db"
"github.com/cosmos/gogoproto/proto"
"github.com/stretchr/testify/require"
Expand All @@ -29,7 +29,7 @@ func TestWasmdExport(t *testing.T) {
})

// finalize block so we have CheckTx state set
_, err := gapp.FinalizeBlock(&abci.RequestFinalizeBlock{
_, err := gapp.FinalizeBlock(&abci.FinalizeBlockRequest{
Height: 1,
})
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"

cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v2"

storetypes "cosmossdk.io/store/types"

Expand Down
8 changes: 4 additions & 4 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"strings"
"testing"

abci "github.com/cometbft/cometbft/abci/types"
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v2"
abci "github.com/cometbft/cometbft/v2/abci/types"
dbm "github.com/cosmos/cosmos-db"
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -128,7 +128,7 @@ func TestAppImportExport(t *testing.T) {
newApp := NewWasmApp(log.NewNopLogger(), newDB, nil, true, appOptions, emptyWasmOpts, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID))
require.Equal(t, "WasmApp", newApp.Name())

initReq := &abci.RequestInitChain{
initReq := &abci.InitChainRequest{
AppStateBytes: exported.AppState,
}

Expand Down Expand Up @@ -242,7 +242,7 @@ func TestAppSimulationAfterImport(t *testing.T) {
newApp := NewWasmApp(log.NewNopLogger(), newDB, nil, true, appOptions, emptyWasmOpts, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID))
require.Equal(t, "WasmApp", newApp.Name())

_, err = newApp.InitChain(&abci.RequestInitChain{
_, err = newApp.InitChain(&abci.InitChainRequest{
ChainId: SimAppChainID,
AppStateBytes: exported.AppState,
})
Expand Down
16 changes: 8 additions & 8 deletions app/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"testing"
"time"

abci "github.com/cometbft/cometbft/abci/types"
cmtjson "github.com/cometbft/cometbft/libs/json"
cmttypes "github.com/cometbft/cometbft/types"
abci "github.com/cometbft/cometbft/v2/abci/types"
cmtjson "github.com/cometbft/cometbft/v2/libs/json"
cmttypes "github.com/cometbft/cometbft/v2/types"
dbm "github.com/cosmos/cosmos-db"
"github.com/stretchr/testify/require"

Expand Down Expand Up @@ -105,7 +105,7 @@ func NewWasmAppWithCustomOptions(t *testing.T, isCheckTx bool, options SetupOpti

// Initialize the chain
_, err = app.InitChain(
&abci.RequestInitChain{
&abci.InitChainRequest{
Validators: []abci.ValidatorUpdate{},
ConsensusParams: simtestutil.DefaultConsensusParams,
AppStateBytes: stateBytes,
Expand Down Expand Up @@ -165,7 +165,7 @@ func SetupWithGenesisValSet(
// init chain will set the validator set and initialize the genesis accounts
consensusParams := simtestutil.DefaultConsensusParams
consensusParams.Block.MaxGas = 100 * simtestutil.DefaultGenTxGas
_, err = app.InitChain(&abci.RequestInitChain{
_, err = app.InitChain(&abci.InitChainRequest{
ChainId: chainID,
Time: time.Now().UTC(),
Validators: []abci.ValidatorUpdate{},
Expand All @@ -175,7 +175,7 @@ func SetupWithGenesisValSet(
})
require.NoError(t, err)

_, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{
_, err = app.FinalizeBlock(&abci.FinalizeBlockRequest{
Height: app.LastBlockHeight() + 1,
Hash: app.LastCommitID().Hash,
NextValidatorsHash: valSet.Hash(),
Expand Down Expand Up @@ -290,7 +290,7 @@ func NewTestNetworkFixture() network.TestFixture {
}

// SignAndDeliverWithoutCommit signs and delivers a transaction. No commit
func SignAndDeliverWithoutCommit(t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, msgs []sdk.Msg, fees sdk.Coins, chainID string, accNums, accSeqs []uint64, blockTime time.Time, priv ...cryptotypes.PrivKey) (*abci.ResponseFinalizeBlock, error) {
func SignAndDeliverWithoutCommit(t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, msgs []sdk.Msg, fees sdk.Coins, chainID string, accNums, accSeqs []uint64, blockTime time.Time, priv ...cryptotypes.PrivKey) (*abci.FinalizeBlockResponse, error) {
tx, err := simtestutil.GenSignedMockTx(
rand.New(rand.NewSource(time.Now().UnixNano())),
txCfg,
Expand All @@ -307,7 +307,7 @@ func SignAndDeliverWithoutCommit(t *testing.T, txCfg client.TxConfig, app *bam.B
bz, err := txCfg.TxEncoder()(tx)
require.NoError(t, err)

return app.FinalizeBlock(&abci.RequestFinalizeBlock{
return app.FinalizeBlock(&abci.FinalizeBlockRequest{
Height: app.LastBlockHeight() + 1,
Time: blockTime,
Txs: [][]byte{bz},
Expand Down
12 changes: 6 additions & 6 deletions benchmarks/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"testing"
"time"

abci "github.com/cometbft/cometbft/abci/types"
cmtypes "github.com/cometbft/cometbft/types"
abci "github.com/cometbft/cometbft/v2/abci/types"
cmtypes "github.com/cometbft/cometbft/v2/types"
dbm "github.com/cosmos/cosmos-db"
"github.com/rs/zerolog"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -116,14 +116,14 @@ func SetupWithGenesisAccountsAndValSet(b testing.TB, db dbm.DB, genAccs []authty
consensusParams.Block.MaxGas = 100 * simtestutil.DefaultGenTxGas

_, err = wasmApp.InitChain(
&abci.RequestInitChain{
&abci.InitChainRequest{
Validators: []abci.ValidatorUpdate{},
ConsensusParams: consensusParams,
AppStateBytes: stateBytes,
},
)
require.NoError(b, err)
_, err = wasmApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: wasmApp.LastBlockHeight() + 1})
_, err = wasmApp.FinalizeBlock(&abci.FinalizeBlockRequest{Height: wasmApp.LastBlockHeight() + 1})
require.NoError(b, err)

return wasmApp
Expand Down Expand Up @@ -174,7 +174,7 @@ func InitializeWasmApp(b testing.TB, db dbm.DB, numAccounts int) AppInfo {
// add wasm contract
height := int64(1)
txGen := moduletestutil.MakeTestEncodingConfig().TxConfig
_, err := wasmApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: height, Time: time.Now()})
_, err := wasmApp.FinalizeBlock(&abci.FinalizeBlockRequest{Height: height, Time: time.Now()})
require.NoError(b, err)

// upload the code
Expand Down Expand Up @@ -228,7 +228,7 @@ func InitializeWasmApp(b testing.TB, db dbm.DB, numAccounts int) AppInfo {
evt := res.Events[len(res.Events)-1]
attr := evt.Attributes[0]
contractAddr := attr.Value
_, err = wasmApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: height})
_, err = wasmApp.FinalizeBlock(&abci.FinalizeBlockRequest{Height: height})
require.NoError(b, err)
_, err = wasmApp.Commit()
require.NoError(b, err)
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
"time"

abci "github.com/cometbft/cometbft/abci/types"
abci "github.com/cometbft/cometbft/v2/abci/types"
dbm "github.com/cosmos/cosmos-db"
"github.com/cosmos/gogoproto/proto"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -116,7 +116,7 @@ func BenchmarkTxSending(b *testing.B) {
require.NoError(b, err)
xxx[j] = bz
}
_, err := appInfo.App.FinalizeBlock(&abci.RequestFinalizeBlock{Txs: xxx, Height: height, Time: time.Now()})
_, err := appInfo.App.FinalizeBlock(&abci.FinalizeBlockRequest{Txs: xxx, Height: height, Time: time.Now()})
require.NoError(b, err)

_, err = appInfo.App.Commit()
Expand Down
2 changes: 1 addition & 1 deletion cmd/wasmd/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io"
"os"

cmtcfg "github.com/cometbft/cometbft/config"
cmtcfg "github.com/cometbft/cometbft/v2/config"
dbm "github.com/cosmos/cosmos-db"
"github.com/prometheus/client_golang/prometheus"
"github.com/spf13/cast"
Expand Down
4 changes: 2 additions & 2 deletions cmd/wasmd/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"path/filepath"
"time"

cmtconfig "github.com/cometbft/cometbft/config"
cmttime "github.com/cometbft/cometbft/types/time"
cmtconfig "github.com/cometbft/cometbft/v2/config"
cmttime "github.com/cometbft/cometbft/v2/types/time"
"github.com/spf13/cobra"
"github.com/spf13/pflag"

Expand Down
Loading
Loading