feat: Upgrade to CometBFT v1.x series (#24114)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Julián Toledano <JulianToledano@users.noreply.github.com> Co-authored-by: Julien Robert <julien@rbrt.fr> Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com> Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io> Co-authored-by: Zachary Becker <zachary@interchainlabs.io>
This commit is contained in:
co-authored by
mergify[bot]
Julián Toledano
Julien Robert
Tyler
Alex | Interchain Labs
Zachary Becker
parent
b65dd23bad
commit
b71d0894f0
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
|
||||
"cosmossdk.io/core/appmodule"
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
cmtabcitypes "github.com/cometbft/cometbft/abci/types"
|
||||
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1"
|
||||
dbm "github.com/cosmos/cosmos-db"
|
||||
|
||||
"cosmossdk.io/core/appmodule"
|
||||
@@ -60,14 +60,14 @@ func NewIntegrationApp(
|
||||
bApp := baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), append(baseAppOptions, baseapp.SetChainID(appName))...)
|
||||
bApp.MountKVStores(keys)
|
||||
|
||||
bApp.SetInitChainer(func(_ sdk.Context, _ *cmtabcitypes.RequestInitChain) (*cmtabcitypes.ResponseInitChain, error) {
|
||||
bApp.SetInitChainer(func(_ sdk.Context, _ *cmtabcitypes.InitChainRequest) (*cmtabcitypes.InitChainResponse, error) {
|
||||
for _, mod := range modules {
|
||||
if m, ok := mod.(module.HasGenesis); ok {
|
||||
m.InitGenesis(sdkCtx, appCodec, m.DefaultGenesis(appCodec))
|
||||
}
|
||||
}
|
||||
|
||||
return &cmtabcitypes.ResponseInitChain{}, nil
|
||||
return &cmtabcitypes.InitChainResponse{}, nil
|
||||
})
|
||||
|
||||
bApp.SetBeginBlocker(func(_ sdk.Context) (sdk.BeginBlock, error) {
|
||||
@@ -90,7 +90,7 @@ func NewIntegrationApp(
|
||||
panic(fmt.Errorf("failed to load application version from store: %w", err))
|
||||
}
|
||||
|
||||
if _, err := bApp.InitChain(&cmtabcitypes.RequestInitChain{ChainId: appName, ConsensusParams: simtestutil.DefaultConsensusParams}); err != nil {
|
||||
if _, err := bApp.InitChain(&cmtabcitypes.InitChainRequest{ChainId: appName, ConsensusParams: simtestutil.DefaultConsensusParams}); err != nil {
|
||||
panic(fmt.Errorf("failed to initialize application: %w", err))
|
||||
}
|
||||
} else {
|
||||
@@ -98,7 +98,7 @@ func NewIntegrationApp(
|
||||
panic(fmt.Errorf("failed to load application version from store: %w", err))
|
||||
}
|
||||
|
||||
if _, err := bApp.InitChain(&cmtabcitypes.RequestInitChain{ChainId: appName}); err != nil {
|
||||
if _, err := bApp.InitChain(&cmtabcitypes.InitChainRequest{ChainId: appName}); err != nil {
|
||||
panic(fmt.Errorf("failed to initialize application: %w", err))
|
||||
}
|
||||
}
|
||||
@@ -138,7 +138,7 @@ func (app *App) RunMsg(msg sdk.Msg, option ...Option) (*codectypes.Any, error) {
|
||||
|
||||
if cfg.AutomaticFinalizeBlock {
|
||||
height := app.LastBlockHeight() + 1
|
||||
if _, err := app.FinalizeBlock(&cmtabcitypes.RequestFinalizeBlock{Height: height}); err != nil {
|
||||
if _, err := app.FinalizeBlock(&cmtabcitypes.FinalizeBlockRequest{Height: height}); err != nil {
|
||||
return nil, fmt.Errorf("failed to run finalize block: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user