diff --git a/Makefile b/Makefile index 927ecb09cc9c..baef621db276 100644 --- a/Makefile +++ b/Makefile @@ -368,32 +368,6 @@ format: $(golangci_lint_cmd) run --fix .PHONY: format -############################################################################### -### Devdoc ### -############################################################################### - -DEVDOC_SAVE = docker commit `docker ps -a -n 1 -q` devdoc:local - -devdoc-init: - $(DOCKER) run -it -v "$(CURDIR):/go/src/github.com/cosmos/cosmos-sdk" -w "/go/src/github.com/cosmos/cosmos-sdk" tendermint/devdoc echo - # TODO make this safer - $(call DEVDOC_SAVE) - -devdoc: - $(DOCKER) run -it -v "$(CURDIR):/go/src/github.com/cosmos/cosmos-sdk" -w "/go/src/github.com/cosmos/cosmos-sdk" devdoc:local bash - -devdoc-save: - # TODO make this safer - $(call DEVDOC_SAVE) - -devdoc-clean: - docker rmi -f $$(docker images -f "dangling=true" -q) - -devdoc-update: - docker pull tendermint/devdoc - -.PHONY: devdoc devdoc-clean devdoc-init devdoc-save devdoc-update - ############################################################################### ### Protobuf ### ############################################################################### diff --git a/UPGRADING.md b/UPGRADING.md index a655b8daee87..7f01123debac 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -4,6 +4,15 @@ This guide provides instructions for upgrading to specific versions of Cosmos SD ## [Unreleased] +### Consensus Engine + +The Cosmos SDK has migrated to CometBFT as its default consensus engine. +This is a breaking changes that needs chains to re-generate their protos. +Some functions has been renamed to reflect the naming change, following an exhaustive list: + +* `client.TendermintRPC` -> `client.CometRPC` +* `clitestutil.MockTendermintRPC` -> `clitestutil.MockCometRPC` + ### Configuration A new tool have been created for migrating configuration of the SDK. Use the following command to migrate your configuration: diff --git a/baseapp/abci.go b/baseapp/abci.go index dee4944de713..365225626251 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -11,7 +11,7 @@ import ( "time" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/gogoproto/proto" "google.golang.org/grpc/codes" grpcstatus "google.golang.org/grpc/status" @@ -38,7 +38,7 @@ const ( func (app *BaseApp) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain) { // On a new chain, we consider the init chain block height as 0, even though // req.InitialHeight is 1 by default. - initHeader := tmproto.Header{ChainID: req.ChainId, Time: req.Time} + initHeader := cmtproto.Header{ChainID: req.ChainId, Time: req.Time} app.logger.Info("InitChain", "initialHeight", req.InitialHeight, "chainID", req.ChainId) @@ -46,7 +46,7 @@ func (app *BaseApp) InitChain(req abci.RequestInitChain) (res abci.ResponseInitC // stores. if req.InitialHeight > 1 { app.initialHeight = req.InitialHeight - initHeader = tmproto.Header{ChainID: req.ChainId, Height: req.InitialHeight, Time: req.Time} + initHeader = cmtproto.Header{ChainID: req.ChainId, Height: req.InitialHeight, Time: req.Time} err := app.cms.SetInitialVersion(req.InitialHeight) if err != nil { panic(err) @@ -265,7 +265,7 @@ func (app *BaseApp) PrepareProposal(req abci.RequestPrepareProposal) (resp abci. panic("PrepareProposal method not set") } - // Tendermint must never call PrepareProposal with a height of 0. + // CometBFT must never call PrepareProposal with a height of 0. // Ref: https://github.com/cometbft/cometbft/blob/059798a4f5b0c9f52aa8655fa619054a0154088c/spec/core/state.md?plain=1#L37-L38 if req.Height < 1 { panic("PrepareProposal called with invalid height") @@ -301,7 +301,7 @@ func (app *BaseApp) PrepareProposal(req abci.RequestPrepareProposal) (resp abci. // block. Note, the application defines the exact implementation details of // ProcessProposal. In general, the application must at the very least ensure // that all transactions are valid. If all transactions are valid, then we inform -// Tendermint that the Status is ACCEPT. However, the application is also able +// CometBFT that the Status is ACCEPT. However, the application is also able // to implement optimizations such as executing the entire proposed block // immediately. // @@ -449,7 +449,7 @@ func (app *BaseApp) Commit() abci.ResponseCommit { // Reset the Check state to the latest committed. // - // NOTE: This is safe because Tendermint holds a lock on the mempool for + // NOTE: This is safe because CometBFT holds a lock on the mempool for // Commit. Use the header from this latest block. app.setState(runTxModeCheck, header) app.setState(runTxPrepareProposal, header) @@ -469,7 +469,7 @@ func (app *BaseApp) Commit() abci.ResponseCommit { } if halt { - // Halt the binary and allow Tendermint to receive the ResponseCommit + // Halt the binary and allow CometBFT to receive the ResponseCommit // response with the commit ID hash. This will allow the node to successfully // restart and process blocks assuming the halt configuration has been // reset or moved to a more distant value. @@ -637,7 +637,7 @@ func (app *BaseApp) OfferSnapshot(req abci.RequestOfferSnapshot) abci.ResponseOf ) // We currently don't support resetting the IAVL stores and retrying a different snapshot, - // so we ask Tendermint to abort all snapshot restoration. + // so we ask CometBFT to abort all snapshot restoration. return abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ABORT} } } @@ -777,7 +777,7 @@ func (app *BaseApp) CreateQueryContext(height int64, prove bool) (sdk.Context, e } // GetBlockRetentionHeight returns the height for which all blocks below this height -// are pruned from Tendermint. Given a commitment height and a non-zero local +// are pruned from CometBFT. Given a commitment height and a non-zero local // minRetainBlocks configuration, the retentionHeight is the smallest height that // satisfies: // @@ -818,7 +818,7 @@ func (app *BaseApp) GetBlockRetentionHeight(commitHeight int64) int64 { // Define retentionHeight as the minimum value that satisfies all non-zero // constraints. All blocks below (commitHeight-retentionHeight) are pruned - // from Tendermint. + // from CometBFT. var retentionHeight int64 // Define the number of blocks needed to protect against misbehaving validators diff --git a/baseapp/abci_test.go b/baseapp/abci_test.go index 53c3cc761077..5bf76abc2726 100644 --- a/baseapp/abci_test.go +++ b/baseapp/abci_test.go @@ -10,7 +10,7 @@ import ( dbm "github.com/cosmos/cosmos-db" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/gogoproto/jsonpb" "github.com/stretchr/testify/require" @@ -114,7 +114,7 @@ func TestABCI_InitChain(t *testing.T) { require.Equal(t, value, res.Value) // commit and ensure we can still query - header := tmproto.Header{Height: app.LastBlockHeight() + 1} + header := cmtproto.Header{Height: app.LastBlockHeight() + 1} app.BeginBlock(abci.RequestBeginBlock{Header: header}) app.Commit() @@ -152,14 +152,14 @@ func TestABCI_BeginBlock_WithInitialHeight(t *testing.T) { require.PanicsWithError(t, "invalid height: 4; expected: 3", func() { app.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{ + Header: cmtproto.Header{ Height: 4, }, }) }) app.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{ + Header: cmtproto.Header{ Height: 3, }, }) @@ -179,7 +179,7 @@ func TestABCI_GRPCQuery(t *testing.T) { suite := NewBaseAppSuite(t, grpcQueryOpt) suite.baseApp.InitChain(abci.RequestInitChain{ - ConsensusParams: &tmproto.ConsensusParams{}, + ConsensusParams: &cmtproto.ConsensusParams{}, }) req := testdata.SayHelloRequest{Name: "foo"} @@ -193,7 +193,7 @@ func TestABCI_GRPCQuery(t *testing.T) { require.Equal(t, sdkerrors.ErrInvalidHeight.ABCICode(), resQuery.Code, resQuery) require.Contains(t, resQuery.Log, "TestABCI_GRPCQuery is not ready; please wait for first block") - header := tmproto.Header{Height: suite.baseApp.LastBlockHeight() + 1} + header := cmtproto.Header{Height: suite.baseApp.LastBlockHeight() + 1} suite.baseApp.BeginBlock(abci.RequestBeginBlock{Header: header}) suite.baseApp.Commit() @@ -567,8 +567,8 @@ func TestABCI_EndBlock(t *testing.T) { name := t.Name() logger := defaultLogger() - cp := &tmproto.ConsensusParams{ - Block: &tmproto.BlockParams{ + cp := &cmtproto.ConsensusParams{ + Block: &cmtproto.BlockParams{ MaxGas: 5000000, }, } @@ -606,7 +606,7 @@ func TestABCI_CheckTx(t *testing.T) { nTxs := int64(5) suite.baseApp.InitChain(abci.RequestInitChain{ - ConsensusParams: &tmproto.ConsensusParams{}, + ConsensusParams: &cmtproto.ConsensusParams{}, }) for i := int64(0); i < nTxs; i++ { @@ -627,7 +627,7 @@ func TestABCI_CheckTx(t *testing.T) { require.Equal(t, nTxs, storedCounter) // if a block is committed, CheckTx state should be reset - header := tmproto.Header{Height: 1} + header := cmtproto.Header{Height: 1} suite.baseApp.BeginBlock(abci.RequestBeginBlock{Header: header, Hash: []byte("hash")}) require.NotNil(t, getCheckStateCtx(suite.baseApp).BlockGasMeter(), "block gas meter should have been set to checkState") @@ -647,7 +647,7 @@ func TestABCI_DeliverTx(t *testing.T) { suite := NewBaseAppSuite(t, anteOpt) suite.baseApp.InitChain(abci.RequestInitChain{ - ConsensusParams: &tmproto.ConsensusParams{}, + ConsensusParams: &cmtproto.ConsensusParams{}, }) deliverKey := []byte("deliver-key") @@ -657,7 +657,7 @@ func TestABCI_DeliverTx(t *testing.T) { txPerHeight := 5 for blockN := 0; blockN < nBlocks; blockN++ { - header := tmproto.Header{Height: int64(blockN) + 1} + header := cmtproto.Header{Height: int64(blockN) + 1} suite.baseApp.BeginBlock(abci.RequestBeginBlock{Header: header}) for i := 0; i < txPerHeight; i++ { @@ -687,7 +687,7 @@ func TestABCI_DeliverTx_MultiMsg(t *testing.T) { suite := NewBaseAppSuite(t, anteOpt) suite.baseApp.InitChain(abci.RequestInitChain{ - ConsensusParams: &tmproto.ConsensusParams{}, + ConsensusParams: &cmtproto.ConsensusParams{}, }) deliverKey := []byte("deliver-key") @@ -698,7 +698,7 @@ func TestABCI_DeliverTx_MultiMsg(t *testing.T) { // run a multi-msg tx // with all msgs the same route - header := tmproto.Header{Height: 1} + header := cmtproto.Header{Height: 1} suite.baseApp.BeginBlock(abci.RequestBeginBlock{Header: header}) tx := newTxCounter(t, suite.txConfig, 0, 0, 1, 2) @@ -762,7 +762,7 @@ func TestABCI_Query_SimulateTx(t *testing.T) { suite := NewBaseAppSuite(t, anteOpt) suite.baseApp.InitChain(abci.RequestInitChain{ - ConsensusParams: &tmproto.ConsensusParams{}, + ConsensusParams: &cmtproto.ConsensusParams{}, }) baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), CounterServerImplGasMeterOnly{gasConsumed}) @@ -770,7 +770,7 @@ func TestABCI_Query_SimulateTx(t *testing.T) { nBlocks := 3 for blockN := 0; blockN < nBlocks; blockN++ { count := int64(blockN + 1) - header := tmproto.Header{Height: count} + header := cmtproto.Header{Height: count} suite.baseApp.BeginBlock(abci.RequestBeginBlock{Header: header}) tx := newTxCounter(t, suite.txConfig, count, count) @@ -822,10 +822,10 @@ func TestABCI_InvalidTransaction(t *testing.T) { baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), CounterServerImplGasMeterOnly{}) suite.baseApp.InitChain(abci.RequestInitChain{ - ConsensusParams: &tmproto.ConsensusParams{}, + ConsensusParams: &cmtproto.ConsensusParams{}, }) - header := tmproto.Header{Height: 1} + header := cmtproto.Header{Height: 1} suite.baseApp.BeginBlock(abci.RequestBeginBlock{Header: header}) // transaction with no messages @@ -948,10 +948,10 @@ func TestABCI_TxGasLimits(t *testing.T) { baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), CounterServerImplGasMeterOnly{}) suite.baseApp.InitChain(abci.RequestInitChain{ - ConsensusParams: &tmproto.ConsensusParams{}, + ConsensusParams: &cmtproto.ConsensusParams{}, }) - header := tmproto.Header{Height: 1} + header := cmtproto.Header{Height: 1} suite.baseApp.BeginBlock(abci.RequestBeginBlock{Header: header}) testCases := []struct { @@ -1027,14 +1027,14 @@ func TestABCI_MaxBlockGasLimits(t *testing.T) { baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), CounterServerImplGasMeterOnly{}) suite.baseApp.InitChain(abci.RequestInitChain{ - ConsensusParams: &tmproto.ConsensusParams{ - Block: &tmproto.BlockParams{ + ConsensusParams: &cmtproto.ConsensusParams{ + Block: &cmtproto.BlockParams{ MaxGas: 100, }, }, }) - header := tmproto.Header{Height: 1} + header := cmtproto.Header{Height: 1} suite.baseApp.BeginBlock(abci.RequestBeginBlock{Header: header}) testCases := []struct { @@ -1060,7 +1060,7 @@ func TestABCI_MaxBlockGasLimits(t *testing.T) { tx := tc.tx // reset the block gas - header := tmproto.Header{Height: suite.baseApp.LastBlockHeight() + 1} + header := cmtproto.Header{Height: suite.baseApp.LastBlockHeight() + 1} suite.baseApp.BeginBlock(abci.RequestBeginBlock{Header: header}) // execute the transaction multiple times @@ -1126,14 +1126,14 @@ func TestABCI_GasConsumptionBadTx(t *testing.T) { baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), CounterServerImplGasMeterOnly{}) suite.baseApp.InitChain(abci.RequestInitChain{ - ConsensusParams: &tmproto.ConsensusParams{ - Block: &tmproto.BlockParams{ + ConsensusParams: &cmtproto.ConsensusParams{ + Block: &cmtproto.BlockParams{ MaxGas: 9, }, }, }) - header := tmproto.Header{Height: suite.baseApp.LastBlockHeight() + 1} + header := cmtproto.Header{Height: suite.baseApp.LastBlockHeight() + 1} suite.baseApp.BeginBlock(abci.RequestBeginBlock{Header: header}) tx := newTxCounter(t, suite.txConfig, 5, 0) @@ -1167,7 +1167,7 @@ func TestABCI_Query(t *testing.T) { baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), CounterServerImplGasMeterOnly{}) suite.baseApp.InitChain(abci.RequestInitChain{ - ConsensusParams: &tmproto.ConsensusParams{}, + ConsensusParams: &cmtproto.ConsensusParams{}, }) // NOTE: "/store/key1" tells us KVStore @@ -1192,7 +1192,7 @@ func TestABCI_Query(t *testing.T) { require.Equal(t, 0, len(res.Value)) // query is still empty after a DeliverTx before we commit - header := tmproto.Header{Height: suite.baseApp.LastBlockHeight() + 1} + header := cmtproto.Header{Height: suite.baseApp.LastBlockHeight() + 1} suite.baseApp.BeginBlock(abci.RequestBeginBlock{Header: header}) _, resTx, err = suite.baseApp.SimDeliver(suite.txConfig.TxEncoder(), tx) @@ -1305,8 +1305,8 @@ func TestABCI_GetBlockRetentionHeight(t *testing.T) { tc.bapp.SetParamStore(¶mStore{db: dbm.NewMemDB()}) tc.bapp.InitChain(abci.RequestInitChain{ - ConsensusParams: &tmproto.ConsensusParams{ - Evidence: &tmproto.EvidenceParams{ + ConsensusParams: &cmtproto.ConsensusParams{ + Evidence: &cmtproto.EvidenceParams{ MaxAgeNumBlocks: tc.maxAgeBlocks, }, }, @@ -1330,7 +1330,7 @@ func TestABCI_Proposal_HappyPath(t *testing.T) { baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), NoopCounterServerImpl{}) suite.baseApp.InitChain(abci.RequestInitChain{ - ConsensusParams: &tmproto.ConsensusParams{}, + ConsensusParams: &cmtproto.ConsensusParams{}, }) tx := newTxCounter(t, suite.txConfig, 0, 1) @@ -1370,7 +1370,7 @@ func TestABCI_Proposal_HappyPath(t *testing.T) { require.Equal(t, abci.ResponseProcessProposal_ACCEPT, resProcessProposal.Status) suite.baseApp.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{Height: suite.baseApp.LastBlockHeight() + 1}, + Header: cmtproto.Header{Height: suite.baseApp.LastBlockHeight() + 1}, }) res := suite.baseApp.DeliverTx(abci.RequestDeliverTx{Tx: txBytes}) @@ -1402,7 +1402,7 @@ func TestABCI_Proposal_Read_State_PrepareProposal(t *testing.T) { suite := NewBaseAppSuite(t, setInitChainerOpt, prepareOpt) suite.baseApp.InitChain(abci.RequestInitChain{ - ConsensusParams: &tmproto.ConsensusParams{}, + ConsensusParams: &cmtproto.ConsensusParams{}, }) reqPrepareProposal := abci.RequestPrepareProposal{ @@ -1421,7 +1421,7 @@ func TestABCI_Proposal_Read_State_PrepareProposal(t *testing.T) { require.Equal(t, abci.ResponseProcessProposal_ACCEPT, resProcessProposal.Status) suite.baseApp.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{Height: suite.baseApp.LastBlockHeight() + 1}, + Header: cmtproto.Header{Height: suite.baseApp.LastBlockHeight() + 1}, }) } @@ -1434,7 +1434,7 @@ func TestABCI_PrepareProposal_ReachedMaxBytes(t *testing.T) { suite := NewBaseAppSuite(t, anteOpt, baseapp.SetMempool(pool)) suite.baseApp.InitChain(abci.RequestInitChain{ - ConsensusParams: &tmproto.ConsensusParams{}, + ConsensusParams: &cmtproto.ConsensusParams{}, }) for i := 0; i < 100; i++ { @@ -1460,7 +1460,7 @@ func TestABCI_PrepareProposal_BadEncoding(t *testing.T) { suite := NewBaseAppSuite(t, anteOpt, baseapp.SetMempool(pool)) suite.baseApp.InitChain(abci.RequestInitChain{ - ConsensusParams: &tmproto.ConsensusParams{}, + ConsensusParams: &cmtproto.ConsensusParams{}, }) tx := newTxCounter(t, suite.txConfig, 0, 0) @@ -1484,7 +1484,7 @@ func TestABCI_PrepareProposal_Failures(t *testing.T) { suite := NewBaseAppSuite(t, anteOpt, baseapp.SetMempool(pool)) suite.baseApp.InitChain(abci.RequestInitChain{ - ConsensusParams: &tmproto.ConsensusParams{}, + ConsensusParams: &cmtproto.ConsensusParams{}, }) tx := newTxCounter(t, suite.txConfig, 0, 0) @@ -1522,7 +1522,7 @@ func TestABCI_PrepareProposal_PanicRecovery(t *testing.T) { suite := NewBaseAppSuite(t, prepareOpt) suite.baseApp.InitChain(abci.RequestInitChain{ - ConsensusParams: &tmproto.ConsensusParams{}, + ConsensusParams: &cmtproto.ConsensusParams{}, }) req := abci.RequestPrepareProposal{ @@ -1545,7 +1545,7 @@ func TestABCI_ProcessProposal_PanicRecovery(t *testing.T) { suite := NewBaseAppSuite(t, processOpt) suite.baseApp.InitChain(abci.RequestInitChain{ - ConsensusParams: &tmproto.ConsensusParams{}, + ConsensusParams: &cmtproto.ConsensusParams{}, }) require.NotPanics(t, func() { diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index a3bc422f63aa..2ce06b2565df 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -9,7 +9,7 @@ import ( abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/crypto/tmhash" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/gogoproto/proto" "golang.org/x/exp/maps" @@ -114,11 +114,11 @@ type BaseApp struct { //nolint: maligned // minRetainBlocks defines the minimum block height offset from the current // block being committed, such that all blocks past this offset are pruned - // from Tendermint. It is used as part of the process of determining the + // from CometBFT. It is used as part of the process of determining the // ResponseCommit.RetainHeight value during ABCI Commit. A value of 0 indicates // that no blocks should be pruned. // - // Note: Tendermint block pruning is dependant on this parameter in conjunction + // Note: CometBFT block pruning is dependant on this parameter in conjunction // with the unbonding (safety threshold) period, state pruning and state sync // snapshot parameters to determine the correct minimum value of // ResponseCommit.RetainHeight. @@ -138,7 +138,7 @@ type BaseApp struct { //nolint: maligned trace bool // indexEvents defines the set of events in the form {eventType}.{attributeKey}, - // which informs Tendermint what to index. If empty, all events will be indexed. + // which informs CometBFT what to index. If empty, all events will be indexed. indexEvents map[string]struct{} // abciListeners for hooking into the ABCI message processing of the BaseApp @@ -349,7 +349,7 @@ func (app *BaseApp) Init() error { panic("cannot call initFromMainStore: baseapp already sealed") } - emptyHeader := tmproto.Header{} + emptyHeader := cmtproto.Header{} // needed for the export command which inits from store but never calls initchain app.setState(runTxModeCheck, emptyHeader) @@ -407,7 +407,7 @@ func (app *BaseApp) IsSealed() bool { return app.sealed } // setState sets the BaseApp's state for the corresponding mode with a branched // multi-store (i.e. a CacheMultiStore) and a new Context with the same // multi-store branch, and provided header. -func (app *BaseApp) setState(mode runTxMode, header tmproto.Header) { +func (app *BaseApp) setState(mode runTxMode, header cmtproto.Header) { ms := app.cms.CacheMultiStore() baseState := &state{ ms: ms, @@ -435,7 +435,7 @@ func (app *BaseApp) setState(mode runTxMode, header tmproto.Header) { // GetConsensusParams returns the current consensus parameters from the BaseApp's // ParamStore. If the BaseApp has no ParamStore defined, nil is returned. -func (app *BaseApp) GetConsensusParams(ctx sdk.Context) *tmproto.ConsensusParams { +func (app *BaseApp) GetConsensusParams(ctx sdk.Context) *cmtproto.ConsensusParams { if app.paramStore == nil { return nil } @@ -449,7 +449,7 @@ func (app *BaseApp) GetConsensusParams(ctx sdk.Context) *tmproto.ConsensusParams } // StoreConsensusParams sets the consensus parameters to the baseapp's param store. -func (app *BaseApp) StoreConsensusParams(ctx sdk.Context, cp *tmproto.ConsensusParams) { +func (app *BaseApp) StoreConsensusParams(ctx sdk.Context, cp *cmtproto.ConsensusParams) { if app.paramStore == nil { panic("cannot store consensus params with no params store set") } @@ -459,7 +459,7 @@ func (app *BaseApp) StoreConsensusParams(ctx sdk.Context, cp *tmproto.ConsensusP } app.paramStore.Set(ctx, cp) - // We're explicitly not storing the Tendermint app_version in the param store. It's + // We're explicitly not storing the CometBFT app_version in the param store. It's // stored instead in the x/upgrade store, with its own bump logic. } @@ -862,12 +862,12 @@ func createEvents(events sdk.Events, msg sdk.Msg) sdk.Events { // non-default handlers. // // - If no mempool is set or if the mempool is a no-op mempool, the transactions -// requested from Tendermint will simply be returned, which, by default, are in +// requested from CometBFT will simply be returned, which, by default, are in // FIFO order. func (app *BaseApp) DefaultPrepareProposal() sdk.PrepareProposalHandler { return func(ctx sdk.Context, req abci.RequestPrepareProposal) abci.ResponsePrepareProposal { // If the mempool is nil or a no-op mempool, we simply return the transactions - // requested from Tendermint, which, by default, should be in FIFO order. + // requested from CometBFT, which, by default, should be in FIFO order. _, isNoOp := app.mempool.(mempool.NoOpMempool) if app.mempool == nil || isNoOp { return abci.ResponsePrepareProposal{Txs: req.Txs} diff --git a/baseapp/baseapp_test.go b/baseapp/baseapp_test.go index 2cf579290cb5..328556663d67 100644 --- a/baseapp/baseapp_test.go +++ b/baseapp/baseapp_test.go @@ -8,7 +8,7 @@ import ( abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" @@ -100,14 +100,14 @@ func NewBaseAppSuiteWithSnapshots(t *testing.T, cfg SnapshotsConfig, opts ...fun baseapptestutil.RegisterKeyValueServer(suite.baseApp.MsgServiceRouter(), MsgKeyValueImpl{}) suite.baseApp.InitChain(abci.RequestInitChain{ - ConsensusParams: &tmproto.ConsensusParams{}, + ConsensusParams: &cmtproto.ConsensusParams{}, }) r := rand.New(rand.NewSource(3920758213583)) keyCounter := 0 for height := int64(1); height <= int64(cfg.blocks); height++ { - suite.baseApp.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: height}}) + suite.baseApp.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: height}}) for txNum := 0; txNum < cfg.blockTxs; txNum++ { msgs := []sdk.Msg{} @@ -179,13 +179,13 @@ func TestLoadVersion(t *testing.T) { require.Equal(t, emptyCommitID, lastID) // execute a block, collect commit ID - header := tmproto.Header{Height: 1} + header := cmtproto.Header{Height: 1} app.BeginBlock(abci.RequestBeginBlock{Header: header}) res := app.Commit() commitID1 := storetypes.CommitID{Version: 1, Hash: res.Data} // execute a block, collect commit ID - header = tmproto.Header{Height: 2} + header = cmtproto.Header{Height: 2} app.BeginBlock(abci.RequestBeginBlock{Header: header}) res = app.Commit() commitID2 := storetypes.CommitID{Version: 2, Hash: res.Data} @@ -291,7 +291,7 @@ func TestSetLoader(t *testing.T) { require.Nil(t, err) // "execute" one block - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: 2}}) + app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: 2}}) res := app.Commit() require.NotNil(t, res.Data) @@ -337,7 +337,7 @@ func TestLoadVersionInvalid(t *testing.T) { err = app.LoadVersion(-1) require.Error(t, err) - header := tmproto.Header{Height: 1} + header := cmtproto.Header{Height: 1} app.BeginBlock(abci.RequestBeginBlock{Header: header}) res := app.Commit() commitID1 := storetypes.CommitID{Version: 1, Hash: res.Data} @@ -436,10 +436,10 @@ func TestCustomRunTxPanicHandler(t *testing.T) { suite := NewBaseAppSuite(t, anteOpt) suite.baseApp.InitChain(abci.RequestInitChain{ - ConsensusParams: &tmproto.ConsensusParams{}, + ConsensusParams: &cmtproto.ConsensusParams{}, }) - header := tmproto.Header{Height: 1} + header := cmtproto.Header{Height: 1} suite.baseApp.BeginBlock(abci.RequestBeginBlock{Header: header}) suite.baseApp.AddRunTxRecoveryHandler(func(recoveryObj interface{}) error { @@ -476,10 +476,10 @@ func TestBaseAppAnteHandler(t *testing.T) { baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), CounterServerImpl{t, capKey1, deliverKey}) suite.baseApp.InitChain(abci.RequestInitChain{ - ConsensusParams: &tmproto.ConsensusParams{}, + ConsensusParams: &cmtproto.ConsensusParams{}, }) - header := tmproto.Header{Height: suite.baseApp.LastBlockHeight() + 1} + header := cmtproto.Header{Height: suite.baseApp.LastBlockHeight() + 1} suite.baseApp.BeginBlock(abci.RequestBeginBlock{Header: header}) // execute a tx that will fail ante handler execution @@ -549,10 +549,10 @@ func TestABCI_CreateQueryContext(t *testing.T) { name := t.Name() app := baseapp.NewBaseApp(name, logger, db, nil) - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: 1}}) + app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: 1}}) app.Commit() - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: 2}}) + app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: 2}}) app.Commit() testCases := []struct { @@ -590,18 +590,18 @@ func TestSetMinGasPrices(t *testing.T) { func TestGetMaximumBlockGas(t *testing.T) { suite := NewBaseAppSuite(t) suite.baseApp.InitChain(abci.RequestInitChain{}) - ctx := suite.baseApp.NewContext(true, tmproto.Header{}) + ctx := suite.baseApp.NewContext(true, cmtproto.Header{}) - suite.baseApp.StoreConsensusParams(ctx, &tmproto.ConsensusParams{Block: &tmproto.BlockParams{MaxGas: 0}}) + suite.baseApp.StoreConsensusParams(ctx, &cmtproto.ConsensusParams{Block: &cmtproto.BlockParams{MaxGas: 0}}) require.Equal(t, uint64(0), suite.baseApp.GetMaximumBlockGas(ctx)) - suite.baseApp.StoreConsensusParams(ctx, &tmproto.ConsensusParams{Block: &tmproto.BlockParams{MaxGas: -1}}) + suite.baseApp.StoreConsensusParams(ctx, &cmtproto.ConsensusParams{Block: &cmtproto.BlockParams{MaxGas: -1}}) require.Equal(t, uint64(0), suite.baseApp.GetMaximumBlockGas(ctx)) - suite.baseApp.StoreConsensusParams(ctx, &tmproto.ConsensusParams{Block: &tmproto.BlockParams{MaxGas: 5000000}}) + suite.baseApp.StoreConsensusParams(ctx, &cmtproto.ConsensusParams{Block: &cmtproto.BlockParams{MaxGas: 5000000}}) require.Equal(t, uint64(5000000), suite.baseApp.GetMaximumBlockGas(ctx)) - suite.baseApp.StoreConsensusParams(ctx, &tmproto.ConsensusParams{Block: &tmproto.BlockParams{MaxGas: -5000000}}) + suite.baseApp.StoreConsensusParams(ctx, &cmtproto.ConsensusParams{Block: &cmtproto.BlockParams{MaxGas: -5000000}}) require.Panics(t, func() { suite.baseApp.GetMaximumBlockGas(ctx) }) } @@ -633,7 +633,7 @@ func TestLoadVersionPruning(t *testing.T) { // Commit seven blocks, of which 7 (latest) is kept in addition to 6, 5 // (keep recent) and 3 (keep every). for i := int64(1); i <= 7; i++ { - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: i}}) + app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: i}}) res := app.Commit() lastCommitID = storetypes.CommitID{Version: i, Hash: res.Data} } diff --git a/baseapp/block_gas_test.go b/baseapp/block_gas_test.go index bc854625d9a3..6978652fb8ce 100644 --- a/baseapp/block_gas_test.go +++ b/baseapp/block_gas_test.go @@ -8,9 +8,9 @@ import ( "cosmossdk.io/depinject" sdkmath "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" - tmjson "github.com/cometbft/cometbft/libs/json" + cmtjson "github.com/cometbft/cometbft/libs/json" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" @@ -112,7 +112,7 @@ func TestBaseApp_BlockGas(t *testing.T) { }) genState := GenesisStateWithSingleValidator(t, cdc, appBuilder) - stateBytes, err := tmjson.MarshalIndent(genState, "", " ") + stateBytes, err := cmtjson.MarshalIndent(genState, "", " ") require.NoError(t, err) bapp.InitChain(abci.RequestInitChain{ Validators: []abci.ValidatorUpdate{}, @@ -120,7 +120,7 @@ func TestBaseApp_BlockGas(t *testing.T) { AppStateBytes: stateBytes, }) - ctx := bapp.NewContext(false, tmproto.Header{}) + ctx := bapp.NewContext(false, cmtproto.Header{}) // tx fee feeCoin := sdk.NewCoin("atom", sdkmath.NewInt(150)) @@ -154,7 +154,7 @@ func TestBaseApp_BlockGas(t *testing.T) { _, txBytes, err := createTestTx(txConfig, txBuilder, privs, accNums, accSeqs, ctx.ChainID()) require.NoError(t, err) - bapp.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: 1}}) + bapp.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: 1}}) rsp := bapp.DeliverTx(abci.RequestDeliverTx{Tx: txBytes}) // check result diff --git a/baseapp/msg_service_router_test.go b/baseapp/msg_service_router_test.go index cd9e2f817445..45e4832b1a1b 100644 --- a/baseapp/msg_service_router_test.go +++ b/baseapp/msg_service_router_test.go @@ -6,7 +6,7 @@ import ( abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" @@ -100,7 +100,7 @@ func TestMsgService(t *testing.T) { app.MsgServiceRouter(), testdata.MsgServerImpl{}, ) - _ = app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: 1}}) + _ = app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: 1}}) msg := testdata.MsgCreateDog{Dog: &testdata.Dog{Name: "Spot"}} diff --git a/baseapp/params.go b/baseapp/params.go index fb1819db1909..1ac07da3668e 100644 --- a/baseapp/params.go +++ b/baseapp/params.go @@ -1,7 +1,7 @@ package baseapp import ( - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -9,7 +9,7 @@ import ( // ParamStore defines the interface the parameter store used by the BaseApp must // fulfill. type ParamStore interface { - Get(ctx sdk.Context) (*tmproto.ConsensusParams, error) + Get(ctx sdk.Context) (*cmtproto.ConsensusParams, error) Has(ctx sdk.Context) bool - Set(ctx sdk.Context, cp *tmproto.ConsensusParams) + Set(ctx sdk.Context, cp *cmtproto.ConsensusParams) } diff --git a/baseapp/params_legacy.go b/baseapp/params_legacy.go index 80084a641e58..c8770cc6c091 100644 --- a/baseapp/params_legacy.go +++ b/baseapp/params_legacy.go @@ -1,7 +1,7 @@ /* Deprecated. -Legacy types are defined below to aid in the migration of Tendermint consensus +Legacy types are defined below to aid in the migration of CometBFT consensus parameters from use of the now deprecated x/params modules to a new dedicated x/consensus module. @@ -29,7 +29,7 @@ Example: Developers can also bypass the use of the legacy Params subspace and set the values to app.ConsensusParamsKeeper.Set() explicitly. -Note, for new chains this is not necessary as Tendermint's consensus parameters +Note, for new chains this is not necessary as CometBFT's consensus parameters will automatically be set for you in InitChain. */ package baseapp @@ -38,7 +38,7 @@ import ( "errors" "fmt" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -57,7 +57,7 @@ type LegacyParamStore interface { } func ValidateBlockParams(i interface{}) error { - v, ok := i.(tmproto.BlockParams) + v, ok := i.(cmtproto.BlockParams) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } @@ -74,7 +74,7 @@ func ValidateBlockParams(i interface{}) error { } func ValidateEvidenceParams(i interface{}) error { - v, ok := i.(tmproto.EvidenceParams) + v, ok := i.(cmtproto.EvidenceParams) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } @@ -95,7 +95,7 @@ func ValidateEvidenceParams(i interface{}) error { } func ValidateValidatorParams(i interface{}) error { - v, ok := i.(tmproto.ValidatorParams) + v, ok := i.(cmtproto.ValidatorParams) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } @@ -107,29 +107,29 @@ func ValidateValidatorParams(i interface{}) error { return nil } -func GetConsensusParams(ctx sdk.Context, paramStore LegacyParamStore) *tmproto.ConsensusParams { +func GetConsensusParams(ctx sdk.Context, paramStore LegacyParamStore) *cmtproto.ConsensusParams { if paramStore == nil { return nil } - cp := new(tmproto.ConsensusParams) + cp := new(cmtproto.ConsensusParams) if paramStore.Has(ctx, ParamStoreKeyBlockParams) { - var bp tmproto.BlockParams + var bp cmtproto.BlockParams paramStore.Get(ctx, ParamStoreKeyBlockParams, &bp) cp.Block = &bp } if paramStore.Has(ctx, ParamStoreKeyEvidenceParams) { - var ep tmproto.EvidenceParams + var ep cmtproto.EvidenceParams paramStore.Get(ctx, ParamStoreKeyEvidenceParams, &ep) cp.Evidence = &ep } if paramStore.Has(ctx, ParamStoreKeyValidatorParams) { - var vp tmproto.ValidatorParams + var vp cmtproto.ValidatorParams paramStore.Get(ctx, ParamStoreKeyValidatorParams, &vp) cp.Validator = &vp diff --git a/baseapp/test_helpers.go b/baseapp/test_helpers.go index a8ecee084d5c..81be264ef8d3 100644 --- a/baseapp/test_helpers.go +++ b/baseapp/test_helpers.go @@ -1,7 +1,7 @@ package baseapp import ( - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -37,7 +37,7 @@ func (app *BaseApp) SimDeliver(txEncoder sdk.TxEncoder, tx sdk.Tx) (sdk.GasInfo, } // Context with current {check, deliver}State of the app used by tests. -func (app *BaseApp) NewContext(isCheckTx bool, header tmproto.Header) sdk.Context { +func (app *BaseApp) NewContext(isCheckTx bool, header cmtproto.Header) sdk.Context { if isCheckTx { return sdk.NewContext(app.checkState.ms, header, true, app.logger). WithMinGasPrices(app.minGasPrices) @@ -46,7 +46,7 @@ func (app *BaseApp) NewContext(isCheckTx bool, header tmproto.Header) sdk.Contex return sdk.NewContext(app.deliverState.ms, header, false, app.logger) } -func (app *BaseApp) NewUncachedContext(isCheckTx bool, header tmproto.Header) sdk.Context { +func (app *BaseApp) NewUncachedContext(isCheckTx bool, header cmtproto.Header) sdk.Context { return sdk.NewContext(app.cms, header, isCheckTx, app.logger) } diff --git a/baseapp/utils_test.go b/baseapp/utils_test.go index e85a5eda01ca..e87e5636264e 100644 --- a/baseapp/utils_test.go +++ b/baseapp/utils_test.go @@ -20,8 +20,8 @@ import ( "cosmossdk.io/depinject" sdkmath "cosmossdk.io/math" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttypes "github.com/cometbft/cometbft/types" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" @@ -71,8 +71,8 @@ func GenesisStateWithSingleValidator(t *testing.T, codec codec.Codec, builder *r require.NoError(t, err) // create validator set with single validator - validator := tmtypes.NewValidator(pubKey, 1) - valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) + validator := cmttypes.NewValidator(pubKey, 1) + valSet := cmttypes.NewValidatorSet([]*cmttypes.Validator{validator}) // generate genesis account senderPrivKey := secp256k1.GenPrivKey() @@ -249,7 +249,7 @@ type paramStore struct { db *dbm.MemDB } -func (ps *paramStore) Set(_ sdk.Context, value *tmproto.ConsensusParams) { +func (ps *paramStore) Set(_ sdk.Context, value *cmtproto.ConsensusParams) { bz, err := json.Marshal(value) if err != nil { panic(err) @@ -267,7 +267,7 @@ func (ps *paramStore) Has(_ sdk.Context) bool { return ok } -func (ps paramStore) Get(ctx sdk.Context) (*tmproto.ConsensusParams, error) { +func (ps paramStore) Get(ctx sdk.Context) (*cmtproto.ConsensusParams, error) { bz, err := ps.db.Get(ParamStoreKey) if err != nil { panic(err) @@ -277,7 +277,7 @@ func (ps paramStore) Get(ctx sdk.Context) (*tmproto.ConsensusParams, error) { return nil, errors.New("params not found") } - var params tmproto.ConsensusParams + var params cmtproto.ConsensusParams if err := json.Unmarshal(bz, ¶ms); err != nil { panic(err) } diff --git a/client/broadcast.go b/client/broadcast.go index fec6aae04fd7..1f90579c3f92 100644 --- a/client/broadcast.go +++ b/client/broadcast.go @@ -6,7 +6,7 @@ import ( "strings" "github.com/cometbft/cometbft/mempool" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -36,14 +36,14 @@ func (ctx Context) BroadcastTx(txBytes []byte) (res *sdk.TxResponse, err error) } // CheckTendermintError checks if the error returned from BroadcastTx is a -// Tendermint error that is returned before the tx is submitted due to -// precondition checks that failed. If an Tendermint error is detected, this +// CometBFT error that is returned before the tx is submitted due to +// precondition checks that failed. If an CometBFT error is detected, this // function returns the correct code back in TxResponse. // // TODO: Avoid brittle string matching in favor of error matching. This requires -// a change to Tendermint's RPCError type to allow retrieval or matching against +// a change to CometBFT's RPCError type to allow retrieval or matching against // a concrete error type. -func CheckTendermintError(err error, tx tmtypes.Tx) *sdk.TxResponse { +func CheckTendermintError(err error, tx cmttypes.Tx) *sdk.TxResponse { if err == nil { return nil } @@ -78,7 +78,7 @@ func CheckTendermintError(err error, tx tmtypes.Tx) *sdk.TxResponse { } } -// BroadcastTxSync broadcasts transaction bytes to a Tendermint node +// BroadcastTxSync broadcasts transaction bytes to a CometBFT node // synchronously (i.e. returns after CheckTx execution). func (ctx Context) BroadcastTxSync(txBytes []byte) (*sdk.TxResponse, error) { node, err := ctx.GetNode() @@ -94,7 +94,7 @@ func (ctx Context) BroadcastTxSync(txBytes []byte) (*sdk.TxResponse, error) { return sdk.NewResponseFormatBroadcastTx(res), err } -// BroadcastTxAsync broadcasts transaction bytes to a Tendermint node +// BroadcastTxAsync broadcasts transaction bytes to a CometBFT node // asynchronously (i.e. returns immediately). func (ctx Context) BroadcastTxAsync(txBytes []byte) (*sdk.TxResponse, error) { node, err := ctx.GetNode() diff --git a/client/broadcast_test.go b/client/broadcast_test.go index 95483f94eb4d..83970e54854a 100644 --- a/client/broadcast_test.go +++ b/client/broadcast_test.go @@ -9,7 +9,7 @@ import ( "github.com/cometbft/cometbft/mempool" "github.com/cometbft/cometbft/rpc/client/mock" coretypes "github.com/cometbft/cometbft/rpc/core/types" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/client/flags" @@ -21,11 +21,11 @@ type MockClient struct { err error } -func (c MockClient) BroadcastTxAsync(ctx context.Context, tx tmtypes.Tx) (*coretypes.ResultBroadcastTx, error) { +func (c MockClient) BroadcastTxAsync(ctx context.Context, tx cmttypes.Tx) (*coretypes.ResultBroadcastTx, error) { return nil, c.err } -func (c MockClient) BroadcastTxSync(ctx context.Context, tx tmtypes.Tx) (*coretypes.ResultBroadcastTx, error) { +func (c MockClient) BroadcastTxSync(ctx context.Context, tx cmttypes.Tx) (*coretypes.ResultBroadcastTx, error) { return nil, c.err } diff --git a/client/tendermint.go b/client/cometbft.go similarity index 88% rename from client/tendermint.go rename to client/cometbft.go index 66ef0a961c21..43f464701608 100644 --- a/client/tendermint.go +++ b/client/cometbft.go @@ -7,9 +7,9 @@ import ( coretypes "github.com/cometbft/cometbft/rpc/core/types" ) -// TendermintRPC defines the interface of a Tendermint RPC client needed for +// CometRPC defines the interface of a CometBFT RPC client needed for // queries and transaction handling. -type TendermintRPC interface { +type CometRPC interface { rpcclient.ABCIClient Validators(ctx context.Context, height *int64, page, perPage *int) (*coretypes.ResultValidators, error) diff --git a/client/config/toml.go b/client/config/toml.go index 202fbd76968e..b3ef23ee51c8 100644 --- a/client/config/toml.go +++ b/client/config/toml.go @@ -21,7 +21,7 @@ chain-id = "{{ .ChainID }}" keyring-backend = "{{ .KeyringBackend }}" # CLI output format (text|json) output = "{{ .Output }}" -# : to Tendermint RPC interface for this chain +# : to CometBFT RPC interface for this chain node = "{{ .Node }}" # Transaction broadcasting mode (sync|async) broadcast-mode = "{{ .BroadcastMode }}" diff --git a/client/context.go b/client/context.go index 615867468d1e..2bcbecd83727 100644 --- a/client/context.go +++ b/client/context.go @@ -25,7 +25,7 @@ type PreprocessTxFn func(chainID string, key keyring.KeyType, tx TxBuilder) erro // handling and queries. type Context struct { FromAddress sdk.AccAddress - Client TendermintRPC + Client CometRPC GRPCClient *grpc.ClientConn ChainID string Codec codec.Codec @@ -129,7 +129,7 @@ func (ctx Context) WithHeight(height int64) Context { // WithClient returns a copy of the context with an updated RPC client // instance. -func (ctx Context) WithClient(client TendermintRPC) Context { +func (ctx Context) WithClient(client CometRPC) Context { ctx.Client = client return ctx } diff --git a/client/flags/flags.go b/client/flags/flags.go index 3f1a661da5ae..0814f853ee51 100644 --- a/client/flags/flags.go +++ b/client/flags/flags.go @@ -4,7 +4,7 @@ import ( "fmt" "strconv" - tmcli "github.com/cometbft/cometbft/libs/cli" + cmtcli "github.com/cometbft/cometbft/libs/cli" "github.com/spf13/cobra" "github.com/spf13/pflag" @@ -45,7 +45,7 @@ const ( // List of CLI flags const ( - FlagHome = tmcli.HomeFlag + FlagHome = cmtcli.HomeFlag FlagKeyringDir = "keyring-dir" FlagUseLedger = "ledger" FlagChainID = "chain-id" @@ -85,9 +85,9 @@ const ( FlagAux = "aux" // FlagOutput is the flag to set the output format. // This differs from FlagOutputDocument that is used to set the output file. - FlagOutput = tmcli.OutputFlag + FlagOutput = cmtcli.OutputFlag - // Tendermint logging flags + // CometBFT logging flags FlagLogLevel = "log_level" FlagLogFormat = "log_format" ) @@ -98,7 +98,7 @@ var LineBreak = &cobra.Command{Run: func(*cobra.Command, []string) {}} // AddQueryFlagsToCmd adds common flags to a module query command. func AddQueryFlagsToCmd(cmd *cobra.Command) { - cmd.Flags().String(FlagNode, "tcp://localhost:26657", ": to Tendermint RPC interface for this chain") + cmd.Flags().String(FlagNode, "tcp://localhost:26657", ": to CometBFT RPC interface for this chain") cmd.Flags().String(FlagGRPC, "", "the gRPC endpoint to use for this chain") cmd.Flags().Bool(FlagGRPCInsecure, false, "allow gRPC over insecure channels, if not the server must use TLS") cmd.Flags().Int64(FlagHeight, 0, "Use a specific height to query state at (this can error if the node is pruning state)") @@ -119,7 +119,7 @@ func AddTxFlagsToCmd(cmd *cobra.Command) { f.String(FlagNote, "", "Note to add a description to the transaction (previously --memo)") f.String(FlagFees, "", "Fees to pay along with transaction; eg: 10uatom") f.String(FlagGasPrices, "", "Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom)") - f.String(FlagNode, "tcp://localhost:26657", ": to tendermint rpc interface for this chain") + f.String(FlagNode, "tcp://localhost:26657", ": to cometbft rpc interface for this chain") f.Bool(FlagUseLedger, false, "Use a connected Ledger device") f.Float64(FlagGasAdjustment, DefaultGasAdjustment, "adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored ") f.StringP(FlagBroadcastMode, "b", BroadcastSync, "Transaction broadcasting mode (sync|async)") diff --git a/client/grpc/tmservice/block.go b/client/grpc/tmservice/block.go index 2d3d370e70b1..f01f1940e4ee 100644 --- a/client/grpc/tmservice/block.go +++ b/client/grpc/tmservice/block.go @@ -3,7 +3,7 @@ package tmservice import ( "context" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" coretypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cosmos/cosmos-sdk/client" ) @@ -18,14 +18,14 @@ func getBlock(ctx context.Context, clientCtx client.Context, height *int64) (*co return node.Block(ctx, height) } -func GetProtoBlock(ctx context.Context, clientCtx client.Context, height *int64) (tmproto.BlockID, *tmproto.Block, error) { +func GetProtoBlock(ctx context.Context, clientCtx client.Context, height *int64) (cmtproto.BlockID, *cmtproto.Block, error) { block, err := getBlock(ctx, clientCtx, height) if err != nil { - return tmproto.BlockID{}, nil, err + return cmtproto.BlockID{}, nil, err } protoBlock, err := block.Block.ToProto() if err != nil { - return tmproto.BlockID{}, nil, err + return cmtproto.BlockID{}, nil, err } protoBlockID := block.BlockID.ToProto() diff --git a/client/grpc_query_test.go b/client/grpc_query_test.go index dfff4d40d621..fbac5538c49f 100644 --- a/client/grpc_query_test.go +++ b/client/grpc_query_test.go @@ -7,9 +7,9 @@ import ( "cosmossdk.io/depinject" sdkmath "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" - tmjson "github.com/cometbft/cometbft/libs/json" + cmtjson "github.com/cometbft/cometbft/libs/json" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/suite" "google.golang.org/grpc" @@ -73,7 +73,7 @@ func (s *IntegrationTestSuite) SetupSuite() { genesisState, err := sims.GenesisStateWithValSet(cdc, app.DefaultGenesis(), valSet, []authtypes.GenesisAccount{acc}, balance) s.NoError(err) - stateBytes, err := tmjson.MarshalIndent(genesisState, "", " ") + stateBytes, err := cmtjson.MarshalIndent(genesisState, "", " ") s.NoError(err) // init chain will set the validator set and initialize the genesis accounts @@ -86,7 +86,7 @@ func (s *IntegrationTestSuite) SetupSuite() { ) app.Commit() - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{ + app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{ Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash, ValidatorsHash: valSet.Hash(), @@ -95,7 +95,7 @@ func (s *IntegrationTestSuite) SetupSuite() { // end of app init - s.ctx = app.BaseApp.NewContext(false, tmproto.Header{}) + s.ctx = app.BaseApp.NewContext(false, cmtproto.Header{}) queryHelper := baseapp.NewQueryServerTestHelper(s.ctx, interfaceRegistry) types.RegisterQueryServer(queryHelper, bankKeeper) testdata.RegisterQueryServer(queryHelper, testdata.QueryImpl{}) diff --git a/client/keys/add.go b/client/keys/add.go index 2a01e365aea3..a38fa798ca2b 100644 --- a/client/keys/add.go +++ b/client/keys/add.go @@ -251,7 +251,7 @@ func runAddCmd(ctx client.Context, cmd *cobra.Command, args []string, inBuf *buf } if len(mnemonic) == 0 { - // read entropy seed straight from tmcrypto.Rand and convert to mnemonic + // read entropy seed straight from cmtcrypto.Rand and convert to mnemonic entropySeed, err := bip39.NewEntropy(mnemonicEntropySize) if err != nil { return err diff --git a/client/query.go b/client/query.go index 7120704d27a7..7e77e9df53c4 100644 --- a/client/query.go +++ b/client/query.go @@ -6,7 +6,7 @@ import ( "strings" abci "github.com/cometbft/cometbft/abci/types" - tmbytes "github.com/cometbft/cometbft/libs/bytes" + cmtbytes "github.com/cometbft/cometbft/libs/bytes" rpcclient "github.com/cometbft/cometbft/rpc/client" "github.com/pkg/errors" "google.golang.org/grpc/codes" @@ -20,7 +20,7 @@ import ( // GetNode returns an RPC client. If the context's client is not defined, an // error is returned. -func (ctx Context) GetNode() (TendermintRPC, error) { +func (ctx Context) GetNode() (CometRPC, error) { if ctx.Client == nil { return nil, errors.New("no RPC client is defined in offline mode") } @@ -28,28 +28,28 @@ func (ctx Context) GetNode() (TendermintRPC, error) { return ctx.Client, nil } -// Query performs a query to a Tendermint node with the provided path. +// Query performs a query to a CometBFT node with the provided path. // It returns the result and height of the query upon success or an error if // the query fails. func (ctx Context) Query(path string) ([]byte, int64, error) { return ctx.query(path, nil) } -// QueryWithData performs a query to a Tendermint node with the provided path +// QueryWithData performs a query to a CometBFT node with the provided path // and a data payload. It returns the result and height of the query upon success // or an error if the query fails. func (ctx Context) QueryWithData(path string, data []byte) ([]byte, int64, error) { return ctx.query(path, data) } -// QueryStore performs a query to a Tendermint node with the provided key and +// QueryStore performs a query to a CometBFT node with the provided key and // store name. It returns the result and height of the query upon success // or an error if the query fails. -func (ctx Context) QueryStore(key tmbytes.HexBytes, storeName string) ([]byte, int64, error) { +func (ctx Context) QueryStore(key cmtbytes.HexBytes, storeName string) ([]byte, int64, error) { return ctx.queryStore(key, storeName, "key") } -// QueryABCI performs a query to a Tendermint node with the provide RequestQuery. +// QueryABCI performs a query to a CometBFT node with the provide RequestQuery. // It returns the ResultQuery obtained from the query. The height used to perform // the query is the RequestQuery Height if it is non-zero, otherwise the context // height is used. @@ -126,10 +126,10 @@ func sdkErrorToGRPCError(resp abci.ResponseQuery) error { } } -// query performs a query to a Tendermint node with the provided store name +// query performs a query to a CometBFT node with the provided store name // and path. It returns the result and height of the query upon success // or an error if the query fails. -func (ctx Context) query(path string, key tmbytes.HexBytes) ([]byte, int64, error) { +func (ctx Context) query(path string, key cmtbytes.HexBytes) ([]byte, int64, error) { resp, err := ctx.queryABCI(abci.RequestQuery{ Path: path, Data: key, @@ -142,10 +142,10 @@ func (ctx Context) query(path string, key tmbytes.HexBytes) ([]byte, int64, erro return resp.Value, resp.Height, nil } -// queryStore performs a query to a Tendermint node with the provided a store +// queryStore performs a query to a CometBFT node with the provided a store // name and path. It returns the result and height of the query upon success // or an error if the query fails. -func (ctx Context) queryStore(key tmbytes.HexBytes, storeName, endPath string) ([]byte, int64, error) { +func (ctx Context) queryStore(key cmtbytes.HexBytes, storeName, endPath string) ([]byte, int64, error) { path := fmt.Sprintf("/store/%s/%s", storeName, endPath) return ctx.query(path, key) } diff --git a/client/rpc/validators.go b/client/rpc/validators.go index 7eebb7f3ac9f..c1ad49ab06e2 100644 --- a/client/rpc/validators.go +++ b/client/rpc/validators.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" @@ -57,7 +57,7 @@ func ValidatorCommand() *cobra.Command { }, } - cmd.Flags().String(flags.FlagNode, "tcp://localhost:26657", ": to Tendermint RPC interface for this chain") + cmd.Flags().String(flags.FlagNode, "tcp://localhost:26657", ": to CometBFT RPC interface for this chain") cmd.Flags().StringP(flags.FlagOutput, "o", "text", "Output format (text|json)") cmd.Flags().Int(flags.FlagPage, query.DefaultPage, "Query a specific page of paginated results") cmd.Flags().Int(flags.FlagLimit, 100, "Query number of results returned per page") @@ -100,7 +100,7 @@ func (rvo ResultValidatorsOutput) String() string { return b.String() } -func validatorOutput(validator *tmtypes.Validator) (ValidatorOutput, error) { +func validatorOutput(validator *cmttypes.Validator) (ValidatorOutput, error) { pk, err := cryptocodec.FromTmPubKeyInterface(validator.PubKey) if err != nil { return ValidatorOutput{}, err diff --git a/client/v2/go.mod b/client/v2/go.mod index f9cdbf2b7359..fee354602763 100644 --- a/client/v2/go.mod +++ b/client/v2/go.mod @@ -8,11 +8,12 @@ require ( cosmossdk.io/depinject v1.0.0-alpha.3 github.com/cockroachdb/errors v1.9.1 github.com/cosmos/cosmos-proto v1.0.0-beta.1 - github.com/cosmos/cosmos-sdk v0.47.0-rc2 + // TODO to replace by a tagged version of the SDK (with CometBFT) when available + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230205135133-41a3dfeced29 github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 google.golang.org/grpc v1.52.3 - google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a + google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af gotest.tools/v3 v3.4.0 ) @@ -20,7 +21,7 @@ require ( cosmossdk.io/collections v0.0.0-20230204135315-697871069999 // indirect cosmossdk.io/errors v1.0.0-beta.7 // indirect cosmossdk.io/math v1.0.0-beta.6 // indirect - cosmossdk.io/store v0.0.0-20230204135315-697871069999 // indirect + cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -113,6 +114,3 @@ require ( pgregory.net/rapid v0.5.5 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) - -// This can be deleted after the CometBFT PR is merged -replace github.com/cosmos/cosmos-sdk => ../.. diff --git a/client/v2/go.sum b/client/v2/go.sum index 002983c0ddff..c34f6b89e53d 100644 --- a/client/v2/go.sum +++ b/client/v2/go.sum @@ -49,6 +49,8 @@ cosmossdk.io/math v1.0.0-beta.6 h1:WF29SiFYNde5eYvqO2kdOM9nYbDb44j3YW5B8M1m9KE= cosmossdk.io/math v1.0.0-beta.6/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= cosmossdk.io/store v0.0.0-20230204135315-697871069999 h1:NrV990BIbdDngOoTrD3Hg5kqqgvy6c+ETaKGY5bSUmo= cosmossdk.io/store v0.0.0-20230204135315-697871069999/go.mod h1:Sf3G8SV8e8H31CD6w+o2syqCwyaoL0fe244JcPSsaD4= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7/go.mod h1:1XOtuYs7jsfQkn7G3VQXB6I+2tHXKHZw2U/AafNbnlk= cosmossdk.io/x/tx v0.1.0 h1:uyyYVjG22B+jf54N803Z99Y1uPvfuNP3K1YShoCHYL8= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= @@ -134,6 +136,8 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9 github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso= github.com/cosmos/cosmos-proto v1.0.0-beta.1 h1:iDL5qh++NoXxG8hSy93FdYJut4XfgbShIocllGaXx/0= github.com/cosmos/cosmos-proto v1.0.0-beta.1/go.mod h1:8k2GNZghi5sDRFw/scPL8gMSowT1vDA+5ouxL8GjaUE= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230205135133-41a3dfeced29 h1:HJIOs0YfTumgmw8MU1QIiCHO+tz2IWoLpXNOXzLJqnE= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230205135133-41a3dfeced29/go.mod h1:9dul7UbanQCWIiz4b6FZ8QcKKU28EMgvXVNCTcc6Ivk= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -951,6 +955,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a h1:KJVqJe240LvVd+8lfzRx3hQ0UZ0fyeXEMDMHviRNQKs= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af h1:rAgzfIj9FJtmJ6ZPDlxXX6Fzzix6NOpPTvVmPY5rwQg= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/codec/amino.go b/codec/amino.go index 569b4f376667..0986df5e115f 100644 --- a/codec/amino.go +++ b/codec/amino.go @@ -7,7 +7,7 @@ import ( "fmt" "io" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" amino "github.com/tendermint/go-amino" "github.com/cosmos/cosmos-sdk/codec/types" @@ -30,8 +30,8 @@ func NewLegacyAmino() *LegacyAmino { // RegisterEvidences registers Tendermint evidence types with the provided Amino // codec. func RegisterEvidences(cdc *LegacyAmino) { - cdc.Amino.RegisterInterface((*tmtypes.Evidence)(nil), nil) - cdc.Amino.RegisterConcrete(&tmtypes.DuplicateVoteEvidence{}, "tendermint/DuplicateVoteEvidence", nil) + cdc.Amino.RegisterInterface((*cmttypes.Evidence)(nil), nil) + cdc.Amino.RegisterConcrete(&cmttypes.DuplicateVoteEvidence{}, "tendermint/DuplicateVoteEvidence", nil) } // MarshalJSONIndent provides a utility for indented JSON encoding of an object diff --git a/crypto/armor_test.go b/crypto/armor_test.go index bdd7f0d95365..e31a91141792 100644 --- a/crypto/armor_test.go +++ b/crypto/armor_test.go @@ -7,7 +7,7 @@ import ( "io" "testing" - tmcrypto "github.com/cometbft/cometbft/crypto" + cmtcrypto "github.com/cometbft/cometbft/crypto" "github.com/cometbft/cometbft/crypto/xsalsa20symmetric" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -51,10 +51,10 @@ func TestArmorUnarmorPrivKey(t *testing.T) { // armor key manually encryptPrivKeyFn := func(privKey cryptotypes.PrivKey, passphrase string) (saltBytes []byte, encBytes []byte) { - saltBytes = tmcrypto.CRandBytes(16) + saltBytes = cmtcrypto.CRandBytes(16) key, err := bcrypt.GenerateFromPassword(saltBytes, []byte(passphrase), crypto.BcryptSecurityParameter) require.NoError(t, err) - key = tmcrypto.Sha256(key) // get 32 bytes + key = cmtcrypto.Sha256(key) // get 32 bytes privKeyBytes := legacy.Cdc.Amino.MustMarshalBinaryBare(privKey) return saltBytes, xsalsa20symmetric.EncryptSymmetric(privKeyBytes, key) } @@ -173,7 +173,7 @@ func BenchmarkBcryptGenerateFromPassword(b *testing.B) { param := securityParam b.Run(fmt.Sprintf("benchmark-security-param-%d", param), func(b *testing.B) { b.ReportAllocs() - saltBytes := tmcrypto.CRandBytes(16) + saltBytes := cmtcrypto.CRandBytes(16) b.ResetTimer() for i := 0; i < b.N; i++ { _, err := bcrypt.GenerateFromPassword(saltBytes, passphrase, param) diff --git a/crypto/codec/cmt.go b/crypto/codec/cmt.go new file mode 100644 index 000000000000..dfb3fe01cddb --- /dev/null +++ b/crypto/codec/cmt.go @@ -0,0 +1,68 @@ +package codec + +import ( + cmtcrypto "github.com/cometbft/cometbft/crypto" + "github.com/cometbft/cometbft/crypto/encoding" + cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// FromTmProtoPublicKey converts a TM's cmtprotocrypto.PublicKey into our own PubKey. +func FromTmProtoPublicKey(protoPk cmtprotocrypto.PublicKey) (cryptotypes.PubKey, error) { + switch protoPk := protoPk.Sum.(type) { + case *cmtprotocrypto.PublicKey_Ed25519: + return &ed25519.PubKey{ + Key: protoPk.Ed25519, + }, nil + case *cmtprotocrypto.PublicKey_Secp256K1: + return &secp256k1.PubKey{ + Key: protoPk.Secp256K1, + }, nil + default: + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "cannot convert %v from Tendermint public key", protoPk) + } +} + +// ToTmProtoPublicKey converts our own PubKey to TM's cmtprotocrypto.PublicKey. +func ToTmProtoPublicKey(pk cryptotypes.PubKey) (cmtprotocrypto.PublicKey, error) { + switch pk := pk.(type) { + case *ed25519.PubKey: + return cmtprotocrypto.PublicKey{ + Sum: &cmtprotocrypto.PublicKey_Ed25519{ + Ed25519: pk.Key, + }, + }, nil + case *secp256k1.PubKey: + return cmtprotocrypto.PublicKey{ + Sum: &cmtprotocrypto.PublicKey_Secp256K1{ + Secp256K1: pk.Key, + }, + }, nil + default: + return cmtprotocrypto.PublicKey{}, sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "cannot convert %v to Tendermint public key", pk) + } +} + +// FromTmPubKeyInterface converts TM's cmtcrypto.PubKey to our own PubKey. +func FromTmPubKeyInterface(tmPk cmtcrypto.PubKey) (cryptotypes.PubKey, error) { + tmProtoPk, err := encoding.PubKeyToProto(tmPk) + if err != nil { + return nil, err + } + + return FromTmProtoPublicKey(tmProtoPk) +} + +// ToTmPubKeyInterface converts our own PubKey to TM's cmtcrypto.PubKey. +func ToTmPubKeyInterface(pk cryptotypes.PubKey) (cmtcrypto.PubKey, error) { + tmProtoPk, err := ToTmProtoPublicKey(pk) + if err != nil { + return nil, err + } + + return encoding.PubKeyFromProto(tmProtoPk) +} diff --git a/crypto/codec/tm.go b/crypto/codec/tm.go deleted file mode 100644 index 4eb365e91c35..000000000000 --- a/crypto/codec/tm.go +++ /dev/null @@ -1,68 +0,0 @@ -package codec - -import ( - tmcrypto "github.com/cometbft/cometbft/crypto" - "github.com/cometbft/cometbft/crypto/encoding" - tmprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" - - "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -// FromTmProtoPublicKey converts a TM's tmprotocrypto.PublicKey into our own PubKey. -func FromTmProtoPublicKey(protoPk tmprotocrypto.PublicKey) (cryptotypes.PubKey, error) { - switch protoPk := protoPk.Sum.(type) { - case *tmprotocrypto.PublicKey_Ed25519: - return &ed25519.PubKey{ - Key: protoPk.Ed25519, - }, nil - case *tmprotocrypto.PublicKey_Secp256K1: - return &secp256k1.PubKey{ - Key: protoPk.Secp256K1, - }, nil - default: - return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "cannot convert %v from Tendermint public key", protoPk) - } -} - -// ToTmProtoPublicKey converts our own PubKey to TM's tmprotocrypto.PublicKey. -func ToTmProtoPublicKey(pk cryptotypes.PubKey) (tmprotocrypto.PublicKey, error) { - switch pk := pk.(type) { - case *ed25519.PubKey: - return tmprotocrypto.PublicKey{ - Sum: &tmprotocrypto.PublicKey_Ed25519{ - Ed25519: pk.Key, - }, - }, nil - case *secp256k1.PubKey: - return tmprotocrypto.PublicKey{ - Sum: &tmprotocrypto.PublicKey_Secp256K1{ - Secp256K1: pk.Key, - }, - }, nil - default: - return tmprotocrypto.PublicKey{}, sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "cannot convert %v to Tendermint public key", pk) - } -} - -// FromTmPubKeyInterface converts TM's tmcrypto.PubKey to our own PubKey. -func FromTmPubKeyInterface(tmPk tmcrypto.PubKey) (cryptotypes.PubKey, error) { - tmProtoPk, err := encoding.PubKeyToProto(tmPk) - if err != nil { - return nil, err - } - - return FromTmProtoPublicKey(tmProtoPk) -} - -// ToTmPubKeyInterface converts our own PubKey to TM's tmcrypto.PubKey. -func ToTmPubKeyInterface(pk cryptotypes.PubKey) (tmcrypto.PubKey, error) { - tmProtoPk, err := ToTmProtoPublicKey(pk) - if err != nil { - return nil, err - } - - return encoding.PubKeyFromProto(tmProtoPk) -} diff --git a/crypto/keyring/keyring.go b/crypto/keyring/keyring.go index 0910729cbb52..126475b9fb3c 100644 --- a/crypto/keyring/keyring.go +++ b/crypto/keyring/keyring.go @@ -11,7 +11,7 @@ import ( "strings" "github.com/99designs/keyring" - tmcrypto "github.com/cometbft/cometbft/crypto" + cmtcrypto "github.com/cometbft/cometbft/crypto" "github.com/pkg/errors" "github.com/cosmos/cosmos-sdk/client/input" @@ -752,7 +752,7 @@ func newRealPrompt(dir string, buf io.Reader) func(string) (string, error) { continue } - saltBytes := tmcrypto.CRandBytes(16) + saltBytes := cmtcrypto.CRandBytes(16) passwordHash, err := bcrypt.GenerateFromPassword(saltBytes, []byte(pass), 2) if err != nil { fmt.Fprintln(os.Stderr, err) diff --git a/crypto/keys/internal/ecdsa/pubkey.go b/crypto/keys/internal/ecdsa/pubkey.go index 2bdba8456931..93795f0d0077 100644 --- a/crypto/keys/internal/ecdsa/pubkey.go +++ b/crypto/keys/internal/ecdsa/pubkey.go @@ -7,7 +7,7 @@ import ( "fmt" "math/big" - tmcrypto "github.com/cometbft/cometbft/crypto" + cmtcrypto "github.com/cometbft/cometbft/crypto" "github.com/cosmos/cosmos-sdk/types/address" "github.com/cosmos/cosmos-sdk/types/errors" @@ -32,13 +32,13 @@ type PubKey struct { ecdsa.PublicKey // cache - address tmcrypto.Address + address cmtcrypto.Address } // Address gets the address associated with a pubkey. If no address exists, it returns a newly created ADR-28 address // for ECDSA keys. // protoName is a concrete proto structure id. -func (pk *PubKey) Address(protoName string) tmcrypto.Address { +func (pk *PubKey) Address(protoName string) cmtcrypto.Address { if pk.address == nil { pk.address = address.Hash(protoName, pk.Bytes()) } diff --git a/crypto/keys/multisig/multisig.go b/crypto/keys/multisig/multisig.go index 9d4b345a0376..892ae3b7b895 100644 --- a/crypto/keys/multisig/multisig.go +++ b/crypto/keys/multisig/multisig.go @@ -3,7 +3,7 @@ package multisig import ( fmt "fmt" - tmcrypto "github.com/cometbft/cometbft/crypto" + cmtcrypto "github.com/cometbft/cometbft/crypto" "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -36,7 +36,7 @@ func NewLegacyAminoPubKey(threshold int, pubKeys []cryptotypes.PubKey) *LegacyAm // Address implements cryptotypes.PubKey Address method func (m *LegacyAminoPubKey) Address() cryptotypes.Address { - return tmcrypto.AddressHash(m.Bytes()) + return cmtcrypto.AddressHash(m.Bytes()) } // Bytes returns the proto encoded version of the LegacyAminoPubKey diff --git a/crypto/keys/secp256r1/pubkey.go b/crypto/keys/secp256r1/pubkey.go index bf79c33cb9c1..3b02e8b2e7be 100644 --- a/crypto/keys/secp256r1/pubkey.go +++ b/crypto/keys/secp256r1/pubkey.go @@ -1,7 +1,7 @@ package secp256r1 import ( - tmcrypto "github.com/cometbft/cometbft/crypto" + cmtcrypto "github.com/cometbft/cometbft/crypto" "github.com/cosmos/gogoproto/proto" ecdsa "github.com/cosmos/cosmos-sdk/crypto/keys/internal/ecdsa" @@ -31,7 +31,7 @@ func (m *PubKey) Equals(other cryptotypes.PubKey) bool { } // Address implements SDK PubKey interface. -func (m *PubKey) Address() tmcrypto.Address { +func (m *PubKey) Address() cmtcrypto.Address { return m.Key.Address(proto.MessageName(m)) } diff --git a/crypto/ledger/ledger_mock.go b/crypto/ledger/ledger_mock.go index 3333c37255cd..9a6dc0f49620 100644 --- a/crypto/ledger/ledger_mock.go +++ b/crypto/ledger/ledger_mock.go @@ -80,7 +80,7 @@ func (mock LedgerSECP256K1Mock) GetAddressPubKeySECP256K1(derivationPath []uint3 compressedPublicKey := make([]byte, csecp256k1.PubKeySize) copy(compressedPublicKey, cmp.SerializeCompressed()) - // Generate the bech32 addr using existing tmcrypto/etc. + // Generate the bech32 addr using existing cmtcrypto/etc. pub := &csecp256k1.PubKey{Key: compressedPublicKey} addr := sdk.AccAddress(pub.Address()).String() return pk, addr, err diff --git a/crypto/types/compact_bit_array_test.go b/crypto/types/compact_bit_array_test.go index e3e963ffdd88..57b7b3830c1a 100644 --- a/crypto/types/compact_bit_array_test.go +++ b/crypto/types/compact_bit_array_test.go @@ -10,12 +10,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - tmrand "github.com/cometbft/cometbft/libs/rand" + cmtrand "github.com/cometbft/cometbft/libs/rand" ) func randCompactBitArray(bits int) (*CompactBitArray, []byte) { numBytes := (bits + 7) / 8 - src := tmrand.Bytes((bits + 7) / 8) + src := cmtrand.Bytes((bits + 7) / 8) bA := NewCompactBitArray(bits) for i := 0; i < numBytes-1; i++ { diff --git a/crypto/types/types.go b/crypto/types/types.go index 45db5f93c2ca..17d7acc94fd5 100644 --- a/crypto/types/types.go +++ b/crypto/types/types.go @@ -1,7 +1,7 @@ package types import ( - tmcrypto "github.com/cometbft/cometbft/crypto" + cmtcrypto "github.com/cometbft/cometbft/crypto" proto "github.com/cosmos/gogoproto/proto" ) @@ -50,5 +50,5 @@ type PrivKey interface { } type ( - Address = tmcrypto.Address + Address = cmtcrypto.Address ) diff --git a/docs/architecture/adr-016-validator-consensus-key-rotation.md b/docs/architecture/adr-016-validator-consensus-key-rotation.md index 0510c2b9be79..1d91a8de79c2 100644 --- a/docs/architecture/adr-016-validator-consensus-key-rotation.md +++ b/docs/architecture/adr-016-validator-consensus-key-rotation.md @@ -85,12 +85,12 @@ Also, it should be noted that this ADR includes only the simplest form of consen ```go abci.ValidatorUpdate{ - PubKey: tmtypes.TM2PB.PubKey(OldConsPubKey), + PubKey: cmttypes.TM2PB.PubKey(OldConsPubKey), Power: 0, } abci.ValidatorUpdate{ - PubKey: tmtypes.TM2PB.PubKey(NewConsPubKey), + PubKey: cmttypes.TM2PB.PubKey(NewConsPubKey), Power: v.ConsensusPower(), } ``` diff --git a/docs/architecture/adr-032-typed-events.md b/docs/architecture/adr-032-typed-events.md index 1e769f4501c1..c218f9739e54 100644 --- a/docs/architecture/adr-032-typed-events.md +++ b/docs/architecture/adr-032-typed-events.md @@ -109,7 +109,7 @@ func ParseTypedEvent(event abci.Event) (proto.Message, error) { Here, the `EmitTypedEvent` is a method on `EventManager` which takes typed event as input and apply json serialization on it. Then it maps the JSON key/value pairs to `event.Attributes` and emits it in form of `sdk.Event`. `Event.Type` will be the type URL of the proto message. -When we subscribe to emitted events on the tendermint websocket, they are emitted in the form of an `abci.Event`. `ParseTypedEvent` parses the event back to it's original proto message. +When we subscribe to emitted events on the cometbft websocket, they are emitted in the form of an `abci.Event`. `ParseTypedEvent` parses the event back to it's original proto message. **Step-2**: Add proto definitions for typed events for msgs in each module: @@ -209,7 +209,7 @@ func SubmitProposalEventHandler(ev proto.Message) (err error) { // should be implemented somewhere in the Cosmos SDK. The Cosmos SDK can include an EventEmitters for tm.event='Tx' // and/or tm.event='NewBlock' (the new block events may contain typed events) func TxEmitter(ctx context.Context, cliCtx client.Context, ehs ...EventHandler) (err error) { - // Instantiate and start tendermint RPC client + // Instantiate and start CometBFT RPC client client, err := cliCtx.GetNode() if err != nil { return err @@ -260,8 +260,8 @@ func TxEmitter(ctx context.Context, cliCtx client.Context, ehs ...EventHandler) return group.Wait() } -// PublishChainTxEvents events using tmclient. Waits on context shutdown signals to exit. -func PublishChainTxEvents(ctx context.Context, client tmclient.EventsClient, bus pubsub.Bus, mb module.BasicManager) (err error) { +// PublishChainTxEvents events using cmtclient. Waits on context shutdown signals to exit. +func PublishChainTxEvents(ctx context.Context, client cmtclient.EventsClient, bus pubsub.Bus, mb module.BasicManager) (err error) { // Subscribe to transaction events txch, err := client.Subscribe(ctx, "txevents", "tm.event='Tx'", 100) if err != nil { @@ -285,7 +285,7 @@ func PublishChainTxEvents(ctx context.Context, client tmclient.EventsClient, bus break case ed := <-ch: switch evt := ed.Data.(type) { - case tmtypes.EventDataTx: + case cmttypes.EventDataTx: if !evt.Result.IsOK() { continue } diff --git a/go.mod b/go.mod index bdeaa91e3c93..28179089ce20 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/errors v1.0.0-beta.7 cosmossdk.io/math v1.0.0-beta.6 - cosmossdk.io/store v0.0.0-20230204135315-697871069999 + cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 cosmossdk.io/x/tx v0.1.0 github.com/99designs/keyring v1.2.1 github.com/armon/go-metrics v0.4.1 @@ -55,7 +55,7 @@ require ( golang.org/x/exp v0.0.0-20230203172020-98cc5a0785f9 google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 google.golang.org/grpc v1.52.3 - google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a + google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af gotest.tools/v3 v3.4.0 pgregory.net/rapid v0.5.5 sigs.k8s.io/yaml v1.3.0 diff --git a/go.sum b/go.sum index fdc0ca8fd11e..a13a9f9c909c 100644 --- a/go.sum +++ b/go.sum @@ -49,6 +49,8 @@ cosmossdk.io/math v1.0.0-beta.6 h1:WF29SiFYNde5eYvqO2kdOM9nYbDb44j3YW5B8M1m9KE= cosmossdk.io/math v1.0.0-beta.6/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= cosmossdk.io/store v0.0.0-20230204135315-697871069999 h1:NrV990BIbdDngOoTrD3Hg5kqqgvy6c+ETaKGY5bSUmo= cosmossdk.io/store v0.0.0-20230204135315-697871069999/go.mod h1:Sf3G8SV8e8H31CD6w+o2syqCwyaoL0fe244JcPSsaD4= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7/go.mod h1:1XOtuYs7jsfQkn7G3VQXB6I+2tHXKHZw2U/AafNbnlk= cosmossdk.io/x/tx v0.1.0 h1:uyyYVjG22B+jf54N803Z99Y1uPvfuNP3K1YShoCHYL8= cosmossdk.io/x/tx v0.1.0/go.mod h1:qsDv7e1fSftkF16kpSAk+7ROOojyj+SC0Mz3ukI52EQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -1278,6 +1280,8 @@ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a h1:KJVqJe240LvVd+8lfzRx3hQ0UZ0fyeXEMDMHviRNQKs= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af h1:rAgzfIj9FJtmJ6ZPDlxXX6Fzzix6NOpPTvVmPY5rwQg= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/server/api/server.go b/server/api/server.go index 9927574c6f11..364ebf8c7534 100644 --- a/server/api/server.go +++ b/server/api/server.go @@ -93,13 +93,13 @@ func New(clientCtx client.Context, logger log.Logger, grpcSrv *grpc.Server) *Ser func (s *Server) Start(cfg config.Config) error { s.mtx.Lock() - tmCfg := tmrpcserver.DefaultConfig() - tmCfg.MaxOpenConnections = int(cfg.API.MaxOpenConnections) - tmCfg.ReadTimeout = time.Duration(cfg.API.RPCReadTimeout) * time.Second - tmCfg.WriteTimeout = time.Duration(cfg.API.RPCWriteTimeout) * time.Second - tmCfg.MaxBodyBytes = int64(cfg.API.RPCMaxBodyBytes) + cmtCfg := tmrpcserver.DefaultConfig() + cmtCfg.MaxOpenConnections = int(cfg.API.MaxOpenConnections) + cmtCfg.ReadTimeout = time.Duration(cfg.API.RPCReadTimeout) * time.Second + cmtCfg.WriteTimeout = time.Duration(cfg.API.RPCWriteTimeout) * time.Second + cmtCfg.MaxBodyBytes = int64(cfg.API.RPCMaxBodyBytes) - listener, err := tmrpcserver.Listen(cfg.API.Address, tmCfg) + listener, err := tmrpcserver.Listen(cfg.API.Address, cmtCfg) if err != nil { s.mtx.Unlock() return err @@ -137,10 +137,10 @@ func (s *Server) Start(cfg config.Config) error { s.logger.Info("starting API server...") if cfg.API.EnableUnsafeCORS { allowAllCORS := handlers.CORS(handlers.AllowedHeaders([]string{"Content-Type"})) - return tmrpcserver.Serve(s.listener, allowAllCORS(s.Router), s.logger, tmCfg) + return tmrpcserver.Serve(s.listener, allowAllCORS(s.Router), s.logger, cmtCfg) } - return tmrpcserver.Serve(s.listener, s.Router, s.logger, tmCfg) + return tmrpcserver.Serve(s.listener, s.Router, s.logger, cmtCfg) } // Close closes the API server. diff --git a/server/cmd/execute.go b/server/cmd/execute.go index 843cfc0393cb..bc1326893a21 100644 --- a/server/cmd/execute.go +++ b/server/cmd/execute.go @@ -3,8 +3,8 @@ package cmd import ( "context" - tmcfg "github.com/cometbft/cometbft/config" - tmcli "github.com/cometbft/cometbft/libs/cli" + cmtcfg "github.com/cometbft/cometbft/config" + cmtcli "github.com/cometbft/cometbft/libs/cli" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" @@ -20,15 +20,15 @@ func Execute(rootCmd *cobra.Command, envPrefix string, defaultHome string) error // Create and set a client.Context on the command's Context. During the pre-run // of the root command, a default initialized client.Context is provided to // seed child command execution with values such as AccountRetriever, Keyring, - // and a Tendermint RPC. This requires the use of a pointer reference when + // and a CometBFT RPC. This requires the use of a pointer reference when // getting and setting the client.Context. Ideally, we utilize // https://github.com/spf13/cobra/pull/1118. ctx := CreateExecuteContext(context.Background()) - rootCmd.PersistentFlags().String(flags.FlagLogLevel, tmcfg.DefaultLogLevel, "The logging level (trace|debug|info|warn|error|fatal|panic)") - rootCmd.PersistentFlags().String(flags.FlagLogFormat, tmcfg.LogFormatPlain, "The logging format (json|plain)") + rootCmd.PersistentFlags().String(flags.FlagLogLevel, cmtcfg.DefaultLogLevel, "The logging level (trace|debug|info|warn|error|fatal|panic)") + rootCmd.PersistentFlags().String(flags.FlagLogFormat, cmtcfg.LogFormatPlain, "The logging format (json|plain)") - executor := tmcli.PrepareBaseCmd(rootCmd, envPrefix, defaultHome) + executor := cmtcli.PrepareBaseCmd(rootCmd, envPrefix, defaultHome) return executor.ExecuteContext(ctx) } diff --git a/server/tm_cmds.go b/server/cmt_cmds.go similarity index 87% rename from server/tm_cmds.go rename to server/cmt_cmds.go index 1956855910ed..ba7552405d3a 100644 --- a/server/tm_cmds.go +++ b/server/cmt_cmds.go @@ -14,7 +14,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// ShowNodeIDCmd - ported from Tendermint, dump node ID to stdout +// ShowNodeIDCmd - ported from CometBFT, dump node ID to stdout func ShowNodeIDCmd() *cobra.Command { return &cobra.Command{ Use: "show-node-id", @@ -34,11 +34,11 @@ func ShowNodeIDCmd() *cobra.Command { } } -// ShowValidatorCmd - ported from Tendermint, show this node's validator info +// ShowValidatorCmd - ported from CometBFT, show this node's validator info func ShowValidatorCmd() *cobra.Command { cmd := cobra.Command{ Use: "show-validator", - Short: "Show this node's tendermint validator info", + Short: "Show this node's CometBFT validator info", RunE: func(cmd *cobra.Command, args []string) error { serverCtx := GetServerContextFromCmd(cmd) cfg := serverCtx.Config @@ -72,7 +72,7 @@ func ShowValidatorCmd() *cobra.Command { func ShowAddressCmd() *cobra.Command { cmd := &cobra.Command{ Use: "show-address", - Short: "Shows this node's tendermint validator consensus address", + Short: "Shows this node's CometBFT validator consensus address", RunE: func(cmd *cobra.Command, args []string) error { serverCtx := GetServerContextFromCmd(cmd) cfg := serverCtx.Config @@ -88,11 +88,11 @@ func ShowAddressCmd() *cobra.Command { return cmd } -// VersionCmd prints tendermint and ABCI version numbers. +// VersionCmd prints CometBFT and ABCI version numbers. func VersionCmd() *cobra.Command { return &cobra.Command{ Use: "version", - Short: "Print tendermint libraries' version", + Short: "Print CometBFT libraries' version", Long: "Print protocols' and libraries' version numbers against which this app has been compiled.", RunE: func(cmd *cobra.Command, args []string) error { bs, err := yaml.Marshal(&struct { diff --git a/server/config/config.go b/server/config/config.go index 47295f476079..fdb9bd5558c5 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -61,15 +61,15 @@ type BaseConfig struct { // MinRetainBlocks defines the minimum block height offset from the current // block being committed, such that blocks past this offset may be pruned - // from Tendermint. It is used as part of the process of determining the + // from CometBFT. It is used as part of the process of determining the // ResponseCommit.RetainHeight value during ABCI Commit. A value of 0 indicates // that no blocks should be pruned. // - // This configuration value is only responsible for pruning Tendermint blocks. + // This configuration value is only responsible for pruning CometBFT blocks. // It has no bearing on application state pruning which is determined by the // "pruning-*" configurations. // - // Note: Tendermint block pruning is dependant on this parameter in conjunction + // Note: CometBFT block pruning is dependant on this parameter in conjunction // with the unbonding (safety threshold) period, state pruning and state sync // snapshot parameters to determine the correct minimum value of // ResponseCommit.RetainHeight. @@ -79,7 +79,7 @@ type BaseConfig struct { InterBlockCache bool `mapstructure:"inter-block-cache"` // IndexEvents defines the set of events in the form {eventType}.{attributeKey}, - // which informs Tendermint what to index. If empty, all events will be indexed. + // which informs CometBFT what to index. If empty, all events will be indexed. IndexEvents []string `mapstructure:"index-events"` // IavlCacheSize set the size of the iavl tree cache. @@ -92,7 +92,7 @@ type BaseConfig struct { IAVLLazyLoading bool `mapstructure:"iavl-lazy-loading"` // AppDBBackend defines the type of Database to use for the application and snapshots databases. - // An empty string indicates that the Tendermint config's DBBackend value should be used. + // An empty string indicates that the CometBFT config's DBBackend value should be used. AppDBBackend string `mapstructure:"app-db-backend"` } @@ -113,13 +113,13 @@ type APIConfig struct { // MaxOpenConnections defines the number of maximum open connections MaxOpenConnections uint `mapstructure:"max-open-connections"` - // RPCReadTimeout defines the Tendermint RPC read timeout (in seconds) + // RPCReadTimeout defines the CometBFT RPC read timeout (in seconds) RPCReadTimeout uint `mapstructure:"rpc-read-timeout"` - // RPCWriteTimeout defines the Tendermint RPC write timeout (in seconds) + // RPCWriteTimeout defines the CometBFT RPC write timeout (in seconds) RPCWriteTimeout uint `mapstructure:"rpc-write-timeout"` - // RPCMaxBodyBytes defines the Tendermint maximum response body (in bytes) + // RPCMaxBodyBytes defines the CometBFT maximum response body (in bytes) RPCMaxBodyBytes uint `mapstructure:"rpc-max-body-bytes"` // TODO: TLS/Proxy configuration. diff --git a/server/config/toml.go b/server/config/toml.go index 6302def964b0..dff802a3f174 100644 --- a/server/config/toml.go +++ b/server/config/toml.go @@ -46,15 +46,15 @@ halt-time = {{ .BaseConfig.HaltTime }} # MinRetainBlocks defines the minimum block height offset from the current # block being committed, such that all blocks past this offset are pruned -# from Tendermint. It is used as part of the process of determining the +# from CometBFT. It is used as part of the process of determining the # ResponseCommit.RetainHeight value during ABCI Commit. A value of 0 indicates # that no blocks should be pruned. # -# This configuration value is only responsible for pruning Tendermint blocks. +# This configuration value is only responsible for pruning CometBFT blocks. # It has no bearing on application state pruning which is determined by the # "pruning-*" configurations. # -# Note: Tendermint block pruning is dependant on this parameter in conjunction +# Note: CometBFT block pruning is dependant on this parameter in conjunction # with the unbonding (safety threshold) period, state pruning and state sync # snapshot parameters to determine the correct minimum value of # ResponseCommit.RetainHeight. @@ -64,7 +64,7 @@ min-retain-blocks = {{ .BaseConfig.MinRetainBlocks }} inter-block-cache = {{ .BaseConfig.InterBlockCache }} # IndexEvents defines the set of events in the form {eventType}.{attributeKey}, -# which informs Tendermint what to index. If empty, all events will be indexed. +# which informs CometBFT what to index. If empty, all events will be indexed. # # Example: # ["message.sender", "message.recipient"] @@ -84,7 +84,7 @@ iavl-lazy-loading = {{ .BaseConfig.IAVLLazyLoading }} # AppDBBackend defines the database backend type to use for the application and snapshots DBs. # An empty string indicates that a fallback will be used. # First fallback is the deprecated compile-time types.DBBackend value. -# Second fallback (if the types.DBBackend also isn't set), is the db-backend value set in Tendermint's config.toml. +# Second fallback (if the types.DBBackend also isn't set), is the db-backend value set in CometBFT's config.toml. app-db-backend = "{{ .BaseConfig.AppDBBackend }}" ############################################################################### @@ -140,13 +140,13 @@ address = "{{ .API.Address }}" # MaxOpenConnections defines the number of maximum open connections. max-open-connections = {{ .API.MaxOpenConnections }} -# RPCReadTimeout defines the Tendermint RPC read timeout (in seconds). +# RPCReadTimeout defines the CometBFT RPC read timeout (in seconds). rpc-read-timeout = {{ .API.RPCReadTimeout }} -# RPCWriteTimeout defines the Tendermint RPC write timeout (in seconds). +# RPCWriteTimeout defines the CometBFT RPC write timeout (in seconds). rpc-write-timeout = {{ .API.RPCWriteTimeout }} -# RPCMaxBodyBytes defines the Tendermint maximum response body (in bytes). +# RPCMaxBodyBytes defines the CometBFT maximum response body (in bytes). rpc-max-body-bytes = {{ .API.RPCMaxBodyBytes }} # EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). diff --git a/server/export.go b/server/export.go index e66b86931358..a469abe9d3b5 100644 --- a/server/export.go +++ b/server/export.go @@ -4,8 +4,8 @@ import ( "fmt" "os" - tmjson "github.com/cometbft/cometbft/libs/json" - tmtypes "github.com/cometbft/cometbft/types" + cmtjson "github.com/cometbft/cometbft/libs/json" + cmttypes "github.com/cometbft/cometbft/types" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client/flags" @@ -73,7 +73,7 @@ func ExportCmd(appExporter types.AppExporter, defaultNodeHome string) *cobra.Com return fmt.Errorf("error exporting state: %v", err) } - doc, err := tmtypes.GenesisDocFromFile(serverCtx.Config.GenesisFile()) + doc, err := cmttypes.GenesisDocFromFile(serverCtx.Config.GenesisFile()) if err != nil { return err } @@ -81,25 +81,25 @@ func ExportCmd(appExporter types.AppExporter, defaultNodeHome string) *cobra.Com doc.AppState = exported.AppState doc.Validators = exported.Validators doc.InitialHeight = exported.Height - doc.ConsensusParams = &tmtypes.ConsensusParams{ - Block: tmtypes.BlockParams{ + doc.ConsensusParams = &cmttypes.ConsensusParams{ + Block: cmttypes.BlockParams{ MaxBytes: exported.ConsensusParams.Block.MaxBytes, MaxGas: exported.ConsensusParams.Block.MaxGas, }, - Evidence: tmtypes.EvidenceParams{ + Evidence: cmttypes.EvidenceParams{ MaxAgeNumBlocks: exported.ConsensusParams.Evidence.MaxAgeNumBlocks, MaxAgeDuration: exported.ConsensusParams.Evidence.MaxAgeDuration, MaxBytes: exported.ConsensusParams.Evidence.MaxBytes, }, - Validator: tmtypes.ValidatorParams{ + Validator: cmttypes.ValidatorParams{ PubKeyTypes: exported.ConsensusParams.Validator.PubKeyTypes, }, } - // NOTE: Tendermint uses a custom JSON decoder for GenesisDoc + // NOTE: CometBFT uses a custom JSON decoder for GenesisDoc // (except for stuff inside AppState). Inside AppState, we're free // to encode as protobuf or amino. - encoded, err := tmjson.Marshal(doc) + encoded, err := cmtjson.Marshal(doc) if err != nil { return err } @@ -113,8 +113,8 @@ func ExportCmd(appExporter types.AppExporter, defaultNodeHome string) *cobra.Com return nil } - var exportedGenDoc tmtypes.GenesisDoc - if err = tmjson.Unmarshal(out, &exportedGenDoc); err != nil { + var exportedGenDoc cmttypes.GenesisDoc + if err = cmtjson.Unmarshal(out, &exportedGenDoc); err != nil { return err } if err = exportedGenDoc.SaveAs(outputDocument); err != nil { diff --git a/server/mock/app_test.go b/server/mock/app_test.go index 6e96241b0b68..3435fe7ff371 100644 --- a/server/mock/app_test.go +++ b/server/mock/app_test.go @@ -6,7 +6,7 @@ import ( "time" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cometbft/cometbft/types" "github.com/stretchr/testify/require" @@ -58,7 +58,7 @@ func TestDeliverTx(t *testing.T) { tx := NewTx(key, value, randomAccounts[0].Address) txBytes := tx.GetSignBytes() - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{ + app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{ AppHash: []byte("apphash"), Height: 1, }}) diff --git a/server/mock/helpers.go b/server/mock/helpers.go index b367e6d18ac4..2d29bc494e67 100644 --- a/server/mock/helpers.go +++ b/server/mock/helpers.go @@ -6,17 +6,17 @@ import ( "testing" abci "github.com/cometbft/cometbft/abci/types" - tmlog "github.com/cometbft/cometbft/libs/log" + cmtlog "github.com/cometbft/cometbft/libs/log" ) // SetupApp returns an application as well as a clean-up function to be used to // quickly setup a test case with an app. func SetupApp() (abci.Application, func(), error) { - var logger tmlog.Logger + var logger cmtlog.Logger if testing.Verbose() { - logger = tmlog.NewTMLogger(tmlog.NewSyncWriter(os.Stdout)).With("module", "mock") + logger = cmtlog.NewTMLogger(cmtlog.NewSyncWriter(os.Stdout)).With("module", "mock") } else { - logger = tmlog.NewNopLogger() + logger = cmtlog.NewNopLogger() } rootDir, err := os.MkdirTemp("", "mock-sdk") diff --git a/server/rollback.go b/server/rollback.go index 87196b9937ef..36f1ec5c20d6 100644 --- a/server/rollback.go +++ b/server/rollback.go @@ -3,25 +3,25 @@ package server import ( "fmt" - tmcmd "github.com/cometbft/cometbft/cmd/cometbft/commands" + cmtcmd "github.com/cometbft/cometbft/cmd/cometbft/commands" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server/types" "github.com/spf13/cobra" ) -// NewRollbackCmd creates a command to rollback tendermint and multistore state by one height. +// NewRollbackCmd creates a command to rollback CometBFT and multistore state by one height. func NewRollbackCmd(appCreator types.AppCreator, defaultNodeHome string) *cobra.Command { var removeBlock bool cmd := &cobra.Command{ Use: "rollback", - Short: "rollback cosmos-sdk and tendermint state by one height", + Short: "rollback Cosmos SDK and CometBFT state by one height", Long: ` A state rollback is performed to recover from an incorrect application state transition, -when Tendermint has persisted an incorrect app hash and is thus unable to make +when CometBFT has persisted an incorrect app hash and is thus unable to make progress. Rollback overwrites a state at height n with the state at height n - 1. The application also rolls back to height n - 1. No blocks are removed, so upon -restarting Tendermint the transactions in block n will be re-executed against the +restarting CometBFT the transactions in block n will be re-executed against the application. `, RunE: func(cmd *cobra.Command, args []string) error { @@ -33,10 +33,10 @@ application. return err } app := appCreator(ctx.Logger, db, nil, ctx.Viper) - // rollback tendermint state - height, hash, err := tmcmd.RollbackState(ctx.Config, removeBlock) + // rollback CometBFT state + height, hash, err := cmtcmd.RollbackState(ctx.Config, removeBlock) if err != nil { - return fmt.Errorf("failed to rollback tendermint state: %w", err) + return fmt.Errorf("failed to rollback cometbft state: %w", err) } // rollback the multistore diff --git a/server/start.go b/server/start.go index 265271083f94..33679e314da0 100644 --- a/server/start.go +++ b/server/start.go @@ -32,7 +32,7 @@ import ( ) const ( - // Tendermint full-node start flags + // CometBFT full-node start flags flagWithTendermint = "with-tendermint" flagAddress = "address" flagTransport = "transport" @@ -80,13 +80,13 @@ const ( ) // StartCmd runs the service passed in, either stand-alone or in-process with -// Tendermint. +// CometBFT. func StartCmd(appCreator types.AppCreator, defaultNodeHome string) *cobra.Command { cmd := &cobra.Command{ Use: "start", Short: "Run the full node", - Long: `Run the full node application with Tendermint in or out of process. By -default, the application will run with Tendermint in process. + Long: `Run the full node application with CometBFT in or out of process. By +default, the application will run with CometBFT in process. Pruning options can be provided via the '--pruning' flag or alternatively with '--pruning-keep-recent', and 'pruning-interval' together. @@ -108,7 +108,7 @@ For profiling and benchmarking purposes, CPU profiling can be enabled via the '- which accepts a path for the resulting pprof file. The node may be started in a 'query only' mode where only the gRPC and JSON HTTP -API services are enabled via the 'grpc-only' flag. In this mode, Tendermint is +API services are enabled via the 'grpc-only' flag. In this mode, CometBFT is bypassed and can be used when legacy queries are needed after an on-chain upgrade is performed. Note, when enabled, gRPC will also be automatically enabled. `, @@ -133,7 +133,7 @@ is performed. Note, when enabled, gRPC will also be automatically enabled. withTM, _ := cmd.Flags().GetBool(flagWithTendermint) if !withTM { - serverCtx.Logger.Info("starting ABCI without Tendermint") + serverCtx.Logger.Info("starting ABCI without CometBFT") return startStandAlone(serverCtx, appCreator) } @@ -150,7 +150,7 @@ is performed. Note, when enabled, gRPC will also be automatically enabled. } cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory") - cmd.Flags().Bool(flagWithTendermint, true, "Run abci app embedded in-process with tendermint") + cmd.Flags().Bool(flagWithTendermint, true, "Run abci app embedded in-process with CometBFT") cmd.Flags().String(flagAddress, "tcp://0.0.0.0:26658", "Listen address") cmd.Flags().String(flagTransport, "socket", "Transport protocol: socket, grpc") cmd.Flags().String(flagTraceStore, "", "Enable KVStore tracing to an output file") @@ -165,18 +165,18 @@ is performed. Note, when enabled, gRPC will also be automatically enabled. cmd.Flags().Uint64(FlagPruningKeepRecent, 0, "Number of recent heights to keep on disk (ignored if pruning is not 'custom')") cmd.Flags().Uint64(FlagPruningInterval, 0, "Height interval at which pruned heights are removed from disk (ignored if pruning is not 'custom')") cmd.Flags().Uint(FlagInvCheckPeriod, 0, "Assert registered invariants every N blocks") - cmd.Flags().Uint64(FlagMinRetainBlocks, 0, "Minimum block height offset during ABCI commit to prune Tendermint blocks") + cmd.Flags().Uint64(FlagMinRetainBlocks, 0, "Minimum block height offset during ABCI commit to prune CometBFT blocks") cmd.Flags().Bool(FlagAPIEnable, false, "Define if the API server should be enabled") cmd.Flags().Bool(FlagAPISwagger, false, "Define if swagger documentation should automatically be registered (Note: the API must also be enabled)") cmd.Flags().String(FlagAPIAddress, serverconfig.DefaultAPIAddress, "the API server address to listen on") cmd.Flags().Uint(FlagAPIMaxOpenConnections, 1000, "Define the number of maximum open connections") - cmd.Flags().Uint(FlagRPCReadTimeout, 10, "Define the Tendermint RPC read timeout (in seconds)") - cmd.Flags().Uint(FlagRPCWriteTimeout, 0, "Define the Tendermint RPC write timeout (in seconds)") - cmd.Flags().Uint(FlagRPCMaxBodyBytes, 1000000, "Define the Tendermint maximum response body (in bytes)") + cmd.Flags().Uint(FlagRPCReadTimeout, 10, "Define the CometBFT RPC read timeout (in seconds)") + cmd.Flags().Uint(FlagRPCWriteTimeout, 0, "Define the CometBFT RPC write timeout (in seconds)") + cmd.Flags().Uint(FlagRPCMaxBodyBytes, 1000000, "Define the CometBFT maximum response body (in bytes)") cmd.Flags().Bool(FlagAPIEnableUnsafeCORS, false, "Define if CORS should be enabled (unsafe - use it at your own risk)") - cmd.Flags().Bool(flagGRPCOnly, false, "Start the node in gRPC query only mode (no Tendermint process is started)") + cmd.Flags().Bool(flagGRPCOnly, false, "Start the node in gRPC query only mode (no CometBFT process is started)") cmd.Flags().Bool(flagGRPCEnable, true, "Define if the gRPC server should be enabled") cmd.Flags().String(flagGRPCAddress, serverconfig.DefaultGRPCAddress, "the gRPC server address to listen on") @@ -189,7 +189,7 @@ is performed. Note, when enabled, gRPC will also be automatically enabled. cmd.Flags().Int(FlagMempoolMaxTxs, mempool.DefaultMaxTx, "Sets MaxTx value for the app-side mempool") - // add support for all Tendermint-specific command line options + // add support for all CometBFT-specific command line options tcmd.AddNodeFlags(cmd) return cmd } @@ -321,10 +321,10 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App ) if gRPCOnly { - ctx.Logger.Info("starting node in gRPC only mode; Tendermint is disabled") + ctx.Logger.Info("starting node in gRPC only mode; CometBFT is disabled") config.GRPC.Enable = true } else { - ctx.Logger.Info("starting node with ABCI Tendermint in-process") + ctx.Logger.Info("starting node with ABCI CometBFT in-process") tmNode, err = node.NewNode( cfg, @@ -347,7 +347,7 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App // Add the tx service to the gRPC router. We only need to register this // service if API or gRPC is enabled, and avoid doing so in the general - // case, because it spawns a new local tendermint RPC client. + // case, because it spawns a new local CometBFT RPC client. if (config.API.Enable || config.GRPC.Enable) && tmNode != nil { // re-assign for making the client available below // do not use := to avoid shadowing clientCtx @@ -453,7 +453,7 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App } // At this point it is safe to block the process if we're in gRPC only mode as - // we do not need to handle any Tendermint related processes. + // we do not need to handle any CometBFT related processes. if gRPCOnly { // wait for signal capture and gracefully return return WaitForQuitSignals() diff --git a/server/types/app.go b/server/types/app.go index 44e5015ab4b6..42c70fa62041 100644 --- a/server/types/app.go +++ b/server/types/app.go @@ -9,8 +9,8 @@ import ( abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/gogoproto/grpc" "github.com/spf13/cobra" @@ -53,7 +53,7 @@ type ( // simulation, fetching txs by hash...). RegisterTxService(client.Context) - // RegisterTendermintService registers the gRPC Query service for tendermint queries. + // RegisterTendermintService registers the gRPC Query service for CometBFT queries. RegisterTendermintService(client.Context) // RegisterNodeService registers the node gRPC Query service. @@ -76,11 +76,11 @@ type ( // AppState is the application state as JSON. AppState json.RawMessage // Validators is the exported validator set. - Validators []tmtypes.GenesisValidator + Validators []cmttypes.GenesisValidator // Height is the app's latest block height. Height int64 // ConsensusParams are the exported consensus params for ABCI. - ConsensusParams *tmproto.ConsensusParams + ConsensusParams *cmtproto.ConsensusParams } // AppExporter is a function that dumps all app state to diff --git a/server/util.go b/server/util.go index 21b45c7719a5..efabbb3e00de 100644 --- a/server/util.go +++ b/server/util.go @@ -16,11 +16,11 @@ import ( dbm "github.com/cosmos/cosmos-db" - tmcmd "github.com/cometbft/cometbft/cmd/cometbft/commands" - tmcfg "github.com/cometbft/cometbft/config" - tmcli "github.com/cometbft/cometbft/libs/cli" - tmflags "github.com/cometbft/cometbft/libs/cli/flags" - tmlog "github.com/cometbft/cometbft/libs/log" + cmtcmd "github.com/cometbft/cometbft/cmd/cometbft/commands" + cmtcfg "github.com/cometbft/cometbft/config" + cmtcli "github.com/cometbft/cometbft/libs/cli" + cmtflags "github.com/cometbft/cometbft/libs/cli/flags" + cmtlog "github.com/cometbft/cometbft/libs/log" "github.com/spf13/cast" "github.com/spf13/cobra" "github.com/spf13/pflag" @@ -47,8 +47,8 @@ const ServerContextKey = sdk.ContextKey("server.context") // server context type Context struct { Viper *viper.Viper - Config *tmcfg.Config - Logger tmlog.Logger + Config *cmtcfg.Config + Logger cmtlog.Logger } // ErrorCode contains the exit code for server exit. @@ -63,12 +63,12 @@ func (e ErrorCode) Error() string { func NewDefaultContext() *Context { return NewContext( viper.New(), - tmcfg.DefaultConfig(), - tmlog.NewTMLogger(tmlog.NewSyncWriter(os.Stdout)), + cmtcfg.DefaultConfig(), + cmtlog.NewTMLogger(cmtlog.NewSyncWriter(os.Stdout)), ) } -func NewContext(v *viper.Viper, config *tmcfg.Config, logger tmlog.Logger) *Context { +func NewContext(v *viper.Viper, config *cmtcfg.Config, logger cmtlog.Logger) *Context { return &Context{v, config, logger} } @@ -108,15 +108,15 @@ func bindFlags(basename string, cmd *cobra.Command, v *viper.Viper) (err error) // InterceptConfigsPreRunHandler performs a pre-run function for the root daemon // application command. It will create a Viper literal and a default server -// Context. The server Tendermint configuration will either be read and parsed +// Context. The server CometBFT configuration will either be read and parsed // or created and saved to disk, where the server Context is updated to reflect -// the Tendermint configuration. It takes custom app config template and config -// settings to create a custom Tendermint configuration. If the custom template +// the CometBFT configuration. It takes custom app config template and config +// settings to create a custom CometBFT configuration. If the custom template // is empty, it uses default-template provided by the server. The Viper literal // is used to read and parse the application configuration. Command handlers can -// fetch the server Context to get the Tendermint configuration or to get access +// fetch the server Context to get the CometBFT configuration or to get access // to Viper. -func InterceptConfigsPreRunHandler(cmd *cobra.Command, customAppConfigTemplate string, customAppConfig interface{}, tmConfig *tmcfg.Config) error { +func InterceptConfigsPreRunHandler(cmd *cobra.Command, customAppConfigTemplate string, customAppConfig interface{}, cmtConfig *cmtcfg.Config) error { serverCtx := NewDefaultContext() // Get the executable name and configure the viper instance so that environmental @@ -142,32 +142,32 @@ func InterceptConfigsPreRunHandler(cmd *cobra.Command, customAppConfigTemplate s serverCtx.Viper.AutomaticEnv() // intercept configuration files, using both Viper instances separately - config, err := interceptConfigs(serverCtx.Viper, customAppConfigTemplate, customAppConfig, tmConfig) + config, err := interceptConfigs(serverCtx.Viper, customAppConfigTemplate, customAppConfig, cmtConfig) if err != nil { return err } - // return value is a tendermint configuration object + // return value is a CometBFT configuration object serverCtx.Config = config if err = bindFlags(basename, cmd, serverCtx.Viper); err != nil { return err } - var logger tmlog.Logger - if serverCtx.Viper.GetString(flags.FlagLogFormat) == tmcfg.LogFormatJSON { - logger = tmlog.NewTMJSONLogger(tmlog.NewSyncWriter(os.Stdout)) + var logger cmtlog.Logger + if serverCtx.Viper.GetString(flags.FlagLogFormat) == cmtcfg.LogFormatJSON { + logger = cmtlog.NewTMJSONLogger(cmtlog.NewSyncWriter(os.Stdout)) } else { - logger = tmlog.NewTMLogger(tmlog.NewSyncWriter(os.Stdout)) + logger = cmtlog.NewTMLogger(cmtlog.NewSyncWriter(os.Stdout)) } - logger, err = tmflags.ParseLogLevel(config.LogLevel, logger, tmcfg.DefaultLogLevel) + logger, err = cmtflags.ParseLogLevel(config.LogLevel, logger, cmtcfg.DefaultLogLevel) if err != nil { return err } - // Check if the tendermint flag for trace logging is set if it is then setup + // Check if the CometBFT flag for trace logging is set if it is then setup // a tracing logger in this app as well. - if serverCtx.Viper.GetBool(tmcli.TraceFlag) { - logger = tmlog.NewTracingLogger(logger) + if serverCtx.Viper.GetBool(cmtcli.TraceFlag) { + logger = cmtlog.NewTracingLogger(logger) } serverCtx.Logger = logger.With("module", "server") @@ -199,21 +199,21 @@ func SetCmdServerContext(cmd *cobra.Command, serverCtx *Context) error { return nil } -// interceptConfigs parses and updates a Tendermint configuration file or +// interceptConfigs parses and updates a CometBFT configuration file or // creates a new one and saves it. It also parses and saves the application -// configuration file. The Tendermint configuration file is parsed given a root +// configuration file. The CometBFT configuration file is parsed given a root // Viper object, whereas the application is parsed with the private package-aware // viperCfg object. -func interceptConfigs(rootViper *viper.Viper, customAppTemplate string, customConfig interface{}, tmConfig *tmcfg.Config) (*tmcfg.Config, error) { +func interceptConfigs(rootViper *viper.Viper, customAppTemplate string, customConfig interface{}, cmtConfig *cmtcfg.Config) (*cmtcfg.Config, error) { rootDir := rootViper.GetString(flags.FlagHome) configPath := filepath.Join(rootDir, "config") - tmCfgFile := filepath.Join(configPath, "config.toml") + cmtCfgFile := filepath.Join(configPath, "config.toml") - conf := tmConfig + conf := cmtConfig - switch _, err := os.Stat(tmCfgFile); { + switch _, err := os.Stat(cmtCfgFile); { case os.IsNotExist(err): - tmcfg.EnsureRoot(rootDir) + cmtcfg.EnsureRoot(rootDir) if err = conf.ValidateBasic(); err != nil { return nil, fmt.Errorf("error in config file: %w", err) @@ -223,7 +223,7 @@ func interceptConfigs(rootViper *viper.Viper, customAppTemplate string, customCo conf.P2P.RecvRate = 5120000 conf.P2P.SendRate = 5120000 conf.Consensus.TimeoutCommit = 5 * time.Second - tmcfg.WriteConfigFile(tmCfgFile, conf) + cmtcfg.WriteConfigFile(cmtCfgFile, conf) case err != nil: return nil, err @@ -234,7 +234,7 @@ func interceptConfigs(rootViper *viper.Viper, customAppTemplate string, customCo rootViper.AddConfigPath(configPath) if err := rootViper.ReadInConfig(); err != nil { - return nil, fmt.Errorf("failed to read in %s: %w", tmCfgFile, err) + return nil, fmt.Errorf("failed to read in %s: %w", cmtCfgFile, err) } } @@ -280,18 +280,19 @@ func interceptConfigs(rootViper *viper.Viper, customAppTemplate string, customCo // add server commands func AddCommands(rootCmd *cobra.Command, defaultNodeHome string, appCreator types.AppCreator, appExport types.AppExporter, addStartFlags types.ModuleInitFlags) { - tendermintCmd := &cobra.Command{ - Use: "tendermint", - Short: "Tendermint subcommands", + cometCmd := &cobra.Command{ + Use: "comet", + Aliases: []string{"cmt", "cometbft", "tendermint"}, + Short: "CometBFT subcommands", } - tendermintCmd.AddCommand( + cometCmd.AddCommand( ShowNodeIDCmd(), ShowValidatorCmd(), ShowAddressCmd(), VersionCmd(), - tmcmd.ResetAllCmd, - tmcmd.ResetStateCmd, + cmtcmd.ResetAllCmd, + cmtcmd.ResetStateCmd, ) startCmd := StartCmd(appCreator, defaultNodeHome) @@ -299,7 +300,7 @@ func AddCommands(rootCmd *cobra.Command, defaultNodeHome string, appCreator type rootCmd.AddCommand( startCmd, - tendermintCmd, + cometCmd, ExportCmd(appExport, defaultNodeHome), version.NewVersionCommand(), NewRollbackCmd(appCreator, defaultNodeHome), diff --git a/server/util_test.go b/server/util_test.go index 984c4c87fbd2..d8f34487af9d 100644 --- a/server/util_test.go +++ b/server/util_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - tmcfg "github.com/cometbft/cometbft/config" + cmtcfg "github.com/cometbft/cometbft/config" "github.com/spf13/cobra" "github.com/stretchr/testify/require" @@ -30,7 +30,7 @@ var errCanceledInPreRun = errors.New("canceled in prerun") // Used in each test to run the function under test via Cobra // but to always halt the command func preRunETestImpl(cmd *cobra.Command, args []string) error { - err := server.InterceptConfigsPreRunHandler(cmd, "", nil, tmcfg.DefaultConfig()) + err := server.InterceptConfigsPreRunHandler(cmd, "", nil, cmtcfg.DefaultConfig()) if err != nil { return err } @@ -435,7 +435,7 @@ func TestEmptyMinGasPrices(t *testing.T) { // Run StartCmd. cmd = server.StartCmd(nil, tempDir) cmd.PreRunE = func(cmd *cobra.Command, _ []string) error { - return server.InterceptConfigsPreRunHandler(cmd, "", nil, tmcfg.DefaultConfig()) + return server.InterceptConfigsPreRunHandler(cmd, "", nil, cmtcfg.DefaultConfig()) } err = cmd.ExecuteContext(ctx) require.Errorf(t, err, sdkerrors.ErrAppConfig.Error()) diff --git a/simapp/app_test.go b/simapp/app_test.go index 3e3f4f50fa82..d71bf6431f3b 100644 --- a/simapp/app_test.go +++ b/simapp/app_test.go @@ -10,7 +10,7 @@ import ( "cosmossdk.io/x/upgrade" abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" @@ -174,7 +174,7 @@ func TestRunMigrations(t *testing.T) { // version for bank as 1, and for all other modules, we put as // their latest ConsensusVersion. _, err = app.ModuleManager.RunMigrations( - app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}), configurator, + app.NewContext(true, cmtproto.Header{Height: app.LastBlockHeight()}), configurator, module.VersionMap{ "bank": 1, "auth": auth.AppModule{}.ConsensusVersion(), @@ -210,7 +210,7 @@ func TestInitGenesisOnMigration(t *testing.T) { db := dbm.NewMemDB() logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout)) app := NewSimApp(logger, db, nil, true, simtestutil.NewAppOptionsWithFlagHome(t.TempDir())) - ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) + ctx := app.NewContext(true, cmtproto.Header{Height: app.LastBlockHeight()}) // Create a mock module. This module will serve as the new module we're // adding during a migration. @@ -259,7 +259,7 @@ func TestUpgradeStateOnGenesis(t *testing.T) { }) // make sure the upgrade keeper has version map in state - ctx := app.NewContext(false, tmproto.Header{}) + ctx := app.NewContext(false, cmtproto.Header{}) vm := app.UpgradeKeeper.GetModuleVersionMap(ctx) for v, i := range app.ModuleManager.Modules { if i, ok := i.(module.HasConsensusVersion); ok { diff --git a/simapp/export.go b/simapp/export.go index c7554e582911..dc87e718a1a5 100644 --- a/simapp/export.go +++ b/simapp/export.go @@ -5,9 +5,8 @@ import ( "fmt" "log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - storetypes "cosmossdk.io/store/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -20,7 +19,7 @@ import ( // file. func (app *SimApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string) (servertypes.ExportedApp, error) { // as if they could withdraw from the start of the next block - ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) + ctx := app.NewContext(true, cmtproto.Header{Height: app.LastBlockHeight()}) // We export at last height + 1, because that's the height at which // Tendermint will start InitChain. diff --git a/simapp/go.mod b/simapp/go.mod index 6db188592a4c..6d22e668f0a0 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -8,9 +8,10 @@ require ( cosmossdk.io/core v0.5.1 cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/math v1.0.0-beta.6 - cosmossdk.io/store v0.0.0-20230204135315-697871069999 + cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 cosmossdk.io/tools/confix v0.0.0-20230120150717-4f6f6c00021f - cosmossdk.io/tools/rosetta v0.2.0 + // TODO to replace by a tagged version of rosetta + cosmossdk.io/tools/rosetta v0.2.1-0.20230205135133-41a3dfeced29 cosmossdk.io/x/evidence v0.1.0 cosmossdk.io/x/feegrant v0.0.0-20230117113717-50e7c4a4ceff cosmossdk.io/x/nft v0.0.0-20230113085233-fae3332d62fc @@ -25,7 +26,7 @@ require ( github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.15.0 github.com/stretchr/testify v1.8.1 - google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a + google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af ) require ( @@ -186,11 +187,8 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) -// This can be deleted after the CometBFT PR is merged -replace ( - cosmossdk.io/tools/rosetta => ../tools/rosetta - github.com/cometbft/cometbft => github.com/cometbft/cometbft v0.0.0-20230203130311-387422ac220d -) +// TODO update/remove after v0.37.x tag of CometBFT +replace github.com/cometbft/cometbft => github.com/cometbft/cometbft v0.0.0-20230203130311-387422ac220d // TODO tag all extracted modules after SDK refactor replace ( diff --git a/simapp/go.sum b/simapp/go.sum index e1049440e44c..27d1fcc22b93 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -62,8 +62,12 @@ cosmossdk.io/math v1.0.0-beta.6 h1:WF29SiFYNde5eYvqO2kdOM9nYbDb44j3YW5B8M1m9KE= cosmossdk.io/math v1.0.0-beta.6/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= cosmossdk.io/store v0.0.0-20230204135315-697871069999 h1:NrV990BIbdDngOoTrD3Hg5kqqgvy6c+ETaKGY5bSUmo= cosmossdk.io/store v0.0.0-20230204135315-697871069999/go.mod h1:Sf3G8SV8e8H31CD6w+o2syqCwyaoL0fe244JcPSsaD4= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7/go.mod h1:1XOtuYs7jsfQkn7G3VQXB6I+2tHXKHZw2U/AafNbnlk= cosmossdk.io/tools/confix v0.0.0-20230120150717-4f6f6c00021f h1:LMXqH69KBG/R8w18sooHtoUZ0+5hcc99m6OjBiooDAo= cosmossdk.io/tools/confix v0.0.0-20230120150717-4f6f6c00021f/go.mod h1:/apC5+JHM2A72kUY3z+55FWdIn/2ai2mTAYtSBDY4Lo= +cosmossdk.io/tools/rosetta v0.2.1-0.20230205135133-41a3dfeced29 h1:AwJJkPk/jr6DpSzd016AEZX7dT0mUvafpamQ3s6VF1I= +cosmossdk.io/tools/rosetta v0.2.1-0.20230205135133-41a3dfeced29/go.mod h1:jzFZh60Di2rszgQPZhxdbQB6KMEst1kacFDvQDf+O6A= cosmossdk.io/x/tx v0.1.0 h1:uyyYVjG22B+jf54N803Z99Y1uPvfuNP3K1YShoCHYL8= cosmossdk.io/x/tx v0.1.0/go.mod h1:qsDv7e1fSftkF16kpSAk+7ROOojyj+SC0Mz3ukI52EQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -1351,6 +1355,8 @@ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a h1:KJVqJe240LvVd+8lfzRx3hQ0UZ0fyeXEMDMHviRNQKs= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af h1:rAgzfIj9FJtmJ6ZPDlxXX6Fzzix6NOpPTvVmPY5rwQg= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/simapp/sim_bench_test.go b/simapp/sim_bench_test.go index c734402a3e37..0d88c63afe02 100644 --- a/simapp/sim_bench_test.go +++ b/simapp/sim_bench_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/client/flags" @@ -125,7 +125,7 @@ func BenchmarkInvariants(b *testing.B) { simtestutil.PrintStats(db) } - ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight() + 1}) + ctx := app.NewContext(true, cmtproto.Header{Height: app.LastBlockHeight() + 1}) // 3. Benchmark each invariant separately // diff --git a/simapp/sim_test.go b/simapp/sim_test.go index 7c1c495fd80a..57a37c11d88f 100644 --- a/simapp/sim_test.go +++ b/simapp/sim_test.go @@ -12,7 +12,7 @@ import ( evidencetypes "cosmossdk.io/x/evidence/types" abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" @@ -186,8 +186,8 @@ func TestAppImportExport(t *testing.T) { } }() - ctxA := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) - ctxB := newApp.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) + ctxA := app.NewContext(true, cmtproto.Header{Height: app.LastBlockHeight()}) + ctxB := newApp.NewContext(true, cmtproto.Header{Height: app.LastBlockHeight()}) newApp.ModuleManager.InitGenesis(ctxB, app.AppCodec(), genesisState) newApp.StoreConsensusParams(ctxB, exported.ConsensusParams) diff --git a/simapp/simd/cmd/root.go b/simapp/simd/cmd/root.go index 06f98ed06a60..e063023ceb24 100644 --- a/simapp/simd/cmd/root.go +++ b/simapp/simd/cmd/root.go @@ -5,7 +5,7 @@ import ( "io" "os" - tmcfg "github.com/cometbft/cometbft/config" + cmtcfg "github.com/cometbft/cometbft/config" "github.com/cometbft/cometbft/libs/log" dbm "github.com/cosmos/cosmos-db" "github.com/spf13/cobra" @@ -97,9 +97,9 @@ func NewRootCmd() *cobra.Command { } customAppTemplate, customAppConfig := initAppConfig() - customTMConfig := initTendermintConfig() + customCMTConfig := initTendermintConfig() - return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customTMConfig) + return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customCMTConfig) }, } @@ -113,9 +113,9 @@ func NewRootCmd() *cobra.Command { } // initTendermintConfig helps to override default Tendermint Config values. -// return tmcfg.DefaultConfig if no custom configuration is required for the application. -func initTendermintConfig() *tmcfg.Config { - cfg := tmcfg.DefaultConfig() +// return cmtcfg.DefaultConfig if no custom configuration is required for the application. +func initTendermintConfig() *cmtcfg.Config { + cfg := cmtcfg.DefaultConfig() // these values put a higher strain on node memory // cfg.P2P.MaxNumInboundPeers = 100 diff --git a/simapp/simd/cmd/testnet.go b/simapp/simd/cmd/testnet.go index d33f19e0131f..9dd0c00374a1 100644 --- a/simapp/simd/cmd/testnet.go +++ b/simapp/simd/cmd/testnet.go @@ -9,10 +9,10 @@ import ( "os" "path/filepath" - tmconfig "github.com/cometbft/cometbft/config" - tmrand "github.com/cometbft/cometbft/libs/rand" + cmtconfig "github.com/cometbft/cometbft/config" + cmtrand "github.com/cometbft/cometbft/libs/rand" "github.com/cometbft/cometbft/types" - tmtime "github.com/cometbft/cometbft/types/time" + cmttime "github.com/cometbft/cometbft/types/time" "github.com/spf13/cobra" "github.com/spf13/pflag" @@ -110,7 +110,7 @@ func NewTestnetCmd(mbm module.BasicManager, genBalIterator banktypes.GenesisBala return testnetCmd } -// testnetInitFilesCmd returns a cmd to initialize all files for tendermint testnet and application +// testnetInitFilesCmd returns a cmd to initialize all files for CometBFT testnet and application func testnetInitFilesCmd(mbm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator) *cobra.Command { cmd := &cobra.Command{ Use: "init-files", @@ -189,7 +189,7 @@ Example: } addTestnetFlagsToCmd(cmd) - cmd.Flags().Bool(flagEnableLogging, false, "Enable INFO logging of tendermint validator nodes") + cmd.Flags().Bool(flagEnableLogging, false, "Enable INFO logging of CometBFT validator nodes") cmd.Flags().String(flagRPCAddress, "tcp://0.0.0.0:26657", "the RPC address to listen on") cmd.Flags().String(flagAPIAddress, "tcp://0.0.0.0:1317", "the address to listen on for REST API") cmd.Flags().String(flagGRPCAddress, "0.0.0.0:9090", "the gRPC server address to listen on") @@ -203,13 +203,13 @@ const nodeDirPerm = 0o755 func initTestnetFiles( clientCtx client.Context, cmd *cobra.Command, - nodeConfig *tmconfig.Config, + nodeConfig *cmtconfig.Config, mbm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator, args initArgs, ) error { if args.chainID == "" { - args.chainID = "chain-" + tmrand.Str(6) + args.chainID = "chain-" + cmtrand.Str(6) } nodeIDs := make([]string, args.numValidators) valPubKeys := make([]cryptotypes.PubKey, args.numValidators) @@ -408,12 +408,12 @@ func initGenFiles( } func collectGenFiles( - clientCtx client.Context, nodeConfig *tmconfig.Config, chainID string, + clientCtx client.Context, nodeConfig *cmtconfig.Config, chainID string, nodeIDs []string, valPubKeys []cryptotypes.PubKey, numValidators int, outputDir, nodeDirPrefix, nodeDaemonHome string, genBalIterator banktypes.GenesisBalancesIterator, ) error { var appState json.RawMessage - genTime := tmtime.Now() + genTime := cmttime.Now() for i := 0; i < numValidators; i++ { nodeDirName := fmt.Sprintf("%s%d", nodeDirPrefix, i) diff --git a/simapp/state.go b/simapp/state.go index 9f00be61d29c..99e00b7be118 100644 --- a/simapp/state.go +++ b/simapp/state.go @@ -8,8 +8,8 @@ import ( "os" "time" - tmjson "github.com/cometbft/cometbft/libs/json" - tmtypes "github.com/cometbft/cometbft/types" + cmtjson "github.com/cometbft/cometbft/libs/json" + cmttypes "github.com/cometbft/cometbft/types" "cosmossdk.io/math" simappparams "cosmossdk.io/simapp/params" @@ -199,15 +199,15 @@ func AppStateRandomizedFn( // AppStateFromGenesisFileFn util function to generate the genesis AppState // from a genesis.json file. -func AppStateFromGenesisFileFn(r io.Reader, cdc codec.JSONCodec, genesisFile string) (tmtypes.GenesisDoc, []simtypes.Account) { +func AppStateFromGenesisFileFn(r io.Reader, cdc codec.JSONCodec, genesisFile string) (cmttypes.GenesisDoc, []simtypes.Account) { bytes, err := os.ReadFile(genesisFile) if err != nil { panic(err) } - var genesis tmtypes.GenesisDoc - // NOTE: Tendermint uses a custom JSON decoder for GenesisDoc - err = tmjson.Unmarshal(bytes, &genesis) + var genesis cmttypes.GenesisDoc + // NOTE: CometNFT uses a custom JSON decoder for GenesisDoc + err = cmtjson.Unmarshal(bytes, &genesis) if err != nil { panic(err) } @@ -226,8 +226,8 @@ func AppStateFromGenesisFileFn(r io.Reader, cdc codec.JSONCodec, genesisFile str newAccs := make([]simtypes.Account, len(authGenesis.Accounts)) for i, acc := range authGenesis.Accounts { // Pick a random private key, since we don't know the actual key - // This should be fine as it's only used for mock Tendermint validators - // and these keys are never actually used to sign by mock Tendermint. + // This should be fine as it's only used for mock CometBFT validators + // and these keys are never actually used to sign by mock CometBFT. privkeySeed := make([]byte, 15) if _, err := r.Read(privkeySeed); err != nil { panic(err) diff --git a/simapp/test_helpers.go b/simapp/test_helpers.go index 2621e3f0f116..9e0bcebb4b0f 100644 --- a/simapp/test_helpers.go +++ b/simapp/test_helpers.go @@ -8,10 +8,10 @@ import ( sdkmath "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" - tmjson "github.com/cometbft/cometbft/libs/json" + cmtjson "github.com/cometbft/cometbft/libs/json" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttypes "github.com/cometbft/cometbft/types" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" @@ -61,8 +61,8 @@ func NewSimappWithCustomOptions(t *testing.T, isCheckTx bool, options SetupOptio pubKey, err := privVal.GetPubKey() require.NoError(t, err) // create validator set with single validator - validator := tmtypes.NewValidator(pubKey, 1) - valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) + validator := cmttypes.NewValidator(pubKey, 1) + valSet := cmttypes.NewValidatorSet([]*cmttypes.Validator{validator}) // generate genesis account senderPrivKey := secp256k1.GenPrivKey() @@ -79,7 +79,7 @@ func NewSimappWithCustomOptions(t *testing.T, isCheckTx bool, options SetupOptio if !isCheckTx { // init chain must be called to stop deliverState from being nil - stateBytes, err := tmjson.MarshalIndent(genesisState, "", " ") + stateBytes, err := cmtjson.MarshalIndent(genesisState, "", " ") require.NoError(t, err) // Initialize the chain @@ -104,8 +104,8 @@ func Setup(t *testing.T, isCheckTx bool) *SimApp { require.NoError(t, err) // create validator set with single validator - validator := tmtypes.NewValidator(pubKey, 1) - valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) + validator := cmttypes.NewValidator(pubKey, 1) + valSet := cmttypes.NewValidatorSet([]*cmttypes.Validator{validator}) // generate genesis account senderPrivKey := secp256k1.GenPrivKey() @@ -124,7 +124,7 @@ func Setup(t *testing.T, isCheckTx bool) *SimApp { // that also act as delegators. For simplicity, each validator is bonded with a delegation // of one consensus engine unit in the default token of the simapp from first genesis // account. A Nop logger is set in SimApp. -func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *SimApp { +func SetupWithGenesisValSet(t *testing.T, valSet *cmttypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *SimApp { t.Helper() app, genesisState := setup(true, 5) @@ -145,7 +145,7 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs // commit genesis changes app.Commit() - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{ + app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{ Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash, ValidatorsHash: valSet.Hash(), @@ -165,8 +165,8 @@ func GenesisStateWithSingleValidator(t *testing.T, app *SimApp) GenesisState { require.NoError(t, err) // create validator set with single validator - validator := tmtypes.NewValidator(pubKey, 1) - valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) + validator := cmttypes.NewValidator(pubKey, 1) + valSet := cmttypes.NewValidatorSet([]*cmttypes.Validator{validator}) // generate genesis account senderPrivKey := secp256k1.GenPrivKey() diff --git a/store/cachekv/store_test.go b/store/cachekv/store_test.go index 5eea46a34da6..8d4b7f9910f7 100644 --- a/store/cachekv/store_test.go +++ b/store/cachekv/store_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - tmrand "github.com/cometbft/cometbft/libs/rand" + cmtrand "github.com/cometbft/cometbft/libs/rand" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" @@ -461,7 +461,7 @@ const ( ) func randInt(n int) int { - return tmrand.NewRand().Int() % n + return cmtrand.NewRand().Int() % n } // useful for replaying a error case if we find one diff --git a/store/go.mod b/store/go.mod index 256247a3785d..72700aaa7983 100644 --- a/store/go.mod +++ b/store/go.mod @@ -8,7 +8,7 @@ require ( github.com/armon/go-metrics v0.4.1 github.com/cometbft/cometbft v0.0.0-20230202201700-d159562d0d96 github.com/confio/ics23/go v0.9.0 - github.com/cosmos/cosmos-db v0.0.0-20230119180254-161cf3632b7c + github.com/cosmos/cosmos-db v1.0.0-rc.1 github.com/cosmos/gogoproto v1.4.4 github.com/cosmos/iavl v0.20.0-alpha3 github.com/golang/mock v1.6.0 @@ -20,18 +20,18 @@ require ( golang.org/x/exp v0.0.0-20230203172020-98cc5a0785f9 google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa // indirect google.golang.org/grpc v1.52.3 // indirect - google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // indirect + google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a // indirect gotest.tools/v3 v3.4.0 ) require ( - github.com/DataDog/zstd v1.4.5 // indirect - github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect + github.com/DataDog/zstd v1.5.2 // indirect + github.com/beorn7/perks v1.0.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cockroachdb/errors v1.9.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20220817183557-09c6e030a677 // indirect + github.com/cockroachdb/pebble v0.0.0-20230203182935-f2e58dc4a0e1 // indirect github.com/cockroachdb/redact v1.1.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect @@ -44,18 +44,22 @@ require ( github.com/google/btree v1.1.2 // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/klauspost/compress v1.15.14 // indirect + github.com/klauspost/compress v1.15.15 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/linxGnu/grocksdb v1.7.10 // indirect - github.com/nxadm/tail v1.4.8 // indirect + github.com/linxGnu/grocksdb v1.7.14 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/onsi/gomega v1.20.0 // indirect github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v1.14.0 // indirect + github.com/prometheus/client_model v0.3.0 // indirect + github.com/prometheus/common v0.39.0 // indirect + github.com/prometheus/procfs v0.9.0 // indirect github.com/rogpeppe/go-internal v1.9.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect golang.org/x/crypto v0.5.0 // indirect golang.org/x/net v0.5.0 // indirect golang.org/x/sys v0.4.0 // indirect diff --git a/store/go.sum b/store/go.sum index ac7e31565472..066875a5a02d 100644 --- a/store/go.sum +++ b/store/go.sum @@ -3,24 +3,16 @@ cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= cosmossdk.io/math v1.0.0-beta.6 h1:WF29SiFYNde5eYvqO2kdOM9nYbDb44j3YW5B8M1m9KE= cosmossdk.io/math v1.0.0-beta.6/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CloudyKit/fastprinter v0.0.0-20170127035650-74b38d55f37a/go.mod h1:EFZQ978U7x8IRnstaskI3IysnWY5Ao3QgZUKOXlsAdw= github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet v2.1.3-0.20180809161101-62edd43e4f88+incompatible/go.mod h1:HPYO+50pSWkPoj9Q/eq0aRGByCL6ScRlUmiEX5Zgm+w= github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= -github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= -github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= +github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= +github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= -github.com/Joker/jade v1.0.1-0.20190614124447-d475f43051e7/go.mod h1:6E6s8o2AE4KhCrqr6GRJjdC/gNfTdxkIXvuGZZda2VM= github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -31,6 +23,7 @@ github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+ github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= @@ -40,27 +33,24 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cockroachdb/datadriven v1.0.0/go.mod h1:5Ib8Meh+jk1RlHIXej6Pzevx/NLlNvQB9pmSBZErGA4= +github.com/cockroachdb/datadriven v1.0.2 h1:H9MtNqVoVhvd9nCBwOyDjUEdZCREqbIdCJD93PBm/jA= github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -github.com/cockroachdb/errors v1.6.1/go.mod h1:tm6FTP5G81vwJ5lC0SizQo374JNCOPrHyXGitRJoDqM= -github.com/cockroachdb/errors v1.8.1/go.mod h1:qGwQn6JmZ+oMjuLwjWzUNqblqk0xl4CVV3SQbGwK7Ac= github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20220817183557-09c6e030a677 h1:qbb/AE938DFhOajUYh9+OXELpSF9KZw2ZivtmW6eX1Q= -github.com/cockroachdb/pebble v0.0.0-20220817183557-09c6e030a677/go.mod h1:890yq1fUb9b6dGNwssgeUO5vQV9qfXnCPxAJhBQfXw0= -github.com/cockroachdb/redact v1.0.8/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/pebble v0.0.0-20230203182935-f2e58dc4a0e1 h1:g6MDPQ7X2UK1K4cHB5uBguGwudRBoFJ2aeK5DBP0Y8k= +github.com/cockroachdb/pebble v0.0.0-20230203182935-f2e58dc4a0e1/go.mod h1:Nb5lgvnQ2+oGlE/EyZy4+2/CxRh9KfvCXnag1vtpxVM= github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2/go.mod h1:8BT+cPK6xvFOcRlk0R8eg+OTkcqI6baNH4xAkpiYVvQ= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= github.com/cometbft/cometbft v0.0.0-20230203130311-387422ac220d h1:akhMrKe9V6+f+K8Brq3Cx+I2kRIizVsnU6+frARVTzo= github.com/cometbft/cometbft v0.0.0-20230203130311-387422ac220d/go.mod h1:EZUXFIzOBV/rscOektBL3X4FI5zHpu7tQMNNMwzv4ac= @@ -69,8 +59,8 @@ github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/cosmos/cosmos-db v0.0.0-20230119180254-161cf3632b7c h1:18vrPZBG4Zuh8A/sD5hFu252QLLgwdQ6mTsc8pT56QU= -github.com/cosmos/cosmos-db v0.0.0-20230119180254-161cf3632b7c/go.mod h1:NoM5UQkpKJY86c0Acb8Hy7HyNrltal8+BxQyerU8fzM= +github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9HD3nmY= +github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso= github.com/cosmos/gogoproto v1.4.4 h1:nVAsgLlAf5jeN0fV7hRlkZvf768zU+dy4pG+hxc2P34= github.com/cosmos/gogoproto v1.4.4/go.mod h1:/yl6/nLwsZcZ2JY3OrqjRqvqCG9InUMcXRfRjQiF9DU= github.com/cosmos/iavl v0.20.0-alpha3 h1:hbUyr0dkiGDlmmbrArvte0lXv6VkMrGQNr3b29xvmVk= @@ -84,37 +74,31 @@ github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4/go.mod h1:T9YF2M40nIgbVgp3rreNmTged+9HrbNTIQf1PsaIiTA= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= github.com/getsentry/sentry-go v0.17.0 h1:UustVWnOoDFHBS7IJUB2QK/nB5pap748ZEp0swnQJak= github.com/getsentry/sentry-go v0.17.0/go.mod h1:B82dxtBvxG0KaPD8/hfSV+VcHD+Lg/xUS4JuQn1P4cM= -github.com/ghemawat/stream v0.0.0-20171120220530-696b145b53b9/go.mod h1:106OIgooyS7OzLDOpUGgm9fA3bQENb/cFSyyBmMoJDs= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= @@ -129,6 +113,7 @@ github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= @@ -137,12 +122,10 @@ github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q8 github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= @@ -150,7 +133,7 @@ github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+Licev github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -161,7 +144,6 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= @@ -172,15 +154,14 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -190,19 +171,17 @@ github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es github.com/hashicorp/go-uuid v1.0.0 h1:RS8zrF7PhGwyNPOtxSClXXj9HA8feRnJzgnI1RJCSnM= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/hydrogen18/memlistener v0.0.0-20141126152155-54553eb933fb/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/i18n v0.0.0-20171121225848-987a633949d0/go.mod h1:pMCz62A0xJL6I+umB2YTlFRwWXaDFA0jy+5HzGiJjqI= github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= @@ -210,30 +189,19 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= -github.com/juju/loggo v0.0.0-20180524022052-584905176618/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= -github.com/juju/testing v0.0.0-20180920084828-472a3e8b2073/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.9/go.mod h1:12HJgwBIZFNGL0EJnMRhmvGA0PQGx8VFwrZtM4CqbAk= github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.0.1/go.mod h1:udK4vLQKkdDqMGJJVd/msuMtN6hpYJhg/lSzuxjhO+U= github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.10/go.mod h1:ZYmJC07hQPW67eKuzlfY7SO3bC0mw83A3j6im82hfqw= github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.0-20190103105442-ea782b38602d/go.mod h1:NV88laa9UiiDuX9AhMbDPkGYSPugBOV6yTZB1l2K9Z0= github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.15.14 h1:i7WCKDToww0wA+9qrUZ1xOjp218vfFo3nTU6UHp+gOc= -github.com/klauspost/compress v1.15.14/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= +github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= +github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -246,12 +214,11 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g= github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -github.com/linxGnu/grocksdb v1.7.10 h1:dz7RY7GnFUA+GJO6jodyxgkUeGMEkPp3ikt9hAcNGEw= -github.com/linxGnu/grocksdb v1.7.10/go.mod h1:0hTf+iA+GOr0jDX4CgIYyJZxqOH9XlBh6KVj8+zmF34= +github.com/linxGnu/grocksdb v1.7.14 h1:8lMZzyWeNP5lI0BIppX05DzmQzXj/Tgu82bgWYtowLY= +github.com/linxGnu/grocksdb v1.7.14/go.mod h1:pY55D0o+r8yUYLq70QmhdudxYvoDb9F+9puf4m3/W+U= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -262,8 +229,8 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mediocregopher/mediocre-go-lib v0.0.0-20181029021733-cb65787f37ed/go.mod h1:dSsfyI2zABAdhcbvkXqgxOxrCsbYeHCPgrZkku60dSg= -github.com/mediocregopher/radix/v3 v3.3.0/go.mod h1:EmfVyvspXz1uZEyPBMyGK+kjWiKQGvsUt6O3Pj+LDCQ= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -276,23 +243,23 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/nats.go v1.8.1/go.mod h1:BrFz9vVn0fU3AcH9Vn4Kd7W0NpJ651tD5omQ3M8LwxM= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.0.2/go.mod h1:dab7URMsZm6Z/jp9Z5UGa87Uutgc2mVpXLC4B7TDb/4= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= @@ -313,15 +280,23 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= +github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/common v0.39.0 h1:oOyhkDq05hPZKItWVBkJ6g6AtGxi+fy7F4JvUV8uhsI= +github.com/prometheus/common v0.39.0/go.mod h1:6XBZ7lYdLCbkAVhwRsWTZn+IN5AB9F/NXd5w0BbEX0Y= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= +github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= @@ -332,9 +307,7 @@ github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFo github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= -github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -359,11 +332,12 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= +github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= +github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= @@ -392,7 +366,6 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -402,26 +375,14 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= -golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20200513190911-00229845015e/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= golang.org/x/exp v0.0.0-20230203172020-98cc5a0785f9 h1:frX3nT9RkKybPnjyI+yvZh6ZucTZatCCEm9D47sZ2zo= golang.org/x/exp v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -440,11 +401,13 @@ golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -456,7 +419,7 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde h1:ejfdSekXMDxDLbRrJMwUk6KnSLZ2McaUCVcIKM+N6jc= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -464,23 +427,21 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -489,14 +450,17 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210909193231-528a39cd75f3/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -506,22 +470,18 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= @@ -530,11 +490,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= -gonum.org/v1/gonum v0.11.0 h1:f1IJhK4Km5tBJmaiJXtk/PkL4cdVX6J+tGiM187uT5E= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -549,7 +505,6 @@ google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZi google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.52.3 h1:pf7sOysg4LdgBqduXveGKrcEwbStiK2rtfghdzlUYDQ= google.golang.org/grpc v1.52.3/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= @@ -565,13 +520,12 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 h1:KR8+MyP7/qOlV+8Af01LtjL04bu7on42eVsxT4EyBQk= -google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a h1:KJVqJe240LvVd+8lfzRx3hQ0UZ0fyeXEMDMHviRNQKs= +google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= @@ -596,5 +550,4 @@ gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= diff --git a/store/iavl/store.go b/store/iavl/store.go index 047617a33863..f2c219268347 100644 --- a/store/iavl/store.go +++ b/store/iavl/store.go @@ -7,7 +7,7 @@ import ( abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/libs/log" - tmcrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" ics23 "github.com/confio/ics23/go" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/iavl" @@ -396,7 +396,7 @@ func (st *Store) Query(req abci.RequestQuery) (res abci.ResponseQuery) { // Takes a MutableTree, a key, and a flag for creating existence or absence proof and returns the // appropriate merkle.Proof. Since this must be called after querying for the value, this function should never error // Thus, it will panic on error rather than returning it -func getProofFromTree(tree *iavl.MutableTree, key []byte, exists bool) *tmcrypto.ProofOps { +func getProofFromTree(tree *iavl.MutableTree, key []byte, exists bool) *cmtprotocrypto.ProofOps { var ( commitmentProof *ics23.CommitmentProof err error @@ -419,5 +419,5 @@ func getProofFromTree(tree *iavl.MutableTree, key []byte, exists bool) *tmcrypto } op := types.NewIavlCommitmentOp(key, commitmentProof) - return &tmcrypto.ProofOps{Ops: []tmcrypto.ProofOp{op.ProofOp()}} + return &cmtprotocrypto.ProofOps{Ops: []cmtprotocrypto.ProofOp{op.ProofOp()}} } diff --git a/store/internal/maps/maps.go b/store/internal/maps/maps.go index 6e7b9e0cd826..eaf0c58c8915 100644 --- a/store/internal/maps/maps.go +++ b/store/internal/maps/maps.go @@ -5,7 +5,7 @@ import ( "github.com/cometbft/cometbft/crypto/merkle" "github.com/cometbft/cometbft/crypto/tmhash" - tmcrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" "cosmossdk.io/store/internal/kv" ) @@ -183,7 +183,7 @@ func HashFromMap(m map[string][]byte) []byte { // ProofsFromMap generates proofs from a map. The keys/values of the map will be used as the keys/values // in the underlying key-value pairs. // The keys are sorted before the proofs are computed. -func ProofsFromMap(m map[string][]byte) ([]byte, map[string]*tmcrypto.Proof, []string) { +func ProofsFromMap(m map[string][]byte) ([]byte, map[string]*cmtprotocrypto.Proof, []string) { sm := newSimpleMap() for k, v := range m { sm.Set(k, v) @@ -197,7 +197,7 @@ func ProofsFromMap(m map[string][]byte) ([]byte, map[string]*tmcrypto.Proof, []s } rootHash, proofList := merkle.ProofsFromByteSlices(kvsBytes) - proofs := make(map[string]*tmcrypto.Proof) + proofs := make(map[string]*cmtprotocrypto.Proof) keys := make([]string, len(proofList)) for i, kvp := range kvs.Pairs { diff --git a/store/internal/proofs/convert.go b/store/internal/proofs/convert.go index f6b213fb9bf9..49ca55e1cadc 100644 --- a/store/internal/proofs/convert.go +++ b/store/internal/proofs/convert.go @@ -4,7 +4,7 @@ import ( "fmt" "math/bits" - "github.com/cometbft/cometbft/proto/tendermint/crypto" + cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" ics23 "github.com/confio/ics23/go" ) @@ -13,7 +13,7 @@ import ( // // This is the simplest case of the range proof and we will focus on // demoing compatibility here -func ConvertExistenceProof(p *crypto.Proof, key, value []byte) (*ics23.ExistenceProof, error) { +func ConvertExistenceProof(p *cmtprotocrypto.Proof, key, value []byte) (*ics23.ExistenceProof, error) { path, err := convertInnerOps(p) if err != nil { return nil, err @@ -42,7 +42,7 @@ func convertLeafOp() *ics23.LeafOp { } } -func convertInnerOps(p *crypto.Proof) ([]*ics23.InnerOp, error) { +func convertInnerOps(p *cmtprotocrypto.Proof) ([]*ics23.InnerOp, error) { inners := make([]*ics23.InnerOp, 0, len(p.Aunts)) path := buildPath(p.Index, p.Total) diff --git a/store/internal/proofs/helpers.go b/store/internal/proofs/helpers.go index a63182e67a21..0fd0836155b0 100644 --- a/store/internal/proofs/helpers.go +++ b/store/internal/proofs/helpers.go @@ -4,7 +4,7 @@ import ( "sort" "github.com/cometbft/cometbft/libs/rand" - tmcrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" "golang.org/x/exp/maps" sdkmaps "cosmossdk.io/store/internal/maps" @@ -14,7 +14,7 @@ import ( type SimpleResult struct { Key []byte Value []byte - Proof *tmcrypto.Proof + Proof *cmtprotocrypto.Proof RootHash []byte } diff --git a/store/snapshots/manager.go b/store/snapshots/manager.go index 842cab8d3918..06b43663441e 100644 --- a/store/snapshots/manager.go +++ b/store/snapshots/manager.go @@ -26,7 +26,7 @@ import ( // // 1. In the future, ABCI should support streaming. Consider e.g. InitChain during chain // upgrades, which currently passes the entire chain state as an in-memory byte slice. -// https://github.com/cometbft/cometbft/issues/5184 +// https://github.com/tendermint/tendermint/issues/5184 // // 2. io.ReadCloser streams automatically propagate IO errors, and can pass arbitrary // errors via io.Pipe.CloseWithError(). diff --git a/store/streaming/file/service_test.go b/store/streaming/file/service_test.go index 42c1c5cb53c5..ff901dc8e6c8 100644 --- a/store/streaming/file/service_test.go +++ b/store/streaming/file/service_test.go @@ -12,7 +12,7 @@ import ( abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" "cosmossdk.io/store/types" @@ -27,7 +27,7 @@ var ( // test abci message types mockHash = []byte{1, 2, 3, 4, 5, 6, 7, 8, 9} testBeginBlockReq = abci.RequestBeginBlock{ - Header: tmproto.Header{ + Header: cmtproto.Header{ Height: 1, }, ByzantineValidators: []abci.Misbehavior{}, @@ -52,7 +52,7 @@ var ( } testEndBlockRes = abci.ResponseEndBlock{ Events: []abci.Event{}, - ConsensusParamUpdates: &tmproto.ConsensusParams{}, + ConsensusParamUpdates: &cmtproto.ConsensusParams{}, ValidatorUpdates: []abci.ValidatorUpdate{}, } testCommitRes = abci.ResponseCommit{ diff --git a/store/types/commit_info.go b/store/types/commit_info.go index 414210cbd378..125111a0c228 100644 --- a/store/types/commit_info.go +++ b/store/types/commit_info.go @@ -1,9 +1,9 @@ package types import ( - tmcrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" - sdkmaps "cosmossdk.io/store/internal/maps" + "cosmossdk.io/store/internal/maps" ) // GetHash returns the GetHash from the CommitID. @@ -33,11 +33,11 @@ func (ci CommitInfo) Hash() []byte { return nil } - rootHash, _, _ := sdkmaps.ProofsFromMap(ci.toMap()) + rootHash, _, _ := maps.ProofsFromMap(ci.toMap()) return rootHash } -func (ci CommitInfo) ProofOp(storeName string) tmcrypto.ProofOp { +func (ci CommitInfo) ProofOp(storeName string) cmtprotocrypto.ProofOp { ret, err := ProofOpFromMap(ci.toMap(), storeName) if err != nil { panic(err) diff --git a/store/types/proof.go b/store/types/proof.go index 186be32e8881..a63c99a75a2c 100644 --- a/store/types/proof.go +++ b/store/types/proof.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/cometbft/cometbft/crypto/merkle" - tmmerkle "github.com/cometbft/cometbft/proto/tendermint/crypto" + cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" ics23 "github.com/confio/ics23/go" sdkerrors "cosmossdk.io/errors" @@ -63,7 +63,7 @@ func NewSmtCommitmentOp(key []byte, proof *ics23.CommitmentProof) CommitmentOp { // CommitmentOpDecoder takes a merkle.ProofOp and attempts to decode it into a CommitmentOp ProofOperator // The proofOp.Data is just a marshalled CommitmentProof. The Key of the CommitmentOp is extracted // from the unmarshalled proof. -func CommitmentOpDecoder(pop tmmerkle.ProofOp) (merkle.ProofOperator, error) { +func CommitmentOpDecoder(pop cmtprotocrypto.ProofOp) (merkle.ProofOperator, error) { var spec *ics23.ProofSpec switch pop.Type { case ProofOpIAVLCommitment: @@ -134,12 +134,12 @@ func (op CommitmentOp) Run(args [][]byte) ([][]byte, error) { // ProofOp implements ProofOperator interface and converts a CommitmentOp // into a merkle.ProofOp format that can later be decoded by CommitmentOpDecoder // back into a CommitmentOp for proof verification -func (op CommitmentOp) ProofOp() tmmerkle.ProofOp { +func (op CommitmentOp) ProofOp() cmtprotocrypto.ProofOp { bz, err := op.Proof.Marshal() if err != nil { panic(err.Error()) } - return tmmerkle.ProofOp{ + return cmtprotocrypto.ProofOp{ Type: op.Type, Key: op.Key, Data: bz, @@ -147,7 +147,7 @@ func (op CommitmentOp) ProofOp() tmmerkle.ProofOp { } // ProofOpFromMap generates a single proof from a map and converts it to a ProofOp. -func ProofOpFromMap(cmap map[string][]byte, storeName string) (ret tmmerkle.ProofOp, err error) { +func ProofOpFromMap(cmap map[string][]byte, storeName string) (ret cmtprotocrypto.ProofOp, err error) { _, proofs, _ := sdkmaps.ProofsFromMap(cmap) proof := proofs[storeName] diff --git a/tests/e2e/auth/suite.go b/tests/e2e/auth/suite.go index 55522a993b36..68fa6ff59a8f 100644 --- a/tests/e2e/auth/suite.go +++ b/tests/e2e/auth/suite.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - tmcli "github.com/cometbft/cometbft/libs/cli" + cmtcli "github.com/cometbft/cometbft/libs/cli" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -223,7 +223,7 @@ func (s *E2ETestSuite) TestCLISignGenOnly() { for _, tc := range cases { cmd := authcli.GetSignCommand() - tmcli.PrepareBaseCmd(cmd, "", "") + cmtcli.PrepareBaseCmd(cmd, "", "") out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) if tc.expErr { s.Require().Error(err) diff --git a/tests/e2e/server/export_test.go b/tests/e2e/server/export_test.go index 7e39506e48da..2ae64febcd5a 100644 --- a/tests/e2e/server/export_test.go +++ b/tests/e2e/server/export_test.go @@ -16,10 +16,10 @@ import ( "github.com/stretchr/testify/require" abci "github.com/cometbft/cometbft/abci/types" - tmjson "github.com/cometbft/cometbft/libs/json" + cmtjson "github.com/cometbft/cometbft/libs/json" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttypes "github.com/cometbft/cometbft/types" dbm "github.com/cosmos/cosmos-db" "cosmossdk.io/simapp" @@ -42,8 +42,8 @@ func TestExportCmd_ConsensusParams(t *testing.T) { cmd.SetArgs([]string{fmt.Sprintf("--%s=%s", flags.FlagHome, tempDir)}) require.NoError(t, cmd.ExecuteContext(ctx)) - var exportedGenDoc tmtypes.GenesisDoc - err := tmjson.Unmarshal(output.Bytes(), &exportedGenDoc) + var exportedGenDoc cmttypes.GenesisDoc + err := cmtjson.Unmarshal(output.Bytes(), &exportedGenDoc) if err != nil { t.Fatalf("error unmarshaling exported genesis doc: %s", err) } @@ -101,7 +101,7 @@ func TestExportCmd_Height(t *testing.T) { // Fast forward to block `tc.fastForward`. for i := int64(2); i <= tc.fastForward; i++ { - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: i}}) + app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: i}}) app.Commit() } @@ -111,8 +111,8 @@ func TestExportCmd_Height(t *testing.T) { cmd.SetArgs(args) require.NoError(t, cmd.ExecuteContext(ctx)) - var exportedGenDoc tmtypes.GenesisDoc - err := tmjson.Unmarshal(output.Bytes(), &exportedGenDoc) + var exportedGenDoc cmttypes.GenesisDoc + err := cmtjson.Unmarshal(output.Bytes(), &exportedGenDoc) if err != nil { t.Fatalf("error unmarshaling exported genesis doc: %s", err) } @@ -148,12 +148,12 @@ func TestExportCmd_Output(t *testing.T) { cmd.SetArgs(args) require.NoError(t, cmd.ExecuteContext(ctx)) - var exportedGenDoc tmtypes.GenesisDoc + var exportedGenDoc cmttypes.GenesisDoc f, err := os.ReadFile(tc.outputDocument) if err != nil { t.Fatalf("error reading exported genesis doc: %s", err) } - require.NoError(t, tmjson.Unmarshal(f, &exportedGenDoc)) + require.NoError(t, cmtjson.Unmarshal(f, &exportedGenDoc)) // Cleanup if err = os.Remove(tc.outputDocument); err != nil { @@ -163,7 +163,7 @@ func TestExportCmd_Output(t *testing.T) { } } -func setupApp(t *testing.T, tempDir string) (*simapp.SimApp, context.Context, *tmtypes.GenesisDoc, *cobra.Command) { +func setupApp(t *testing.T, tempDir string) (*simapp.SimApp, context.Context, *cmttypes.GenesisDoc, *cobra.Command) { t.Helper() if err := createConfigFolder(tempDir); err != nil { @@ -175,14 +175,14 @@ func setupApp(t *testing.T, tempDir string) (*simapp.SimApp, context.Context, *t app := simapp.NewSimApp(logger, db, nil, true, simtestutil.NewAppOptionsWithFlagHome(tempDir)) genesisState := simapp.GenesisStateWithSingleValidator(t, app) - stateBytes, err := tmjson.MarshalIndent(genesisState, "", " ") + stateBytes, err := cmtjson.MarshalIndent(genesisState, "", " ") require.NoError(t, err) serverCtx := server.NewDefaultContext() serverCtx.Config.RootDir = tempDir clientCtx := client.Context{}.WithCodec(app.AppCodec()) - genDoc := &tmtypes.GenesisDoc{} + genDoc := &cmttypes.GenesisDoc{} genDoc.ChainID = "theChainId" genDoc.Validators = nil genDoc.AppState = stateBytes @@ -224,7 +224,7 @@ func createConfigFolder(dir string) error { return os.Mkdir(path.Join(dir, "config"), 0o700) } -func saveGenesisFile(genDoc *tmtypes.GenesisDoc, dir string) error { +func saveGenesisFile(genDoc *cmttypes.GenesisDoc, dir string) error { err := genutil.ExportGenesisFile(genDoc, dir) if err != nil { return errors.Wrap(err, "error creating file") diff --git a/tests/e2e/upgrade/cli_test.go b/tests/e2e/upgrade/cli_test.go index a17aaad40bd2..7903aa305f34 100644 --- a/tests/e2e/upgrade/cli_test.go +++ b/tests/e2e/upgrade/cli_test.go @@ -6,7 +6,7 @@ package upgrade import ( "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/suite" "cosmossdk.io/simapp" @@ -18,7 +18,7 @@ func TestE2ETestSuite(t *testing.T) { cfg.NumValidators = 1 app := simapp.Setup(t, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) app.UpgradeKeeper.SetVersionSetter(app.BaseApp) app.UpgradeKeeper.SetModuleVersionMap(ctx, app.ModuleManager.GetVersionMap()) diff --git a/tests/go.mod b/tests/go.mod index 5fb338b2fae4..62d99678f024 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -7,7 +7,7 @@ require ( cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/math v1.0.0-beta.6 cosmossdk.io/simapp v0.0.0-00010101000000-000000000000 - cosmossdk.io/store v0.0.0-20230204135315-697871069999 + cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 cosmossdk.io/x/evidence v0.1.0 cosmossdk.io/x/feegrant v0.0.0-20230117113717-50e7c4a4ceff cosmossdk.io/x/nft v0.0.0-20230113085233-fae3332d62fc @@ -21,7 +21,7 @@ require ( github.com/google/uuid v1.3.0 github.com/spf13/cobra v1.6.1 github.com/stretchr/testify v1.8.1 - google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a + google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af gotest.tools/v3 v3.4.0 pgregory.net/rapid v0.5.5 ) diff --git a/tests/go.sum b/tests/go.sum index 40a74c35fa73..3240a1f3a306 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -62,6 +62,8 @@ cosmossdk.io/math v1.0.0-beta.6 h1:WF29SiFYNde5eYvqO2kdOM9nYbDb44j3YW5B8M1m9KE= cosmossdk.io/math v1.0.0-beta.6/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= cosmossdk.io/store v0.0.0-20230204135315-697871069999 h1:NrV990BIbdDngOoTrD3Hg5kqqgvy6c+ETaKGY5bSUmo= cosmossdk.io/store v0.0.0-20230204135315-697871069999/go.mod h1:Sf3G8SV8e8H31CD6w+o2syqCwyaoL0fe244JcPSsaD4= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7/go.mod h1:1XOtuYs7jsfQkn7G3VQXB6I+2tHXKHZw2U/AafNbnlk= cosmossdk.io/x/tx v0.1.0 h1:uyyYVjG22B+jf54N803Z99Y1uPvfuNP3K1YShoCHYL8= cosmossdk.io/x/tx v0.1.0/go.mod h1:qsDv7e1fSftkF16kpSAk+7ROOojyj+SC0Mz3ukI52EQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -1332,6 +1334,8 @@ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a h1:KJVqJe240LvVd+8lfzRx3hQ0UZ0fyeXEMDMHviRNQKs= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af h1:rAgzfIj9FJtmJ6ZPDlxXX6Fzzix6NOpPTvVmPY5rwQg= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/tests/integration/bank/keeper/deterministic_test.go b/tests/integration/bank/keeper/deterministic_test.go index 731304266c5e..177006bdaeda 100644 --- a/tests/integration/bank/keeper/deterministic_test.go +++ b/tests/integration/bank/keeper/deterministic_test.go @@ -3,7 +3,7 @@ package keeper_test import ( "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" "pgregory.net/rapid" @@ -75,7 +75,7 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture { ) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) f.ctx = ctx queryHelper := baseapp.NewQueryServerTestHelper(ctx, interfaceRegistry) diff --git a/tests/integration/bank/keeper/keeper_test.go b/tests/integration/bank/keeper/keeper_test.go index b78311e5a501..58cc8f6f6907 100644 --- a/tests/integration/bank/keeper/keeper_test.go +++ b/tests/integration/bank/keeper/keeper_test.go @@ -10,8 +10,8 @@ import ( authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtime "github.com/cometbft/cometbft/types/time" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttime "github.com/cometbft/cometbft/types/time" "gotest.tools/v3/assert" storetypes "cosmossdk.io/store/types" @@ -130,7 +130,7 @@ func initFixture(t assert.TestingT) *fixture { ) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) f.ctx = ctx f.fetchStoreKey = app.UnsafeFindStoreKey @@ -542,8 +542,8 @@ func TestValidateBalance(t *testing.T) { t.Parallel() ctx := f.ctx - now := tmtime.Now() - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + now := cmttime.Now() + ctx = ctx.WithBlockHeader(cmtproto.Header{Time: now}) endTime := now.Add(24 * time.Hour) addr1 := sdk.AccAddress([]byte("addr1_______________")) @@ -575,7 +575,7 @@ func TestSendCoins_Invalid_SendLockedCoins(t *testing.T) { addr := sdk.AccAddress([]byte("addr1_______________")) addr2 := sdk.AccAddress([]byte("addr2_______________")) - now := tmtime.Now() + now := cmttime.Now() endTime := now.Add(24 * time.Hour) origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100)) @@ -801,8 +801,8 @@ func TestSpendableCoins(t *testing.T) { t.Parallel() ctx := f.ctx - now := tmtime.Now() - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + now := cmttime.Now() + ctx = ctx.WithBlockHeader(cmtproto.Header{Time: now}) endTime := now.Add(24 * time.Hour) origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100)) @@ -837,8 +837,8 @@ func TestVestingAccountSend(t *testing.T) { t.Parallel() ctx := f.ctx - now := tmtime.Now() - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + now := cmttime.Now() + ctx = ctx.WithBlockHeader(cmtproto.Header{Time: now}) endTime := now.Add(24 * time.Hour) origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100)) @@ -869,8 +869,8 @@ func TestPeriodicVestingAccountSend(t *testing.T) { t.Parallel() ctx := f.ctx - now := tmtime.Now() - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + now := cmttime.Now() + ctx = ctx.WithBlockHeader(cmtproto.Header{Time: now}) origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100)) sendCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 50)) @@ -905,8 +905,8 @@ func TestVestingAccountReceive(t *testing.T) { t.Parallel() ctx := f.ctx - now := tmtime.Now() - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + now := cmttime.Now() + ctx = ctx.WithBlockHeader(cmtproto.Header{Time: now}) endTime := now.Add(24 * time.Hour) origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100)) @@ -942,8 +942,8 @@ func TestPeriodicVestingAccountReceive(t *testing.T) { t.Parallel() ctx := f.ctx - now := tmtime.Now() - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + now := cmttime.Now() + ctx = ctx.WithBlockHeader(cmtproto.Header{Time: now}) origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100)) sendCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 50)) @@ -984,8 +984,8 @@ func TestDelegateCoins(t *testing.T) { t.Parallel() ctx := f.ctx - now := tmtime.Now() - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + now := cmttime.Now() + ctx = ctx.WithBlockHeader(cmtproto.Header{Time: now}) endTime := now.Add(24 * time.Hour) origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100)) @@ -1053,8 +1053,8 @@ func TestUndelegateCoins(t *testing.T) { t.Parallel() ctx := f.ctx - now := tmtime.Now() - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + now := cmttime.Now() + ctx = ctx.WithBlockHeader(cmtproto.Header{Time: now}) endTime := now.Add(24 * time.Hour) origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100)) diff --git a/tests/integration/distribution/keeper/allocation_test.go b/tests/integration/distribution/keeper/allocation_test.go index aa8aee949e73..f683225213d4 100644 --- a/tests/integration/distribution/keeper/allocation_test.go +++ b/tests/integration/distribution/keeper/allocation_test.go @@ -5,7 +5,7 @@ import ( "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -36,7 +36,7 @@ func TestAllocateTokensToValidatorWithCommission(t *testing.T) { ) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) addrs := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 3, sdk.NewInt(1234)) valAddrs := simtestutil.ConvertAddrsToValAddrs(addrs) @@ -79,7 +79,7 @@ func TestAllocateTokensToManyValidators(t *testing.T) { ) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) // reset fee pool distrKeeper.SetFeePool(ctx, disttypes.InitialFeePool()) @@ -172,7 +172,7 @@ func TestAllocateTokensTruncation(t *testing.T) { ) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) // reset fee pool distrKeeper.SetFeePool(ctx, disttypes.InitialFeePool()) diff --git a/tests/integration/distribution/keeper/delegation_test.go b/tests/integration/distribution/keeper/delegation_test.go index d0aea8ee5914..dcb25cbf3fd8 100644 --- a/tests/integration/distribution/keeper/delegation_test.go +++ b/tests/integration/distribution/keeper/delegation_test.go @@ -4,7 +4,7 @@ import ( "testing" "cosmossdk.io/math" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -34,7 +34,7 @@ func TestCalculateRewardsBasic(t *testing.T) { ) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) distrKeeper.DeleteAllValidatorHistoricalRewards(ctx) @@ -103,7 +103,7 @@ func TestCalculateRewardsAfterSlash(t *testing.T) { ) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) addr := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 2, sdk.NewInt(100000000)) valAddrs := simtestutil.ConvertAddrsToValAddrs(addr) @@ -178,7 +178,7 @@ func TestCalculateRewardsAfterManySlashes(t *testing.T) { ) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) tstaking := stakingtestutil.NewHelper(t, ctx, stakingKeeper) addr := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 2, sdk.NewInt(100000000)) @@ -265,7 +265,7 @@ func TestCalculateRewardsMultiDelegator(t *testing.T) { ) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) tstaking := stakingtestutil.NewHelper(t, ctx, stakingKeeper) addr := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 2, sdk.NewInt(100000000)) @@ -342,7 +342,7 @@ func TestWithdrawDelegationRewardsBasic(t *testing.T) { ) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) distrKeeper.DeleteAllValidatorHistoricalRewards(ctx) @@ -427,7 +427,7 @@ func TestCalculateRewardsAfterManySlashesInSameBlock(t *testing.T) { ) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) addr := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 1, sdk.NewInt(1000000000)) valAddrs := simtestutil.ConvertAddrsToValAddrs(addr) @@ -507,7 +507,7 @@ func TestCalculateRewardsMultiDelegatorMultiSlash(t *testing.T) { ) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) tstaking := stakingtestutil.NewHelper(t, ctx, stakingKeeper) addr := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 2, sdk.NewInt(1000000000)) @@ -595,7 +595,7 @@ func TestCalculateRewardsMultiDelegatorMultWithdraw(t *testing.T) { ) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) distrKeeper.DeleteAllValidatorHistoricalRewards(ctx) @@ -756,7 +756,7 @@ func Test100PercentCommissionReward(t *testing.T) { ) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) tstaking := stakingtestutil.NewHelper(t, ctx, stakingKeeper) addr := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 2, sdk.NewInt(1000000000)) diff --git a/tests/integration/distribution/keeper/grpc_query_test.go b/tests/integration/distribution/keeper/grpc_query_test.go index 08f894aa8350..7ae9af27a451 100644 --- a/tests/integration/distribution/keeper/grpc_query_test.go +++ b/tests/integration/distribution/keeper/grpc_query_test.go @@ -6,7 +6,7 @@ import ( "testing" "cosmossdk.io/math" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" "github.com/cosmos/cosmos-sdk/baseapp" @@ -50,7 +50,7 @@ func initFixture(t assert.TestingT) *fixture { ) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) queryHelper := baseapp.NewQueryServerTestHelper(ctx, f.interfaceRegistry) types.RegisterQueryServer(queryHelper, keeper.NewQuerier(f.distrKeeper)) diff --git a/tests/integration/distribution/keeper/keeper_test.go b/tests/integration/distribution/keeper/keeper_test.go index c2ac69bd98a3..3db593890a30 100644 --- a/tests/integration/distribution/keeper/keeper_test.go +++ b/tests/integration/distribution/keeper/keeper_test.go @@ -5,7 +5,7 @@ import ( "testing" "cosmossdk.io/math" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -33,7 +33,7 @@ func TestSetWithdrawAddr(t *testing.T) { ) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) addr := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 2, sdk.NewInt(1000000000)) @@ -69,7 +69,7 @@ func TestWithdrawValidatorCommission(t *testing.T) { ) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) valCommission := sdk.DecCoins{ sdk.NewDecCoinFromDec("mytoken", math.LegacyNewDec(5).Quo(math.LegacyNewDec(4))), @@ -131,7 +131,7 @@ func TestGetTotalRewards(t *testing.T) { ) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) valCommission := sdk.DecCoins{ sdk.NewDecCoinFromDec("mytoken", math.LegacyNewDec(5).Quo(math.LegacyNewDec(4))), @@ -164,7 +164,7 @@ func TestFundCommunityPool(t *testing.T) { ) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) // reset fee pool distrKeeper.SetFeePool(ctx, types.InitialFeePool()) diff --git a/tests/integration/distribution/module_test.go b/tests/integration/distribution/module_test.go index 769a7c5889d8..2497c5b3a1ee 100644 --- a/tests/integration/distribution/module_test.go +++ b/tests/integration/distribution/module_test.go @@ -3,7 +3,7 @@ package distribution_test import ( "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -19,7 +19,7 @@ func TestItCreatesModuleAccountOnInitBlock(t *testing.T) { app, err := simtestutil.SetupAtGenesis(testutil.AppConfig, &accountKeeper) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) acc := accountKeeper.GetAccount(ctx, authtypes.NewModuleAddress(types.ModuleName)) assert.Assert(t, acc != nil) } diff --git a/tests/integration/evidence/keeper/infraction_test.go b/tests/integration/evidence/keeper/infraction_test.go index 4e6885bff09e..3bf9fd9bd36d 100644 --- a/tests/integration/evidence/keeper/infraction_test.go +++ b/tests/integration/evidence/keeper/infraction_test.go @@ -10,7 +10,7 @@ import ( "cosmossdk.io/x/evidence/keeper" "cosmossdk.io/x/evidence/testutil" "cosmossdk.io/x/evidence/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -77,7 +77,7 @@ func initFixture(t assert.TestingT) *fixture { router = router.AddRoute(types.RouteEquivocation, testEquivocationHandler(evidenceKeeper)) evidenceKeeper.SetRouter(router) - f.ctx = app.BaseApp.NewContext(false, tmproto.Header{Height: 1}) + f.ctx = app.BaseApp.NewContext(false, cmtproto.Header{Height: 1}) f.app = app f.evidenceKeeper = evidenceKeeper diff --git a/tests/integration/genutil/gentx_test.go b/tests/integration/genutil/gentx_test.go index 93fb72688b05..a9bf32561c11 100644 --- a/tests/integration/genutil/gentx_test.go +++ b/tests/integration/genutil/gentx_test.go @@ -8,7 +8,7 @@ import ( "time" "cosmossdk.io/math" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" "github.com/cosmos/cosmos-sdk/baseapp" @@ -73,7 +73,7 @@ func initFixture(t assert.TestingT) *fixture { &f.accountKeeper, &f.bankKeeper, &f.stakingKeeper) assert.NilError(t, err) - f.ctx = app.BaseApp.NewContext(false, tmproto.Header{}) + f.ctx = app.BaseApp.NewContext(false, cmtproto.Header{}) f.encodingConfig = encCfg f.baseApp = app.BaseApp diff --git a/tests/integration/gov/genesis_test.go b/tests/integration/gov/genesis_test.go index b22c9d1fa355..0a0036a41a1d 100644 --- a/tests/integration/gov/genesis_test.go +++ b/tests/integration/gov/genesis_test.go @@ -5,7 +5,7 @@ import ( "testing" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" "github.com/cosmos/cosmos-sdk/codec" @@ -66,13 +66,13 @@ func TestImportExportQueues(t *testing.T) { ) assert.NilError(t, err) - ctx := s1.app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := s1.app.BaseApp.NewContext(false, cmtproto.Header{}) addrs := simtestutil.AddTestAddrs(s1.BankKeeper, s1.StakingKeeper, ctx, 1, valTokens) - header := tmproto.Header{Height: s1.app.LastBlockHeight() + 1} + header := cmtproto.Header{Height: s1.app.LastBlockHeight() + 1} s1.app.BeginBlock(abci.RequestBeginBlock{Header: header}) - ctx = s1.app.BaseApp.NewContext(false, tmproto.Header{}) + ctx = s1.app.BaseApp.NewContext(false, cmtproto.Header{}) // Create two proposals, put the second into the voting period proposal1, err := s1.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "", "test", "description", addrs[0], false) assert.NilError(t, err) @@ -128,12 +128,12 @@ func TestImportExportQueues(t *testing.T) { ) s2.app.Commit() - s2.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: s2.app.LastBlockHeight() + 1}}) + s2.app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: s2.app.LastBlockHeight() + 1}}) - header = tmproto.Header{Height: s2.app.LastBlockHeight() + 1} + header = cmtproto.Header{Height: s2.app.LastBlockHeight() + 1} s2.app.BeginBlock(abci.RequestBeginBlock{Header: header}) - ctx2 := s2.app.BaseApp.NewContext(false, tmproto.Header{}) + ctx2 := s2.app.BaseApp.NewContext(false, cmtproto.Header{}) // Jump the time forward past the DepositPeriod and VotingPeriod ctx2 = ctx2.WithBlockTime(ctx2.BlockHeader().Time.Add(*s2.GovKeeper.GetParams(ctx2).MaxDepositPeriod).Add(*s2.GovKeeper.GetParams(ctx2).VotingPeriod)) diff --git a/tests/integration/gov/keeper/keeper_test.go b/tests/integration/gov/keeper/keeper_test.go index 7deaeb5ac547..18d277bef2b4 100644 --- a/tests/integration/gov/keeper/keeper_test.go +++ b/tests/integration/gov/keeper/keeper_test.go @@ -4,7 +4,7 @@ import ( "testing" "cosmossdk.io/simapp" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" "github.com/cosmos/cosmos-sdk/baseapp" @@ -39,7 +39,7 @@ func initFixture(t *testing.T) *fixture { f := &fixture{} app := simapp.Setup(t, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) // Populate the gov account with some coins, as the TestProposal we have // is a MsgSend from the gov account. diff --git a/tests/integration/gov/module_test.go b/tests/integration/gov/module_test.go index dc71d45f35b1..83bf6321f2e5 100644 --- a/tests/integration/gov/module_test.go +++ b/tests/integration/gov/module_test.go @@ -3,7 +3,7 @@ package gov_test import ( "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" "github.com/cosmos/cosmos-sdk/testutil/configurator" @@ -31,7 +31,7 @@ func TestItCreatesModuleAccountOnInitBlock(t *testing.T) { ) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) acc := accountKeeper.GetAccount(ctx, authtypes.NewModuleAddress(types.ModuleName)) assert.Assert(t, acc != nil) } diff --git a/tests/integration/runtime/query_test.go b/tests/integration/runtime/query_test.go index b1015eb2410e..f000c827d758 100644 --- a/tests/integration/runtime/query_test.go +++ b/tests/integration/runtime/query_test.go @@ -4,7 +4,7 @@ import ( "testing" reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/gogoproto/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" @@ -53,7 +53,7 @@ func initFixture(t assert.TestingT) *fixture { ) assert.NilError(t, err) - f.ctx = app.BaseApp.NewContext(false, tmproto.Header{}) + f.ctx = app.BaseApp.NewContext(false, cmtproto.Header{}) queryHelper := &baseapp.QueryServiceTestHelper{ GRPCQueryRouter: app.BaseApp.GRPCQueryRouter(), Ctx: f.ctx, diff --git a/tests/integration/slashing/keeper/keeper_test.go b/tests/integration/slashing/keeper/keeper_test.go index 6e233265b7fe..ada343cf57fb 100644 --- a/tests/integration/slashing/keeper/keeper_test.go +++ b/tests/integration/slashing/keeper/keeper_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" "github.com/cosmos/cosmos-sdk/baseapp" @@ -51,7 +51,7 @@ func initFixture(t assert.TestingT) *fixture { ) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) // TestParams set the SignedBlocksWindow to 1000 and MaxMissedBlocksPerWindow to 500 f.slashingKeeper.SetParams(ctx, testutil.TestParams()) diff --git a/tests/integration/staking/keeper/common_test.go b/tests/integration/staking/keeper/common_test.go index ea5991b669f3..a6ec64f07152 100644 --- a/tests/integration/staking/keeper/common_test.go +++ b/tests/integration/staking/keeper/common_test.go @@ -5,7 +5,7 @@ import ( "testing" "cosmossdk.io/simapp" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" "github.com/cosmos/cosmos-sdk/codec" @@ -29,7 +29,7 @@ func init() { // to avoid messing with the hooks. func createTestInput(t *testing.T) (*codec.LegacyAmino, *simapp.SimApp, sdk.Context) { app := simapp.Setup(t, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) app.StakingKeeper = keeper.NewKeeper( app.AppCodec(), diff --git a/tests/integration/staking/keeper/determinstic_test.go b/tests/integration/staking/keeper/determinstic_test.go index fa4d25d83b92..23fb54c81490 100644 --- a/tests/integration/staking/keeper/determinstic_test.go +++ b/tests/integration/staking/keeper/determinstic_test.go @@ -5,7 +5,7 @@ import ( "time" "cosmossdk.io/math" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" "pgregory.net/rapid" @@ -59,7 +59,7 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture { ) assert.NilError(t, err) - f.ctx = app.BaseApp.NewContext(false, tmproto.Header{}) + f.ctx = app.BaseApp.NewContext(false, cmtproto.Header{}) queryHelper := baseapp.NewQueryServerTestHelper(f.ctx, interfaceRegistry) stakingtypes.RegisterQueryServer(queryHelper, stakingkeeper.Querier{Keeper: f.stakingKeeper}) @@ -565,7 +565,7 @@ func TestGRPCHistoricalInfo(t *testing.T) { } historicalInfo := stakingtypes.HistoricalInfo{ - Header: tmproto.Header{}, + Header: cmtproto.Header{}, Valset: vals, } @@ -589,7 +589,7 @@ func TestGRPCHistoricalInfo(t *testing.T) { validator := getStaticValidator(f, t) historicalInfo := stakingtypes.HistoricalInfo{ - Header: tmproto.Header{}, + Header: cmtproto.Header{}, Valset: []stakingtypes.Validator{validator}, } diff --git a/tests/integration/staking/keeper/genesis_test.go b/tests/integration/staking/keeper/genesis_test.go index 902922419cf1..95cc4c2e1794 100644 --- a/tests/integration/staking/keeper/genesis_test.go +++ b/tests/integration/staking/keeper/genesis_test.go @@ -7,7 +7,7 @@ import ( "cosmossdk.io/math" "cosmossdk.io/simapp" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -20,7 +20,7 @@ import ( func bootstrapGenesisTest(t *testing.T, numAddrs int) (*simapp.SimApp, sdk.Context, []sdk.AccAddress) { app := simapp.Setup(t, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) addrDels, _ := generateAddresses(app, ctx, numAddrs) return app, ctx, addrDels @@ -116,7 +116,7 @@ func TestInitGenesis(t *testing.T) { func TestInitGenesis_PoolsBalanceMismatch(t *testing.T) { app := simapp.Setup(t, false) - ctx := app.NewContext(false, tmproto.Header{}) + ctx := app.NewContext(false, cmtproto.Header{}) consPub, err := codectypes.NewAnyWithValue(PKs[0]) assert.NilError(t, err) diff --git a/tests/integration/staking/keeper/keeper_test.go b/tests/integration/staking/keeper/keeper_test.go index bc7164bd19d4..98a2afc12e45 100644 --- a/tests/integration/staking/keeper/keeper_test.go +++ b/tests/integration/staking/keeper/keeper_test.go @@ -4,7 +4,7 @@ import ( "testing" "cosmossdk.io/simapp" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" @@ -30,7 +30,7 @@ func initFixture(t *testing.T) *fixture { f := &fixture{} app := simapp.Setup(t, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) querier := keeper.Querier{Keeper: app.StakingKeeper} @@ -41,7 +41,7 @@ func initFixture(t *testing.T) *fixture { f.msgServer = keeper.NewMsgServerImpl(app.StakingKeeper) addrs, _, validators := createValidators(t, ctx, app, []int64{9, 8, 7}) - header := tmproto.Header{ + header := cmtproto.Header{ ChainID: "HelloChain", Height: 5, } diff --git a/tests/integration/staking/keeper/msg_server_test.go b/tests/integration/staking/keeper/msg_server_test.go index 6c9b0d87cf52..3ccd554d5bd9 100644 --- a/tests/integration/staking/keeper/msg_server_test.go +++ b/tests/integration/staking/keeper/msg_server_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" "github.com/cosmos/cosmos-sdk/testutil/configurator" @@ -37,7 +37,7 @@ func TestCancelUnbondingDelegation(t *testing.T) { &stakingKeeper, &bankKeeper, &accountKeeper) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) msgServer := keeper.NewMsgServerImpl(stakingKeeper) bondDenom := stakingKeeper.BondDenom(ctx) diff --git a/tests/integration/staking/keeper/params_test.go b/tests/integration/staking/keeper/params_test.go index db9835598eee..e77240c5bbb6 100644 --- a/tests/integration/staking/keeper/params_test.go +++ b/tests/integration/staking/keeper/params_test.go @@ -3,7 +3,7 @@ package keeper import ( "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" "github.com/cosmos/cosmos-sdk/testutil/configurator" @@ -26,7 +26,7 @@ func TestParams(t *testing.T) { simtestutil.DefaultStartUpConfig(), &stakingKeeper) assert.NilError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) expParams := types.DefaultParams() diff --git a/tests/integration/staking/keeper/slash_test.go b/tests/integration/staking/keeper/slash_test.go index 350ea7f2dbf5..e2944aa58815 100644 --- a/tests/integration/staking/keeper/slash_test.go +++ b/tests/integration/staking/keeper/slash_test.go @@ -6,7 +6,7 @@ import ( "cosmossdk.io/math" "cosmossdk.io/simapp" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" sdktestutil "github.com/cosmos/cosmos-sdk/testutil" @@ -67,7 +67,7 @@ func TestSlashUnbondingDelegation(t *testing.T) { assert.Assert(t, slashAmount.Equal(sdk.NewInt(0))) // after the expiration time, no longer eligible for slashing - ctx = ctx.WithBlockHeader(tmproto.Header{Time: time.Unix(10, 0)}) + ctx = ctx.WithBlockHeader(cmtproto.Header{Time: time.Unix(10, 0)}) app.StakingKeeper.SetUnbondingDelegation(ctx, ubd) slashAmount = app.StakingKeeper.SlashUnbondingDelegation(ctx, ubd, 0, fraction) assert.Assert(t, slashAmount.Equal(sdk.NewInt(0))) @@ -75,7 +75,7 @@ func TestSlashUnbondingDelegation(t *testing.T) { // test valid slash, before expiration timestamp and to which stake contributed notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) oldUnbondedPoolBalances := app.BankKeeper.GetAllBalances(ctx, notBondedPool.GetAddress()) - ctx = ctx.WithBlockHeader(tmproto.Header{Time: time.Unix(0, 0)}) + ctx = ctx.WithBlockHeader(cmtproto.Header{Time: time.Unix(0, 0)}) app.StakingKeeper.SetUnbondingDelegation(ctx, ubd) slashAmount = app.StakingKeeper.SlashUnbondingDelegation(ctx, ubd, 0, fraction) assert.Assert(t, slashAmount.Equal(sdk.NewInt(5))) @@ -124,7 +124,7 @@ func TestSlashRedelegation(t *testing.T) { assert.Assert(t, slashAmount.Equal(sdk.NewInt(0))) // after the expiration time, no longer eligible for slashing - ctx = ctx.WithBlockHeader(tmproto.Header{Time: time.Unix(10, 0)}) + ctx = ctx.WithBlockHeader(cmtproto.Header{Time: time.Unix(10, 0)}) app.StakingKeeper.SetRedelegation(ctx, rd) validator, found = app.StakingKeeper.GetValidator(ctx, addrVals[1]) assert.Assert(t, found) @@ -134,7 +134,7 @@ func TestSlashRedelegation(t *testing.T) { balances := app.BankKeeper.GetAllBalances(ctx, bondedPool.GetAddress()) // test valid slash, before expiration timestamp and to which stake contributed - ctx = ctx.WithBlockHeader(tmproto.Header{Time: time.Unix(0, 0)}) + ctx = ctx.WithBlockHeader(cmtproto.Header{Time: time.Unix(0, 0)}) app.StakingKeeper.SetRedelegation(ctx, rd) validator, found = app.StakingKeeper.GetValidator(ctx, addrVals[1]) assert.Assert(t, found) diff --git a/tests/integration/store/rootmulti/rollback_test.go b/tests/integration/store/rootmulti/rollback_test.go index 9034524ec7c6..ca521a67f415 100644 --- a/tests/integration/store/rootmulti/rollback_test.go +++ b/tests/integration/store/rootmulti/rollback_test.go @@ -7,7 +7,7 @@ import ( "cosmossdk.io/simapp" abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "gotest.tools/v3/assert" @@ -26,7 +26,7 @@ func TestRollback(t *testing.T) { ver0 := app.LastBlockHeight() // commit 10 blocks for i := int64(1); i <= 10; i++ { - header := tmproto.Header{ + header := cmtproto.Header{ Height: ver0 + i, AppHash: app.LastCommitID().Hash, } @@ -38,7 +38,7 @@ func TestRollback(t *testing.T) { } assert.Equal(t, ver0+10, app.LastBlockHeight()) - store := app.NewContext(true, tmproto.Header{}).KVStore(app.GetKey("bank")) + store := app.NewContext(true, cmtproto.Header{}).KVStore(app.GetKey("bank")) assert.DeepEqual(t, []byte("value10"), store.Get([]byte("key"))) // rollback 5 blocks @@ -48,12 +48,12 @@ func TestRollback(t *testing.T) { // recreate app to have clean check state app = simapp.NewSimApp(options.Logger, options.DB, nil, true, simtestutil.NewAppOptionsWithFlagHome(t.TempDir())) - store = app.NewContext(true, tmproto.Header{}).KVStore(app.GetKey("bank")) + store = app.NewContext(true, cmtproto.Header{}).KVStore(app.GetKey("bank")) assert.DeepEqual(t, []byte("value5"), store.Get([]byte("key"))) // commit another 5 blocks with different values for i := int64(6); i <= 10; i++ { - header := tmproto.Header{ + header := cmtproto.Header{ Height: ver0 + i, AppHash: app.LastCommitID().Hash, } @@ -65,6 +65,6 @@ func TestRollback(t *testing.T) { } assert.Equal(t, ver0+10, app.LastBlockHeight()) - store = app.NewContext(true, tmproto.Header{}).KVStore(app.GetKey("bank")) + store = app.NewContext(true, cmtproto.Header{}).KVStore(app.GetKey("bank")) assert.DeepEqual(t, []byte("VALUE10"), store.Get([]byte("key"))) } diff --git a/testutil/cli/tm_mocks.go b/testutil/cli/cmt_mocks.go similarity index 52% rename from testutil/cli/tm_mocks.go rename to testutil/cli/cmt_mocks.go index b7449535d310..a03ea176060a 100644 --- a/testutil/cli/tm_mocks.go +++ b/testutil/cli/cmt_mocks.go @@ -4,37 +4,37 @@ import ( "context" abci "github.com/cometbft/cometbft/abci/types" - tmbytes "github.com/cometbft/cometbft/libs/bytes" + cmtbytes "github.com/cometbft/cometbft/libs/bytes" rpcclient "github.com/cometbft/cometbft/rpc/client" rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock" coretypes "github.com/cometbft/cometbft/rpc/core/types" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/client" ) -var _ client.TendermintRPC = (*MockTendermintRPC)(nil) +var _ client.CometRPC = (*MockCometRPC)(nil) -type MockTendermintRPC struct { +type MockCometRPC struct { rpcclientmock.Client responseQuery abci.ResponseQuery } -// NewMockTendermintRPC returns a mock TendermintRPC implementation. +// NewMockCometRPC returns a mock CometBFT RPC implementation. // It is used for CLI testing. -func NewMockTendermintRPC(respQuery abci.ResponseQuery) MockTendermintRPC { - return MockTendermintRPC{responseQuery: respQuery} +func NewMockCometRPC(respQuery abci.ResponseQuery) MockCometRPC { + return MockCometRPC{responseQuery: respQuery} } -func (MockTendermintRPC) BroadcastTxSync(context.Context, tmtypes.Tx) (*coretypes.ResultBroadcastTx, error) { +func (MockCometRPC) BroadcastTxSync(context.Context, cmttypes.Tx) (*coretypes.ResultBroadcastTx, error) { return &coretypes.ResultBroadcastTx{Code: 0}, nil } -func (m MockTendermintRPC) ABCIQueryWithOptions( +func (m MockCometRPC) ABCIQueryWithOptions( _ context.Context, _ string, - _ tmbytes.HexBytes, + _ cmtbytes.HexBytes, _ rpcclient.ABCIQueryOptions, ) (*coretypes.ResultABCIQuery, error) { return &coretypes.ResultABCIQuery{Response: m.responseQuery}, nil diff --git a/testutil/context.go b/testutil/context.go index e937e71a80d0..145c9a0b4c63 100644 --- a/testutil/context.go +++ b/testutil/context.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/assert" @@ -25,7 +25,7 @@ func DefaultContext(key storetypes.StoreKey, tkey storetypes.StoreKey) sdk.Conte if err != nil { panic(err) } - ctx := sdk.NewContext(cms, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(cms, cmtproto.Header{}, false, log.NewNopLogger()) return ctx } @@ -44,7 +44,7 @@ func DefaultContextWithDB(t *testing.T, key storetypes.StoreKey, tkey storetypes err := cms.LoadLatestVersion() assert.NoError(t, err) - ctx := sdk.NewContext(cms, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(cms, cmtproto.Header{}, false, log.NewNopLogger()) return TestContext{ctx, db, cms} } diff --git a/testutil/mock/privval.go b/testutil/mock/privval.go index b2db0f9272f6..eeef311e2a54 100644 --- a/testutil/mock/privval.go +++ b/testutil/mock/privval.go @@ -2,15 +2,15 @@ package mock import ( "github.com/cometbft/cometbft/crypto" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttypes "github.com/cometbft/cometbft/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" ) -var _ tmtypes.PrivValidator = PV{} +var _ cmttypes.PrivValidator = PV{} // PV implements PrivValidator without any safety or persistence. // Only use it for testing. @@ -28,8 +28,8 @@ func (pv PV) GetPubKey() (crypto.PubKey, error) { } // SignVote implements PrivValidator interface -func (pv PV) SignVote(chainID string, vote *tmproto.Vote) error { - signBytes := tmtypes.VoteSignBytes(chainID, vote) +func (pv PV) SignVote(chainID string, vote *cmtproto.Vote) error { + signBytes := cmttypes.VoteSignBytes(chainID, vote) sig, err := pv.PrivKey.Sign(signBytes) if err != nil { return err @@ -39,8 +39,8 @@ func (pv PV) SignVote(chainID string, vote *tmproto.Vote) error { } // SignProposal implements PrivValidator interface -func (pv PV) SignProposal(chainID string, proposal *tmproto.Proposal) error { - signBytes := tmtypes.ProposalSignBytes(chainID, proposal) +func (pv PV) SignProposal(chainID string, proposal *cmtproto.Proposal) error { + signBytes := cmttypes.ProposalSignBytes(chainID, proposal) sig, err := pv.PrivKey.Sign(signBytes) if err != nil { return err diff --git a/testutil/mock/privval_test.go b/testutil/mock/privval_test.go index de3767fc900f..d5f8ed02b0ff 100644 --- a/testutil/mock/privval_test.go +++ b/testutil/mock/privval_test.go @@ -3,7 +3,7 @@ package mock import ( "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" ) @@ -16,7 +16,7 @@ func TestGetPubKey(t *testing.T) { func TestSignVote(t *testing.T) { pv := NewPV() - v := tmproto.Vote{} + v := cmtproto.Vote{} err := pv.SignVote("chain-id", &v) require.NoError(t, err) require.NotNil(t, v.Signature) @@ -24,7 +24,7 @@ func TestSignVote(t *testing.T) { func TestSignProposal(t *testing.T) { pv := NewPV() - p := tmproto.Proposal{} + p := cmtproto.Proposal{} err := pv.SignProposal("chain-id", &p) require.NoError(t, err) require.NotNil(t, p.Signature) diff --git a/testutil/mock/types_mock_appmodule.go b/testutil/mock/types_mock_appmodule.go index 4018ceca0c4f..e1a6f2385691 100644 --- a/testutil/mock/types_mock_appmodule.go +++ b/testutil/mock/types_mock_appmodule.go @@ -10,15 +10,15 @@ import ( reflect "reflect" appmodule "cosmossdk.io/core/appmodule" + types "github.com/cometbft/cometbft/abci/types" client "github.com/cosmos/cosmos-sdk/client" codec "github.com/cosmos/cosmos-sdk/codec" - types "github.com/cosmos/cosmos-sdk/codec/types" - types0 "github.com/cosmos/cosmos-sdk/types" + types0 "github.com/cosmos/cosmos-sdk/codec/types" + types1 "github.com/cosmos/cosmos-sdk/types" module "github.com/cosmos/cosmos-sdk/types/module" gomock "github.com/golang/mock/gomock" runtime "github.com/grpc-ecosystem/grpc-gateway/runtime" cobra "github.com/spf13/cobra" - types1 "github.com/cometbft/cometbft/abci/types" ) // MockAppModuleWithAllExtensions is a mock of AppModuleWithAllExtensions interface. @@ -45,7 +45,7 @@ func (m *MockAppModuleWithAllExtensions) EXPECT() *MockAppModuleWithAllExtension } // BeginBlock mocks base method. -func (m *MockAppModuleWithAllExtensions) BeginBlock(arg0 types0.Context, arg1 types1.RequestBeginBlock) { +func (m *MockAppModuleWithAllExtensions) BeginBlock(arg0 types1.Context, arg1 types.RequestBeginBlock) { m.ctrl.T.Helper() m.ctrl.Call(m, "BeginBlock", arg0, arg1) } @@ -85,10 +85,10 @@ func (mr *MockAppModuleWithAllExtensionsMockRecorder) DefaultGenesis(arg0 interf } // EndBlock mocks base method. -func (m *MockAppModuleWithAllExtensions) EndBlock(arg0 types0.Context, arg1 types1.RequestEndBlock) []types1.ValidatorUpdate { +func (m *MockAppModuleWithAllExtensions) EndBlock(arg0 types1.Context, arg1 types.RequestEndBlock) []types.ValidatorUpdate { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "EndBlock", arg0, arg1) - ret0, _ := ret[0].([]types1.ValidatorUpdate) + ret0, _ := ret[0].([]types.ValidatorUpdate) return ret0 } @@ -99,7 +99,7 @@ func (mr *MockAppModuleWithAllExtensionsMockRecorder) EndBlock(arg0, arg1 interf } // ExportGenesis mocks base method. -func (m *MockAppModuleWithAllExtensions) ExportGenesis(arg0 types0.Context, arg1 codec.JSONCodec) json.RawMessage { +func (m *MockAppModuleWithAllExtensions) ExportGenesis(arg0 types1.Context, arg1 codec.JSONCodec) json.RawMessage { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ExportGenesis", arg0, arg1) ret0, _ := ret[0].(json.RawMessage) @@ -141,10 +141,10 @@ func (mr *MockAppModuleWithAllExtensionsMockRecorder) GetTxCmd() *gomock.Call { } // InitGenesis mocks base method. -func (m *MockAppModuleWithAllExtensions) InitGenesis(arg0 types0.Context, arg1 codec.JSONCodec, arg2 json.RawMessage) []types1.ValidatorUpdate { +func (m *MockAppModuleWithAllExtensions) InitGenesis(arg0 types1.Context, arg1 codec.JSONCodec, arg2 json.RawMessage) []types.ValidatorUpdate { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "InitGenesis", arg0, arg1, arg2) - ret0, _ := ret[0].([]types1.ValidatorUpdate) + ret0, _ := ret[0].([]types.ValidatorUpdate) return ret0 } @@ -181,7 +181,7 @@ func (mr *MockAppModuleWithAllExtensionsMockRecorder) RegisterGRPCGatewayRoutes( } // RegisterInterfaces mocks base method. -func (m *MockAppModuleWithAllExtensions) RegisterInterfaces(arg0 types.InterfaceRegistry) { +func (m *MockAppModuleWithAllExtensions) RegisterInterfaces(arg0 types0.InterfaceRegistry) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterInterfaces", arg0) } @@ -193,7 +193,7 @@ func (mr *MockAppModuleWithAllExtensionsMockRecorder) RegisterInterfaces(arg0 in } // RegisterInvariants mocks base method. -func (m *MockAppModuleWithAllExtensions) RegisterInvariants(arg0 types0.InvariantRegistry) { +func (m *MockAppModuleWithAllExtensions) RegisterInvariants(arg0 types1.InvariantRegistry) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterInvariants", arg0) } diff --git a/testutil/mock/types_module_module.go b/testutil/mock/types_module_module.go index 024daf91467f..8b3a79c80fa9 100644 --- a/testutil/mock/types_module_module.go +++ b/testutil/mock/types_module_module.go @@ -8,15 +8,15 @@ import ( json "encoding/json" reflect "reflect" + types "github.com/cometbft/cometbft/abci/types" client "github.com/cosmos/cosmos-sdk/client" codec "github.com/cosmos/cosmos-sdk/codec" - types "github.com/cosmos/cosmos-sdk/codec/types" - types0 "github.com/cosmos/cosmos-sdk/types" + types0 "github.com/cosmos/cosmos-sdk/codec/types" + types1 "github.com/cosmos/cosmos-sdk/types" module "github.com/cosmos/cosmos-sdk/types/module" gomock "github.com/golang/mock/gomock" runtime "github.com/grpc-ecosystem/grpc-gateway/runtime" cobra "github.com/spf13/cobra" - types1 "github.com/cometbft/cometbft/abci/types" ) // MockAppModuleBasic is a mock of AppModuleBasic interface. @@ -97,7 +97,7 @@ func (mr *MockAppModuleBasicMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 i } // RegisterInterfaces mocks base method. -func (m *MockAppModuleBasic) RegisterInterfaces(arg0 types.InterfaceRegistry) { +func (m *MockAppModuleBasic) RegisterInterfaces(arg0 types0.InterfaceRegistry) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterInterfaces", arg0) } @@ -246,7 +246,7 @@ func (mr *MockAppModuleGenesisMockRecorder) DefaultGenesis(arg0 interface{}) *go } // ExportGenesis mocks base method. -func (m *MockAppModuleGenesis) ExportGenesis(arg0 types0.Context, arg1 codec.JSONCodec) json.RawMessage { +func (m *MockAppModuleGenesis) ExportGenesis(arg0 types1.Context, arg1 codec.JSONCodec) json.RawMessage { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ExportGenesis", arg0, arg1) ret0, _ := ret[0].(json.RawMessage) @@ -288,10 +288,10 @@ func (mr *MockAppModuleGenesisMockRecorder) GetTxCmd() *gomock.Call { } // InitGenesis mocks base method. -func (m *MockAppModuleGenesis) InitGenesis(arg0 types0.Context, arg1 codec.JSONCodec, arg2 json.RawMessage) []types1.ValidatorUpdate { +func (m *MockAppModuleGenesis) InitGenesis(arg0 types1.Context, arg1 codec.JSONCodec, arg2 json.RawMessage) []types.ValidatorUpdate { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "InitGenesis", arg0, arg1, arg2) - ret0, _ := ret[0].([]types1.ValidatorUpdate) + ret0, _ := ret[0].([]types.ValidatorUpdate) return ret0 } @@ -328,7 +328,7 @@ func (mr *MockAppModuleGenesisMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 } // RegisterInterfaces mocks base method. -func (m *MockAppModuleGenesis) RegisterInterfaces(arg0 types.InterfaceRegistry) { +func (m *MockAppModuleGenesis) RegisterInterfaces(arg0 types0.InterfaceRegistry) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterInterfaces", arg0) } @@ -403,7 +403,7 @@ func (mr *MockHasGenesisMockRecorder) DefaultGenesis(arg0 interface{}) *gomock.C } // ExportGenesis mocks base method. -func (m *MockHasGenesis) ExportGenesis(arg0 types0.Context, arg1 codec.JSONCodec) json.RawMessage { +func (m *MockHasGenesis) ExportGenesis(arg0 types1.Context, arg1 codec.JSONCodec) json.RawMessage { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ExportGenesis", arg0, arg1) ret0, _ := ret[0].(json.RawMessage) @@ -417,10 +417,10 @@ func (mr *MockHasGenesisMockRecorder) ExportGenesis(arg0, arg1 interface{}) *gom } // InitGenesis mocks base method. -func (m *MockHasGenesis) InitGenesis(arg0 types0.Context, arg1 codec.JSONCodec, arg2 json.RawMessage) []types1.ValidatorUpdate { +func (m *MockHasGenesis) InitGenesis(arg0 types1.Context, arg1 codec.JSONCodec, arg2 json.RawMessage) []types.ValidatorUpdate { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "InitGenesis", arg0, arg1, arg2) - ret0, _ := ret[0].([]types1.ValidatorUpdate) + ret0, _ := ret[0].([]types.ValidatorUpdate) return ret0 } @@ -522,7 +522,7 @@ func (mr *MockAppModuleMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 interf } // RegisterInterfaces mocks base method. -func (m *MockAppModule) RegisterInterfaces(arg0 types.InterfaceRegistry) { +func (m *MockAppModule) RegisterInterfaces(arg0 types0.InterfaceRegistry) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterInterfaces", arg0) } @@ -569,7 +569,7 @@ func (m *MockHasInvariants) EXPECT() *MockHasInvariantsMockRecorder { } // RegisterInvariants mocks base method. -func (m *MockHasInvariants) RegisterInvariants(arg0 types0.InvariantRegistry) { +func (m *MockHasInvariants) RegisterInvariants(arg0 types1.InvariantRegistry) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterInvariants", arg0) } @@ -676,7 +676,7 @@ func (m *MockBeginBlockAppModule) EXPECT() *MockBeginBlockAppModuleMockRecorder } // BeginBlock mocks base method. -func (m *MockBeginBlockAppModule) BeginBlock(arg0 types0.Context, arg1 types1.RequestBeginBlock) { +func (m *MockBeginBlockAppModule) BeginBlock(arg0 types1.Context, arg1 types.RequestBeginBlock) { m.ctrl.T.Helper() m.ctrl.Call(m, "BeginBlock", arg0, arg1) } @@ -742,7 +742,7 @@ func (mr *MockBeginBlockAppModuleMockRecorder) RegisterGRPCGatewayRoutes(arg0, a } // RegisterInterfaces mocks base method. -func (m *MockBeginBlockAppModule) RegisterInterfaces(arg0 types.InterfaceRegistry) { +func (m *MockBeginBlockAppModule) RegisterInterfaces(arg0 types0.InterfaceRegistry) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterInterfaces", arg0) } @@ -789,10 +789,10 @@ func (m *MockEndBlockAppModule) EXPECT() *MockEndBlockAppModuleMockRecorder { } // EndBlock mocks base method. -func (m *MockEndBlockAppModule) EndBlock(arg0 types0.Context, arg1 types1.RequestEndBlock) []types1.ValidatorUpdate { +func (m *MockEndBlockAppModule) EndBlock(arg0 types1.Context, arg1 types.RequestEndBlock) []types.ValidatorUpdate { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "EndBlock", arg0, arg1) - ret0, _ := ret[0].([]types1.ValidatorUpdate) + ret0, _ := ret[0].([]types.ValidatorUpdate) return ret0 } @@ -857,7 +857,7 @@ func (mr *MockEndBlockAppModuleMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg } // RegisterInterfaces mocks base method. -func (m *MockEndBlockAppModule) RegisterInterfaces(arg0 types.InterfaceRegistry) { +func (m *MockEndBlockAppModule) RegisterInterfaces(arg0 types0.InterfaceRegistry) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterInterfaces", arg0) } diff --git a/testutil/network/doc.go b/testutil/network/doc.go index b00a75aededf..be15df7e03e0 100644 --- a/testutil/network/doc.go +++ b/testutil/network/doc.go @@ -55,7 +55,7 @@ A typical testing flow might look like the following: baseURL := val.APIAddress // Use baseURL to make API HTTP requests or use val.RPCClient to make direct - // Tendermint RPC calls. + // CometBFT RPC calls. // ... } diff --git a/testutil/network/network.go b/testutil/network/network.go index 922078ce3da6..69a8cc0c5198 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -17,10 +17,10 @@ import ( "cosmossdk.io/depinject" sdkmath "cosmossdk.io/math" - tmlog "github.com/cometbft/cometbft/libs/log" - tmrand "github.com/cometbft/cometbft/libs/rand" + cmtlog "github.com/cometbft/cometbft/libs/log" + cmtrand "github.com/cometbft/cometbft/libs/rand" "github.com/cometbft/cometbft/node" - tmclient "github.com/cometbft/cometbft/rpc/client" + cmtclient "github.com/cometbft/cometbft/rpc/client" dbm "github.com/cosmos/cosmos-db" "github.com/spf13/cobra" "google.golang.org/grpc" @@ -85,7 +85,7 @@ func init() { } // AppConstructor defines a function which accepts a network configuration and -// creates an ABCI Application to provide to Tendermint. +// creates an ABCI Application to provide to CometBFT. type ( AppConstructor = func(val ValidatorI) servertypes.Application TestFixtureFactory = func() TestFixture @@ -118,7 +118,7 @@ type Config struct { StakingTokens sdkmath.Int // the amount of tokens each validator has available to stake BondedTokens sdkmath.Int // the amount of tokens each validator stakes PruningStrategy string // the pruning strategy each validator will have - EnableTMLogging bool // enable Tendermint logging to STDOUT + EnableTMLogging bool // enable CometBFT logging to STDOUT CleanupDir bool // remove base temporary directory during cleanup SigningAlgo string // signing algorithm for keys KeyringOptions []keyring.Option // keyring configuration options @@ -142,7 +142,7 @@ func DefaultConfig(factory TestFixtureFactory) Config { AppConstructor: fixture.AppConstructor, GenesisState: fixture.GenesisState, TimeoutCommit: 2 * time.Second, - ChainID: "chain-" + tmrand.Str(6), + ChainID: "chain-" + cmtrand.Str(6), NumValidators: 4, BondDenom: sdk.DefaultBondDenom, MinGasPrices: fmt.Sprintf("0.000006%s", sdk.DefaultBondDenom), @@ -229,7 +229,7 @@ type ( // clients. Typically, this test network would be used in client and integration // testing where user input is expected. // - // Note, due to Tendermint constraints in regards to RPC functionality, there + // Note, due to CometBFT constraints in regards to RPC functionality, there // may only be one test network running at a time. Thus, any caller must be // sure to Cleanup after testing is finished in order to allow other tests // to create networks. In addition, only the first validator will have a valid @@ -242,7 +242,7 @@ type ( Config Config } - // Validator defines an in-process Tendermint validator node. Through this object, + // Validator defines an in-process CometBFT validator node. Through this object, // a client can make RPC and API calls and interact with any client command // or handler. Validator struct { @@ -258,7 +258,7 @@ type ( P2PAddress string Address sdk.AccAddress ValAddress sdk.ValAddress - RPCClient tmclient.Client + RPCClient cmtclient.Client tmNode *node.Node api *api.Server @@ -351,13 +351,13 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { appCfg.Telemetry.Enabled = false ctx := server.NewDefaultContext() - tmCfg := ctx.Config - tmCfg.Consensus.TimeoutCommit = cfg.TimeoutCommit + cmtCfg := ctx.Config + cmtCfg.Consensus.TimeoutCommit = cfg.TimeoutCommit // Only allow the first validator to expose an RPC, API and gRPC - // server/client due to Tendermint in-process constraints. + // server/client due to CometBFT in-process constraints. apiAddr := "" - tmCfg.RPC.ListenAddress = "" + cmtCfg.RPC.ListenAddress = "" appCfg.GRPC.Enable = false appCfg.GRPCWeb.Enable = false apiListenAddr := "" @@ -380,13 +380,13 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { apiAddr = fmt.Sprintf("http://%s:%s", apiURL.Hostname(), apiURL.Port()) if cfg.RPCAddress != "" { - tmCfg.RPC.ListenAddress = cfg.RPCAddress + cmtCfg.RPC.ListenAddress = cfg.RPCAddress } else { if len(portPool) == 0 { return nil, fmt.Errorf("failed to get port for RPC server") } port := <-portPool - tmCfg.RPC.ListenAddress = fmt.Sprintf("tcp://0.0.0.0:%s", port) + cmtCfg.RPC.ListenAddress = fmt.Sprintf("tcp://0.0.0.0:%s", port) } if cfg.GRPCAddress != "" { @@ -402,9 +402,9 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { appCfg.GRPCWeb.Enable = true } - logger := tmlog.NewNopLogger() + logger := cmtlog.NewNopLogger() if cfg.EnableTMLogging { - logger = tmlog.NewTMLogger(tmlog.NewSyncWriter(os.Stdout)) + logger = cmtlog.NewTMLogger(cmtlog.NewSyncWriter(os.Stdout)) } ctx.Logger = logger @@ -424,8 +424,8 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { return nil, err } - tmCfg.SetRoot(nodeDir) - tmCfg.Moniker = nodeDirName + cmtCfg.SetRoot(nodeDir) + cmtCfg.Moniker = nodeDirName monikers[i] = nodeDirName if len(portPool) == 0 { @@ -433,18 +433,18 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { } port := <-portPool proxyAddr := fmt.Sprintf("tcp://0.0.0.0:%s", port) - tmCfg.ProxyApp = proxyAddr + cmtCfg.ProxyApp = proxyAddr if len(portPool) == 0 { return nil, fmt.Errorf("failed to get port for Proxy server") } port = <-portPool p2pAddr := fmt.Sprintf("tcp://0.0.0.0:%s", port) - tmCfg.P2P.ListenAddress = p2pAddr - tmCfg.P2P.AddrBookStrict = false - tmCfg.P2P.AllowDuplicateIP = true + cmtCfg.P2P.ListenAddress = p2pAddr + cmtCfg.P2P.AddrBookStrict = false + cmtCfg.P2P.AllowDuplicateIP = true - nodeID, pubKey, err := genutil.InitializeNodeValidatorFiles(tmCfg) + nodeID, pubKey, err := genutil.InitializeNodeValidatorFiles(cmtCfg) if err != nil { return nil, err } @@ -496,7 +496,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { sdk.NewCoin(cfg.BondDenom, cfg.StakingTokens), ) - genFiles = append(genFiles, tmCfg.GenesisFile()) + genFiles = append(genFiles, cmtCfg.GenesisFile()) genBalances = append(genBalances, banktypes.Balance{Address: addr.String(), Coins: balances.Sort()}) genAccounts = append(genAccounts, authtypes.NewBaseAccount(addr, nil, 0, 0)) @@ -559,7 +559,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { clientCtx := client.Context{}. WithKeyringDir(clientDir). WithKeyring(kb). - WithHomeDir(tmCfg.RootDir). + WithHomeDir(cmtCfg.RootDir). WithChainID(cfg.ChainID). WithInterfaceRegistry(cfg.InterfaceRegistry). WithCodec(cfg.Codec). @@ -575,8 +575,8 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { NodeID: nodeID, PubKey: pubKey, Moniker: nodeDirName, - RPCAddress: tmCfg.RPC.ListenAddress, - P2PAddress: tmCfg.P2P.ListenAddress, + RPCAddress: cmtCfg.RPC.ListenAddress, + P2PAddress: cmtCfg.P2P.ListenAddress, APIAddress: apiAddr, Address: addr, ValAddress: sdk.ValAddress(addr), @@ -721,7 +721,7 @@ func (n *Network) WaitForNextBlock() error { } // Cleanup removes the root testing (temporary) directory and stops both the -// Tendermint and API services. It allows other callers to create and start +// CometBFT and API services. It allows other callers to create and start // test networks. This method must be called when a test is finished, typically // in a defer. func (n *Network) Cleanup() { diff --git a/testutil/network/util.go b/testutil/network/util.go index 70cc8cc0b45d..3efdfa0efdf1 100644 --- a/testutil/network/util.go +++ b/testutil/network/util.go @@ -14,7 +14,7 @@ import ( "github.com/cometbft/cometbft/proxy" "github.com/cometbft/cometbft/rpc/client/local" "github.com/cometbft/cometbft/types" - tmtime "github.com/cometbft/cometbft/types/time" + cmttime "github.com/cometbft/cometbft/types/time" "github.com/cosmos/cosmos-sdk/server/api" servergrpc "github.com/cosmos/cosmos-sdk/server/grpc" @@ -27,29 +27,29 @@ import ( func startInProcess(cfg Config, val *Validator) error { logger := val.Ctx.Logger - tmCfg := val.Ctx.Config - tmCfg.Instrumentation.Prometheus = false + cmtCfg := val.Ctx.Config + cmtCfg.Instrumentation.Prometheus = false if err := val.AppConfig.ValidateBasic(); err != nil { return err } - nodeKey, err := p2p.LoadOrGenNodeKey(tmCfg.NodeKeyFile()) + nodeKey, err := p2p.LoadOrGenNodeKey(cmtCfg.NodeKeyFile()) if err != nil { return err } app := cfg.AppConstructor(*val) - genDocProvider := node.DefaultGenesisDocProviderFunc(tmCfg) + genDocProvider := node.DefaultGenesisDocProviderFunc(cmtCfg) tmNode, err := node.NewNode( //resleak:notresource - tmCfg, - pvm.LoadOrGenFilePV(tmCfg.PrivValidatorKeyFile(), tmCfg.PrivValidatorStateFile()), + cmtCfg, + pvm.LoadOrGenFilePV(cmtCfg.PrivValidatorKeyFile(), cmtCfg.PrivValidatorStateFile()), nodeKey, proxy.NewLocalClientCreator(app), genDocProvider, node.DefaultDBProvider, - node.DefaultMetricsProvider(tmCfg.Instrumentation), + node.DefaultMetricsProvider(cmtCfg.Instrumentation), logger.With("module", val.Moniker), ) if err != nil { @@ -109,27 +109,27 @@ func startInProcess(cfg Config, val *Validator) error { } func collectGenFiles(cfg Config, vals []*Validator, outputDir string) error { - genTime := tmtime.Now() + genTime := cmttime.Now() for i := 0; i < cfg.NumValidators; i++ { - tmCfg := vals[i].Ctx.Config + cmtCfg := vals[i].Ctx.Config nodeDir := filepath.Join(outputDir, vals[i].Moniker, "simd") gentxsDir := filepath.Join(outputDir, "gentxs") - tmCfg.Moniker = vals[i].Moniker - tmCfg.SetRoot(nodeDir) + cmtCfg.Moniker = vals[i].Moniker + cmtCfg.SetRoot(nodeDir) initCfg := genutiltypes.NewInitConfig(cfg.ChainID, gentxsDir, vals[i].NodeID, vals[i].PubKey) - genFile := tmCfg.GenesisFile() + genFile := cmtCfg.GenesisFile() genDoc, err := types.GenesisDocFromFile(genFile) if err != nil { return err } appState, err := genutil.GenAppStateFromConfig(cfg.Codec, cfg.TxConfig, - tmCfg, initCfg, *genDoc, banktypes.GenesisBalancesIterator{}, genutiltypes.DefaultMessageValidator) + cmtCfg, initCfg, *genDoc, banktypes.GenesisBalancesIterator{}, genutiltypes.DefaultMessageValidator) if err != nil { return err } diff --git a/testutil/sims/app_helpers.go b/testutil/sims/app_helpers.go index 2f319a62ae18..22cdef20ce1e 100644 --- a/testutil/sims/app_helpers.go +++ b/testutil/sims/app_helpers.go @@ -8,10 +8,10 @@ import ( "cosmossdk.io/depinject" sdkmath "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" - tmjson "github.com/cometbft/cometbft/libs/json" + cmtjson "github.com/cometbft/cometbft/libs/json" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttypes "github.com/cometbft/cometbft/types" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/client/flags" @@ -32,25 +32,25 @@ const DefaultGenTxGas = 10000000 // DefaultConsensusParams defines the default Tendermint consensus params used in // SimApp testing. -var DefaultConsensusParams = &tmproto.ConsensusParams{ - Block: &tmproto.BlockParams{ +var DefaultConsensusParams = &cmtproto.ConsensusParams{ + Block: &cmtproto.BlockParams{ MaxBytes: 200000, MaxGas: 2000000, }, - Evidence: &tmproto.EvidenceParams{ + Evidence: &cmtproto.EvidenceParams{ MaxAgeNumBlocks: 302400, MaxAgeDuration: 504 * time.Hour, // 3 weeks is the max duration MaxBytes: 10000, }, - Validator: &tmproto.ValidatorParams{ + Validator: &cmtproto.ValidatorParams{ PubKeyTypes: []string{ - tmtypes.ABCIPubKeyTypeEd25519, + cmttypes.ABCIPubKeyTypeEd25519, }, }, } // CreateRandomValidatorSet creates a validator set with one random validator -func CreateRandomValidatorSet() (*tmtypes.ValidatorSet, error) { +func CreateRandomValidatorSet() (*cmttypes.ValidatorSet, error) { privVal := mock.NewPV() pubKey, err := privVal.GetPubKey() if err != nil { @@ -58,9 +58,9 @@ func CreateRandomValidatorSet() (*tmtypes.ValidatorSet, error) { } // create validator set with single validator - validator := tmtypes.NewValidator(pubKey, 1) + validator := cmttypes.NewValidator(pubKey, 1) - return tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}), nil + return cmttypes.NewValidatorSet([]*cmttypes.Validator{validator}), nil } type GenesisAccount struct { @@ -74,7 +74,7 @@ type GenesisAccount struct { // BaseAppOption defines the additional operations that must be run on baseapp before app start. // AtGenesis defines if the app started should already have produced block or not. type StartupConfig struct { - ValidatorSet func() (*tmtypes.ValidatorSet, error) + ValidatorSet func() (*cmttypes.ValidatorSet, error) BaseAppOption runtime.BaseAppOption AtGenesis bool GenesisAccounts []GenesisAccount @@ -153,7 +153,7 @@ func SetupWithConfiguration(appConfig depinject.Config, startupConfig StartupCon } // init chain must be called to stop deliverState from being nil - stateBytes, err := tmjson.MarshalIndent(genesisState, "", " ") + stateBytes, err := cmtjson.MarshalIndent(genesisState, "", " ") if err != nil { return nil, fmt.Errorf("failed to marshal default genesis state: %w", err) } @@ -170,7 +170,7 @@ func SetupWithConfiguration(appConfig depinject.Config, startupConfig StartupCon // commit genesis changes if !startupConfig.AtGenesis { app.Commit() - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{ + app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{ Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash, ValidatorsHash: valSet.Hash(), @@ -185,7 +185,7 @@ func SetupWithConfiguration(appConfig depinject.Config, startupConfig StartupCon func GenesisStateWithValSet( codec codec.Codec, genesisState map[string]json.RawMessage, - valSet *tmtypes.ValidatorSet, + valSet *cmttypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance, ) (map[string]json.RawMessage, error) { diff --git a/tools/confix/data/v0.48-app.toml b/tools/confix/data/v0.48-app.toml index 3532af15780f..c4ee54ba5272 100644 --- a/tools/confix/data/v0.48-app.toml +++ b/tools/confix/data/v0.48-app.toml @@ -35,15 +35,15 @@ halt-time = 0 # MinRetainBlocks defines the minimum block height offset from the current # block being committed, such that all blocks past this offset are pruned -# from Tendermint. It is used as part of the process of determining the +# from CometBFT. It is used as part of the process of determining the # ResponseCommit.RetainHeight value during ABCI Commit. A value of 0 indicates # that no blocks should be pruned. # -# This configuration value is only responsible for pruning Tendermint blocks. +# This configuration value is only responsible for pruning CometBFT blocks. # It has no bearing on application state pruning which is determined by the # "pruning-*" configurations. # -# Note: Tendermint block pruning is dependant on this parameter in conjunction +# Note: CometBFT block pruning is dependant on this parameter in conjunction # with the unbonding (safety threshold) period, state pruning and state sync # snapshot parameters to determine the correct minimum value of # ResponseCommit.RetainHeight. @@ -53,14 +53,13 @@ min-retain-blocks = 0 inter-block-cache = true # IndexEvents defines the set of events in the form {eventType}.{attributeKey}, -# which informs Tendermint what to index. If empty, all events will be indexed. +# which informs CometBFT what to index. If empty, all events will be indexed. # # Example: # ["message.sender", "message.recipient"] index-events = [] -# IavlCacheSize set the size of the iavl tree cache. -# Default cache size is 50mb. +# IavlCacheSize set the size of the iavl tree cache (in number of nodes). iavl-cache-size = 781250 # IAVLDisableFastNode enables or disables the fast node feature of IAVL. @@ -74,7 +73,7 @@ iavl-lazy-loading = false # AppDBBackend defines the database backend type to use for the application and snapshots DBs. # An empty string indicates that a fallback will be used. # First fallback is the deprecated compile-time types.DBBackend value. -# Second fallback (if the types.DBBackend also isn't set), is the db-backend value set in Tendermint's config.toml. +# Second fallback (if the types.DBBackend also isn't set), is the db-backend value set in CometBFT's config.toml. app-db-backend = "" ############################################################################### @@ -129,13 +128,13 @@ address = "tcp://localhost:1317" # MaxOpenConnections defines the number of maximum open connections. max-open-connections = 1000 -# RPCReadTimeout defines the Tendermint RPC read timeout (in seconds). +# RPCReadTimeout defines the CometBFT RPC read timeout (in seconds). rpc-read-timeout = 10 -# RPCWriteTimeout defines the Tendermint RPC write timeout (in seconds). +# RPCWriteTimeout defines the CometBFT RPC write timeout (in seconds). rpc-write-timeout = 0 -# RPCMaxBodyBytes defines the Tendermint maximum response body (in bytes). +# RPCMaxBodyBytes defines the CometBFT maximum response body (in bytes). rpc-max-body-bytes = 1000000 # EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). diff --git a/tools/confix/go.mod b/tools/confix/go.mod index 21c88068737f..ee5d96226b7b 100644 --- a/tools/confix/go.mod +++ b/tools/confix/go.mod @@ -3,7 +3,8 @@ module cosmossdk.io/tools/confix go 1.19 require ( - github.com/cosmos/cosmos-sdk v0.47.0-rc2 + // TODO to replace by a tagged version of the SDK (with CometBFT) when available + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230205135133-41a3dfeced29 github.com/creachadair/atomicfile v0.2.8 github.com/creachadair/tomledit v0.0.24 github.com/spf13/cobra v1.6.1 @@ -19,7 +20,7 @@ require ( cosmossdk.io/depinject v1.0.0-alpha.3 // indirect cosmossdk.io/errors v1.0.0-beta.7 // indirect cosmossdk.io/math v1.0.0-beta.6 // indirect - cosmossdk.io/store v0.0.0-20230204135315-697871069999 // indirect + cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 // indirect cosmossdk.io/x/tx v0.1.0 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -138,7 +139,7 @@ require ( golang.org/x/text v0.6.0 // indirect google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 // indirect google.golang.org/grpc v1.52.3 // indirect - google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a // indirect + google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -147,9 +148,6 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) -// This can be deleted after the CometBFT PR is merged -replace github.com/cosmos/cosmos-sdk => ../.. - // Fix upstream GHSA-h395-qcrw-5vmq vulnerability. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 // TODO investigate if we can outright delete this dependency, otherwise go install won't work :( diff --git a/tools/confix/go.sum b/tools/confix/go.sum index 5c2bb075e20d..2a78dca2fa23 100644 --- a/tools/confix/go.sum +++ b/tools/confix/go.sum @@ -49,6 +49,8 @@ cosmossdk.io/math v1.0.0-beta.6 h1:WF29SiFYNde5eYvqO2kdOM9nYbDb44j3YW5B8M1m9KE= cosmossdk.io/math v1.0.0-beta.6/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= cosmossdk.io/store v0.0.0-20230204135315-697871069999 h1:NrV990BIbdDngOoTrD3Hg5kqqgvy6c+ETaKGY5bSUmo= cosmossdk.io/store v0.0.0-20230204135315-697871069999/go.mod h1:Sf3G8SV8e8H31CD6w+o2syqCwyaoL0fe244JcPSsaD4= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7/go.mod h1:1XOtuYs7jsfQkn7G3VQXB6I+2tHXKHZw2U/AafNbnlk= cosmossdk.io/x/tx v0.1.0 h1:uyyYVjG22B+jf54N803Z99Y1uPvfuNP3K1YShoCHYL8= cosmossdk.io/x/tx v0.1.0/go.mod h1:qsDv7e1fSftkF16kpSAk+7ROOojyj+SC0Mz3ukI52EQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -176,6 +178,8 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9 github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso= github.com/cosmos/cosmos-proto v1.0.0-beta.1 h1:iDL5qh++NoXxG8hSy93FdYJut4XfgbShIocllGaXx/0= github.com/cosmos/cosmos-proto v1.0.0-beta.1/go.mod h1:8k2GNZghi5sDRFw/scPL8gMSowT1vDA+5ouxL8GjaUE= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230205135133-41a3dfeced29 h1:HJIOs0YfTumgmw8MU1QIiCHO+tz2IWoLpXNOXzLJqnE= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230205135133-41a3dfeced29/go.mod h1:9dul7UbanQCWIiz4b6FZ8QcKKU28EMgvXVNCTcc6Ivk= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -1270,6 +1274,8 @@ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a h1:KJVqJe240LvVd+8lfzRx3hQ0UZ0fyeXEMDMHviRNQKs= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af h1:rAgzfIj9FJtmJ6ZPDlxXX6Fzzix6NOpPTvVmPY5rwQg= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/tools/confix/migrations.go b/tools/confix/migrations.go index 355ac02ea940..fa1e9a2374ad 100644 --- a/tools/confix/migrations.go +++ b/tools/confix/migrations.go @@ -13,7 +13,7 @@ import ( const ( AppConfig = "app.toml" ClientConfig = "client.toml" - TMConfig = "config.toml" + CMTConfig = "config.toml" ) // MigrationMap defines a mapping from a version to a transformation plan. diff --git a/tools/confix/upgrade.go b/tools/confix/upgrade.go index 5afd7c0eeb6c..ab9328350ab3 100644 --- a/tools/confix/upgrade.go +++ b/tools/confix/upgrade.go @@ -94,8 +94,8 @@ func CheckValid(fileName string, data []byte) error { if cfg.ChainID == "" { return errors.New("client config invalid: chain-id is empty") } - case strings.HasSuffix(fileName, TMConfig): - return errors.New("tendermint config is not supported") + case strings.HasSuffix(fileName, CMTConfig): + return errors.New("cometbft config is not supported") default: return fmt.Errorf("unknown config: %s", fileName) diff --git a/tools/confix/upgrade_test.go b/tools/confix/upgrade_test.go index e0b8c49e6a9f..557345469cb0 100644 --- a/tools/confix/upgrade_test.go +++ b/tools/confix/upgrade_test.go @@ -29,7 +29,7 @@ func TestCheckValid(t *testing.T) { assert.ErrorContains(t, err, "unknown config") err = confix.CheckValid("config.toml", mustReadConfig(t, "data/v0.45-app.toml")) - assert.Error(t, err, "tendermint config is not supported") + assert.Error(t, err, "cometbft config is not supported") err = confix.CheckValid("client.toml", mustReadConfig(t, "data/v0.45-app.toml")) assert.Error(t, err, "client config invalid: chain-id is empty") diff --git a/tools/cosmovisor/go.mod b/tools/cosmovisor/go.mod index 117847cc299e..88d6f8b2f2b1 100644 --- a/tools/cosmovisor/go.mod +++ b/tools/cosmovisor/go.mod @@ -3,7 +3,7 @@ module cosmossdk.io/tools/cosmovisor go 1.19 require ( - cosmossdk.io/x/upgrade v0.0.0-20230202115111-f719cd32adf3 + cosmossdk.io/x/upgrade v0.0.0-20230205135133-41a3dfeced29 github.com/otiai10/copy v1.9.0 github.com/rs/zerolog v1.29.0 github.com/spf13/cobra v1.6.1 @@ -22,7 +22,7 @@ require ( cosmossdk.io/depinject v1.0.0-alpha.3 // indirect cosmossdk.io/errors v1.0.0-beta.7 // indirect cosmossdk.io/math v1.0.0-beta.6 // indirect - cosmossdk.io/store v0.0.0-20230204135315-697871069999 // indirect + cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -146,7 +146,7 @@ require ( google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 // indirect google.golang.org/grpc v1.52.3 // indirect - google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a // indirect + google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -156,8 +156,4 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) -// This can be deleted after the CometBFT PR is merged -replace ( - cosmossdk.io/x/upgrade => ../../x/upgrade - github.com/cosmos/cosmos-sdk => ../.. -) +replace github.com/cosmos/cosmos-sdk => ../.. diff --git a/tools/cosmovisor/go.sum b/tools/cosmovisor/go.sum index c3af765081df..1b65cacb2654 100644 --- a/tools/cosmovisor/go.sum +++ b/tools/cosmovisor/go.sum @@ -60,7 +60,11 @@ cosmossdk.io/math v1.0.0-beta.6 h1:WF29SiFYNde5eYvqO2kdOM9nYbDb44j3YW5B8M1m9KE= cosmossdk.io/math v1.0.0-beta.6/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= cosmossdk.io/store v0.0.0-20230204135315-697871069999 h1:NrV990BIbdDngOoTrD3Hg5kqqgvy6c+ETaKGY5bSUmo= cosmossdk.io/store v0.0.0-20230204135315-697871069999/go.mod h1:Sf3G8SV8e8H31CD6w+o2syqCwyaoL0fe244JcPSsaD4= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7/go.mod h1:1XOtuYs7jsfQkn7G3VQXB6I+2tHXKHZw2U/AafNbnlk= cosmossdk.io/x/tx v0.1.0 h1:uyyYVjG22B+jf54N803Z99Y1uPvfuNP3K1YShoCHYL8= +cosmossdk.io/x/upgrade v0.0.0-20230205135133-41a3dfeced29 h1:mNfdHQhb8o356Hh4fzcNV/DAAIUZk44aSGnBq8g5e4U= +cosmossdk.io/x/upgrade v0.0.0-20230205135133-41a3dfeced29/go.mod h1:PnRmqh7/vHliLlTjvSUNB1HuJ6JaB6F5Z/AM2rs7Iis= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -1288,6 +1292,8 @@ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a h1:KJVqJe240LvVd+8lfzRx3hQ0UZ0fyeXEMDMHviRNQKs= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af h1:rAgzfIj9FJtmJ6ZPDlxXX6Fzzix6NOpPTvVmPY5rwQg= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/tools/hubl/go.mod b/tools/hubl/go.mod index 1ed530dd4238..f35c1d71c339 100644 --- a/tools/hubl/go.mod +++ b/tools/hubl/go.mod @@ -4,7 +4,8 @@ go 1.19 require ( cosmossdk.io/api v0.3.0 - cosmossdk.io/client/v2 v2.0.0-20230123200432-0d72b9039a54 + // TODO use a tagged version of client/v2 when client/v2 is tagged with a released SDK version + cosmossdk.io/client/v2 v2.0.0-20230205135133-41a3dfeced29 github.com/cockroachdb/errors v1.9.1 github.com/hashicorp/go-multierror v1.1.1 github.com/manifoldco/promptui v0.9.0 @@ -12,7 +13,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.6.1 google.golang.org/grpc v1.52.3 - google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a + google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af ) require ( @@ -21,7 +22,7 @@ require ( cosmossdk.io/depinject v1.0.0-alpha.3 // indirect cosmossdk.io/errors v1.0.0-beta.7 // indirect cosmossdk.io/math v1.0.0-beta.6 // indirect - cosmossdk.io/store v0.0.0-20230204135315-697871069999 // indirect + cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect diff --git a/tools/hubl/go.sum b/tools/hubl/go.sum index b81127314c0b..4beaaf3bd007 100644 --- a/tools/hubl/go.sum +++ b/tools/hubl/go.sum @@ -37,8 +37,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= cosmossdk.io/api v0.3.0 h1:cxsu79MWJAXqiYANNgcP357BXvm5Tw5ppDr/maOANxw= cosmossdk.io/api v0.3.0/go.mod h1:2HDRQHwVIyklENrrXko0E/waZrRFZWHhPyhcBO4qHq4= -cosmossdk.io/client/v2 v2.0.0-20230123200432-0d72b9039a54 h1:KvSz9SAdkMIW/xJyjfgGf3hFhL5hbYRwDduuouNvoco= -cosmossdk.io/client/v2 v2.0.0-20230123200432-0d72b9039a54/go.mod h1:ECtzZYhZ2rREL6AkuNMCyR6Ir+djK4xCAPbmtEYbBtg= +cosmossdk.io/client/v2 v2.0.0-20230205135133-41a3dfeced29 h1:zDL5HKCykMP2jZq3eSF4mSUtqztdlZV0yDX0MuhN5dw= +cosmossdk.io/client/v2 v2.0.0-20230205135133-41a3dfeced29/go.mod h1:FqDwc8kzB+q00gG+nQ9MLs0JH0onU44wJpJ4UXjL0Ic= cosmossdk.io/collections v0.0.0-20230204135315-697871069999 h1:W4ysiF4Lh9sinMm9uC1LPxad4Wst7Z4Yg0IB3Io2JzA= cosmossdk.io/collections v0.0.0-20230204135315-697871069999/go.mod h1:bFbVPivvFEFlxk7U99CkebYbN9qVZPMOvclR3tyw8ag= cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= @@ -51,6 +51,8 @@ cosmossdk.io/math v1.0.0-beta.6 h1:WF29SiFYNde5eYvqO2kdOM9nYbDb44j3YW5B8M1m9KE= cosmossdk.io/math v1.0.0-beta.6/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= cosmossdk.io/store v0.0.0-20230204135315-697871069999 h1:NrV990BIbdDngOoTrD3Hg5kqqgvy6c+ETaKGY5bSUmo= cosmossdk.io/store v0.0.0-20230204135315-697871069999/go.mod h1:Sf3G8SV8e8H31CD6w+o2syqCwyaoL0fe244JcPSsaD4= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7/go.mod h1:1XOtuYs7jsfQkn7G3VQXB6I+2tHXKHZw2U/AafNbnlk= cosmossdk.io/x/tx v0.1.0 h1:uyyYVjG22B+jf54N803Z99Y1uPvfuNP3K1YShoCHYL8= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= @@ -959,6 +961,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a h1:KJVqJe240LvVd+8lfzRx3hQ0UZ0fyeXEMDMHviRNQKs= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af h1:rAgzfIj9FJtmJ6ZPDlxXX6Fzzix6NOpPTvVmPY5rwQg= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/tools/rosetta/client_online.go b/tools/rosetta/client_online.go index 677fbd2c59eb..c89f6c2cfc47 100644 --- a/tools/rosetta/client_online.go +++ b/tools/rosetta/client_online.go @@ -265,7 +265,7 @@ func (c *Client) coins(ctx context.Context) (sdk.Coins, error) { // get next key page := supply.GetPagination() if page == nil { - return nil, crgerrs.WrapError(crgerrs.ErrCodec, fmt.Sprintf("error pagination")) + return nil, crgerrs.WrapError(crgerrs.ErrCodec, "error pagination") } nextKey := page.GetNextKey() diff --git a/tools/rosetta/config.go b/tools/rosetta/config.go index 6b549387aa03..98d6d93e10fc 100644 --- a/tools/rosetta/config.go +++ b/tools/rosetta/config.go @@ -63,7 +63,7 @@ type Config struct { // Network defines the network name Network string // TendermintRPC defines the endpoint to connect to - // tendermint RPC, specifying 'tcp://' before is not + // CometBFT RPC, specifying 'tcp://' before is not // required, usually it's at port 26657 of the TendermintRPC string // GRPCEndpoint defines the cosmos application gRPC endpoint @@ -140,7 +140,7 @@ func (c *Config) validate() error { return fmt.Errorf("grpc endpoint not provided") } if c.TendermintRPC == "" { - return fmt.Errorf("tendermint rpc not provided") + return fmt.Errorf("cometbft rpc not provided") } if !strings.HasPrefix(c.TendermintRPC, "tcp://") { c.TendermintRPC = fmt.Sprintf("tcp://%s", c.TendermintRPC) @@ -257,7 +257,7 @@ func ServerFromConfig(conf *Config) (crg.Server, error) { func SetFlags(flags *pflag.FlagSet) { flags.String(FlagBlockchain, DefaultBlockchain, "the blockchain type") flags.String(FlagNetwork, DefaultNetwork, "the network name") - flags.String(FlagTendermintEndpoint, DefaultTendermintEndpoint, "the tendermint rpc endpoint, without tcp://") + flags.String(FlagTendermintEndpoint, DefaultTendermintEndpoint, "the cometbft rpc endpoint, without tcp://") flags.String(FlagGRPCEndpoint, DefaultGRPCEndpoint, "the app gRPC endpoint") flags.String(FlagAddr, DefaultAddr, "the address rosetta will bind to") flags.Int(FlagRetries, DefaultRetries, "the number of retries that will be done before quitting") diff --git a/tools/rosetta/converter.go b/tools/rosetta/converter.go index 481dae324d6f..7fc22c071869 100644 --- a/tools/rosetta/converter.go +++ b/tools/rosetta/converter.go @@ -14,7 +14,7 @@ import ( abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/crypto" tmcoretypes "github.com/cometbft/cometbft/rpc/core/types" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" sdkclient "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -29,25 +29,25 @@ import ( ) // Converter is a utility that can be used to convert -// back and forth from rosetta to sdk and tendermint types +// back and forth from rosetta to sdk and CometBFT types // IMPORTANT NOTES: // - IT SHOULD BE USED ONLY TO DEAL WITH THINGS // IN A STATELESS WAY! IT SHOULD NEVER INTERACT DIRECTLY -// WITH TENDERMINT RPC AND COSMOS GRPC +// WITH COMETBFT RPC AND COSMOS GRPC // // - IT SHOULD RETURN cosmos rosetta gateway error types! type Converter interface { // ToSDK exposes the methods that convert - // rosetta types to cosmos sdk and tendermint types + // rosetta types to cosmos sdk and CometBFT types ToSDK() ToSDKConverter // ToRosetta exposes the methods that convert - // sdk and tendermint types to rosetta types + // sdk and CometBFT types to rosetta types ToRosetta() ToRosettaConverter } // ToRosettaConverter is an interface that exposes // all the functions used to convert sdk and -// tendermint types to rosetta known types +// CometBFT types to rosetta known types type ToRosettaConverter interface { // BlockResponse returns a block response given a result block BlockResponse(block *tmcoretypes.ResultBlock) crgtypes.BlockResponse @@ -67,21 +67,21 @@ type ToRosettaConverter interface { SignerData(anyAccount *codectypes.Any) (*SignerData, error) // SigningComponents returns rosetta's components required to build a signable transaction SigningComponents(tx authsigning.Tx, metadata *ConstructionMetadata, rosPubKeys []*rosettatypes.PublicKey) (txBytes []byte, payloadsToSign []*rosettatypes.SigningPayload, err error) - // Tx converts a tendermint transaction and tx result if provided to a rosetta tx - Tx(rawTx tmtypes.Tx, txResult *abci.ResponseDeliverTx) (*rosettatypes.Transaction, error) - // TxIdentifiers converts a tendermint tx to transaction identifiers - TxIdentifiers(txs []tmtypes.Tx) []*rosettatypes.TransactionIdentifier + // Tx converts a CometBFT transaction and tx result if provided to a rosetta tx + Tx(rawTx cmttypes.Tx, txResult *abci.ResponseDeliverTx) (*rosettatypes.Transaction, error) + // TxIdentifiers converts a CometBFT tx to transaction identifiers + TxIdentifiers(txs []cmttypes.Tx) []*rosettatypes.TransactionIdentifier // BalanceOps converts events to balance operations BalanceOps(status string, events []abci.Event) []*rosettatypes.Operation - // SyncStatus converts a tendermint status to sync status + // SyncStatus converts a CometBFT status to sync status SyncStatus(status *tmcoretypes.ResultStatus) *rosettatypes.SyncStatus - // Peers converts tendermint peers to rosetta + // Peers converts CometBFT peers to rosetta Peers(peers []tmcoretypes.Peer) []*rosettatypes.Peer } // ToSDKConverter is an interface that exposes // all the functions used to convert rosetta types -// to tendermint and sdk types +// to CometBFT and sdk types type ToSDKConverter interface { // UnsignedTx converts rosetta operations to an unsigned cosmos sdk transactions UnsignedTx(ops []*rosettatypes.Operation) (tx authsigning.Tx, err error) @@ -258,8 +258,8 @@ func (c converter) Ops(status string, msg sdk.Msg) ([]*rosettatypes.Operation, e return ops, nil } -// Tx converts a tendermint raw transaction and its result (if provided) to a rosetta transaction -func (c converter) Tx(rawTx tmtypes.Tx, txResult *abci.ResponseDeliverTx) (*rosettatypes.Transaction, error) { +// Tx converts a CometBFT raw transaction and its result (if provided) to a rosetta transaction +func (c converter) Tx(rawTx cmttypes.Tx, txResult *abci.ResponseDeliverTx) (*rosettatypes.Transaction, error) { // decode tx tx, err := c.txDecode(rawTx) if err != nil { @@ -500,7 +500,7 @@ func (c converter) HashToTxType(hashBytes []byte) (txType TransactionType, realH } } -// StatusToSyncStatus converts a tendermint status to rosetta sync status +// StatusToSyncStatus converts a CometBFT status to rosetta sync status func (c converter) SyncStatus(status *tmcoretypes.ResultStatus) *rosettatypes.SyncStatus { // determine sync status stage := StatusPeerSynced @@ -515,8 +515,8 @@ func (c converter) SyncStatus(status *tmcoretypes.ResultStatus) *rosettatypes.Sy } } -// TxIdentifiers converts a tendermint raw transactions into an array of rosetta tx identifiers -func (c converter) TxIdentifiers(txs []tmtypes.Tx) []*rosettatypes.TransactionIdentifier { +// TxIdentifiers converts a CometBFT raw transactions into an array of rosetta tx identifiers +func (c converter) TxIdentifiers(txs []cmttypes.Tx) []*rosettatypes.TransactionIdentifier { converted := make([]*rosettatypes.TransactionIdentifier, len(txs)) for i, tx := range txs { converted[i] = &rosettatypes.TransactionIdentifier{Hash: fmt.Sprintf("%X", tx.Hash())} @@ -525,7 +525,7 @@ func (c converter) TxIdentifiers(txs []tmtypes.Tx) []*rosettatypes.TransactionId return converted } -// tmResultBlockToRosettaBlockResponse converts a tendermint result block to block response +// tmResultBlockToRosettaBlockResponse converts a CometBFT result block to block response func (c converter) BlockResponse(block *tmcoretypes.ResultBlock) crgtypes.BlockResponse { var parentBlock *rosettatypes.BlockIdentifier diff --git a/tools/rosetta/converter_test.go b/tools/rosetta/converter_test.go index 44caf03e901f..4a30d9b793c4 100644 --- a/tools/rosetta/converter_test.go +++ b/tools/rosetta/converter_test.go @@ -119,7 +119,6 @@ func (s *ConverterTestSuite) TestMsgToMetaMetaToMsg() { ToAddress: "addr2", Amount: sdk.NewCoins(sdk.NewInt64Coin("test", 10)), } - msg.Route() meta, err := s.c.ToRosetta().Meta(msg) s.Require().NoError(err) diff --git a/tools/rosetta/go.mod b/tools/rosetta/go.mod index adcdf9d921ec..476feca97848 100644 --- a/tools/rosetta/go.mod +++ b/tools/rosetta/go.mod @@ -7,7 +7,8 @@ require ( github.com/btcsuite/btcd/btcec/v2 v2.3.2 github.com/coinbase/rosetta-sdk-go/types v1.0.0 github.com/cometbft/cometbft v0.0.0-20230203130311-387422ac220d - github.com/cosmos/cosmos-sdk v0.47.0-rc2 + // TODO to replace by a tagged version of the SDK (with CometBFT) when available + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230205135133-41a3dfeced29 github.com/cosmos/rosetta-sdk-go v0.10.0 github.com/rs/zerolog v1.29.0 github.com/spf13/cobra v1.6.1 @@ -22,7 +23,7 @@ require ( cosmossdk.io/core v0.5.1 // indirect cosmossdk.io/depinject v1.0.0-alpha.3 // indirect cosmossdk.io/errors v1.0.0-beta.7 // indirect - cosmossdk.io/store v0.0.0-20230204135315-697871069999 // indirect + cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 // indirect cosmossdk.io/x/tx v0.1.0 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -123,7 +124,7 @@ require ( golang.org/x/term v0.4.0 // indirect golang.org/x/text v0.6.0 // indirect google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 // indirect - google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a // indirect + google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -132,6 +133,3 @@ require ( pgregory.net/rapid v0.5.5 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) - -// This can be deleted after the CometBFT PR is merged -replace github.com/cosmos/cosmos-sdk => ../.. diff --git a/tools/rosetta/go.sum b/tools/rosetta/go.sum index f1a80de7a1ec..27506f2a0fd3 100644 --- a/tools/rosetta/go.sum +++ b/tools/rosetta/go.sum @@ -49,6 +49,8 @@ cosmossdk.io/math v1.0.0-beta.6 h1:WF29SiFYNde5eYvqO2kdOM9nYbDb44j3YW5B8M1m9KE= cosmossdk.io/math v1.0.0-beta.6/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= cosmossdk.io/store v0.0.0-20230204135315-697871069999 h1:NrV990BIbdDngOoTrD3Hg5kqqgvy6c+ETaKGY5bSUmo= cosmossdk.io/store v0.0.0-20230204135315-697871069999/go.mod h1:Sf3G8SV8e8H31CD6w+o2syqCwyaoL0fe244JcPSsaD4= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7/go.mod h1:1XOtuYs7jsfQkn7G3VQXB6I+2tHXKHZw2U/AafNbnlk= cosmossdk.io/x/tx v0.1.0 h1:uyyYVjG22B+jf54N803Z99Y1uPvfuNP3K1YShoCHYL8= cosmossdk.io/x/tx v0.1.0/go.mod h1:qsDv7e1fSftkF16kpSAk+7ROOojyj+SC0Mz3ukI52EQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -168,6 +170,8 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9 github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso= github.com/cosmos/cosmos-proto v1.0.0-beta.1 h1:iDL5qh++NoXxG8hSy93FdYJut4XfgbShIocllGaXx/0= github.com/cosmos/cosmos-proto v1.0.0-beta.1/go.mod h1:8k2GNZghi5sDRFw/scPL8gMSowT1vDA+5ouxL8GjaUE= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230205135133-41a3dfeced29 h1:HJIOs0YfTumgmw8MU1QIiCHO+tz2IWoLpXNOXzLJqnE= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230205135133-41a3dfeced29/go.mod h1:9dul7UbanQCWIiz4b6FZ8QcKKU28EMgvXVNCTcc6Ivk= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -1225,6 +1229,8 @@ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a h1:KJVqJe240LvVd+8lfzRx3hQ0UZ0fyeXEMDMHviRNQKs= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af h1:rAgzfIj9FJtmJ6ZPDlxXX6Fzzix6NOpPTvVmPY5rwQg= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/tools/rosetta/lib/errors/errors.go b/tools/rosetta/lib/errors/errors.go index 8d659f075757..81e939c8c9ba 100644 --- a/tools/rosetta/lib/errors/errors.go +++ b/tools/rosetta/lib/errors/errors.go @@ -11,7 +11,7 @@ import ( grpcstatus "google.golang.org/grpc/status" "github.com/coinbase/rosetta-sdk-go/types" - tmtypes "github.com/cometbft/cometbft/rpc/jsonrpc/types" + cmttypes "github.com/cometbft/cometbft/rpc/jsonrpc/types" ) // ListErrors lists all the registered errors @@ -72,7 +72,7 @@ func ToRosetta(err error) *types.Error { // if it's null or not known rosErr, ok := err.(*Error) if rosErr == nil || !ok { - tmErr, ok := err.(*tmtypes.RPCError) + tmErr, ok := err.(*cmttypes.RPCError) if tmErr != nil && ok { return fromTendermintToRosettaError(tmErr).rosErr } @@ -82,7 +82,7 @@ func ToRosetta(err error) *types.Error { } // fromTendermintToRosettaError converts a tendermint jsonrpc error to rosetta error -func fromTendermintToRosettaError(err *tmtypes.RPCError) *Error { +func fromTendermintToRosettaError(err *cmttypes.RPCError) *Error { return &Error{rosErr: &types.Error{ Code: http.StatusInternalServerError, Message: err.Message, diff --git a/tools/rosetta/lib/errors/errors_test.go b/tools/rosetta/lib/errors/errors_test.go index 2f85042eb567..1b35d6a20bcb 100644 --- a/tools/rosetta/lib/errors/errors_test.go +++ b/tools/rosetta/lib/errors/errors_test.go @@ -3,7 +3,7 @@ package errors import ( "testing" - tmtypes "github.com/cometbft/cometbft/rpc/jsonrpc/types" + cmttypes "github.com/cometbft/cometbft/rpc/jsonrpc/types" "github.com/stretchr/testify/assert" ) @@ -57,7 +57,7 @@ func TestToRosetta(t *testing.T) { // wrong type assert.NotNil(t, ToRosetta(&MyError{})) - tmErr := &tmtypes.RPCError{} + tmErr := &cmttypes.RPCError{} // RpcError case assert.NotNil(t, ToRosetta(tmErr)) } diff --git a/types/context.go b/types/context.go index f4fe78ad7c5e..9b707640fe3a 100644 --- a/types/context.go +++ b/types/context.go @@ -5,9 +5,9 @@ import ( "time" abci "github.com/cometbft/cometbft/abci/types" - tmbytes "github.com/cometbft/cometbft/libs/bytes" + cmtbytes "github.com/cometbft/cometbft/libs/bytes" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/gogoproto/proto" "cosmossdk.io/store/gaskv" @@ -25,8 +25,8 @@ and standard additions here would be better just to add to the Context struct type Context struct { baseCtx context.Context ms storetypes.MultiStore - header tmproto.Header - headerHash tmbytes.HexBytes + header cmtproto.Header + headerHash cmtbytes.HexBytes chainID string txBytes []byte logger log.Logger @@ -36,7 +36,7 @@ type Context struct { checkTx bool recheckTx bool // if recheckTx == true, then checkTx must also be true minGasPrice DecCoins - consParams *tmproto.ConsensusParams + consParams *cmtproto.ConsensusParams eventManager EventManagerI priority int64 // The tx priority, only relevant in CheckTx kvGasConfig storetypes.GasConfig @@ -66,20 +66,20 @@ func (c Context) KVGasConfig() storetypes.GasConfig { return c.kvGasCon func (c Context) TransientKVGasConfig() storetypes.GasConfig { return c.transientKVGasConfig } // clone the header before returning -func (c Context) BlockHeader() tmproto.Header { - msg := proto.Clone(&c.header).(*tmproto.Header) +func (c Context) BlockHeader() cmtproto.Header { + msg := proto.Clone(&c.header).(*cmtproto.Header) return *msg } // HeaderHash returns a copy of the header hash obtained during abci.RequestBeginBlock -func (c Context) HeaderHash() tmbytes.HexBytes { +func (c Context) HeaderHash() cmtbytes.HexBytes { hash := make([]byte, len(c.headerHash)) copy(hash, c.headerHash) return hash } -func (c Context) ConsensusParams() *tmproto.ConsensusParams { - return proto.Clone(c.consParams).(*tmproto.ConsensusParams) +func (c Context) ConsensusParams() *cmtproto.ConsensusParams { + return proto.Clone(c.consParams).(*cmtproto.ConsensusParams) } func (c Context) Deadline() (deadline time.Time, ok bool) { @@ -95,7 +95,7 @@ func (c Context) Err() error { } // create a new context -func NewContext(ms storetypes.MultiStore, header tmproto.Header, isCheckTx bool, logger log.Logger) Context { +func NewContext(ms storetypes.MultiStore, header cmtproto.Header, isCheckTx bool, logger log.Logger) Context { // https://github.com/gogo/protobuf/issues/519 header.Time = header.Time.UTC() return Context{ @@ -125,15 +125,15 @@ func (c Context) WithMultiStore(ms storetypes.MultiStore) Context { return c } -// WithBlockHeader returns a Context with an updated tendermint block header in UTC time. -func (c Context) WithBlockHeader(header tmproto.Header) Context { +// WithBlockHeader returns a Context with an updated CometBFT block header in UTC time. +func (c Context) WithBlockHeader(header cmtproto.Header) Context { // https://github.com/gogo/protobuf/issues/519 header.Time = header.Time.UTC() c.header = header return c } -// WithHeaderHash returns a Context with an updated tendermint block header hash. +// WithHeaderHash returns a Context with an updated CometBFT block header hash. func (c Context) WithHeaderHash(hash []byte) Context { temp := make([]byte, len(hash)) copy(temp, hash) @@ -142,7 +142,7 @@ func (c Context) WithHeaderHash(hash []byte) Context { return c } -// WithBlockTime returns a Context with an updated tendermint block header time in UTC time +// WithBlockTime returns a Context with an updated CometBFT block header time in UTC time func (c Context) WithBlockTime(newTime time.Time) Context { newHeader := c.BlockHeader() // https://github.com/gogo/protobuf/issues/519 @@ -237,7 +237,7 @@ func (c Context) WithMinGasPrices(gasPrices DecCoins) Context { } // WithConsensusParams returns a Context with an updated consensus params -func (c Context) WithConsensusParams(params *tmproto.ConsensusParams) Context { +func (c Context) WithConsensusParams(params *cmtproto.ConsensusParams) Context { c.consParams = params return c } diff --git a/types/context_test.go b/types/context_test.go index c9dcb28e1416..746e2bc364b2 100644 --- a/types/context_test.go +++ b/types/context_test.go @@ -6,7 +6,7 @@ import ( "time" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" @@ -83,7 +83,7 @@ func (s *contextTestSuite) TestContextWithCustom() { ctrl := gomock.NewController(s.T()) s.T().Cleanup(ctrl.Finish) - header := tmproto.Header{} + header := cmtproto.Header{} height := int64(1) chainid := "chainid" ischeck := true @@ -134,7 +134,7 @@ func (s *contextTestSuite) TestContextWithCustom() { // test consensus param s.Require().Nil(ctx.ConsensusParams()) - cp := &tmproto.ConsensusParams{} + cp := &cmtproto.ConsensusParams{} s.Require().Equal(cp, ctx.WithConsensusParams(cp).ConsensusParams()) // test inner context @@ -151,7 +151,7 @@ func (s *contextTestSuite) TestContextHeader() { addr := secp256k1.GenPrivKey().PubKey().Address() proposer := types.ConsAddress(addr) - ctx = types.NewContext(nil, tmproto.Header{}, false, nil) + ctx = types.NewContext(nil, cmtproto.Header{}, false, nil) ctx = ctx. WithBlockHeight(height). @@ -165,35 +165,35 @@ func (s *contextTestSuite) TestContextHeader() { func (s *contextTestSuite) TestContextHeaderClone() { cases := map[string]struct { - h tmproto.Header + h cmtproto.Header }{ "empty": { - h: tmproto.Header{}, + h: cmtproto.Header{}, }, "height": { - h: tmproto.Header{ + h: cmtproto.Header{ Height: 77, }, }, "time": { - h: tmproto.Header{ + h: cmtproto.Header{ Time: time.Unix(12345677, 12345), }, }, "zero time": { - h: tmproto.Header{ + h: cmtproto.Header{ Time: time.Unix(0, 0), }, }, "many items": { - h: tmproto.Header{ + h: cmtproto.Header{ Height: 823, Time: time.Unix(9999999999, 0), ChainID: "silly-demo", }, }, "many items with hash": { - h: tmproto.Header{ + h: cmtproto.Header{ Height: 823, Time: time.Unix(9999999999, 0), ChainID: "silly-demo", @@ -220,7 +220,7 @@ func (s *contextTestSuite) TestContextHeaderClone() { } func (s *contextTestSuite) TestUnwrapSDKContext() { - sdkCtx := types.NewContext(nil, tmproto.Header{}, false, nil) + sdkCtx := types.NewContext(nil, cmtproto.Header{}, false, nil) ctx := types.WrapSDKContext(sdkCtx) sdkCtx2 := types.UnwrapSDKContext(ctx) s.Require().Equal(sdkCtx, sdkCtx2) diff --git a/types/mempool/mempool_test.go b/types/mempool/mempool_test.go index f28ef450b2bf..744ff066df3d 100644 --- a/types/mempool/mempool_test.go +++ b/types/mempool/mempool_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -126,7 +126,7 @@ func fetchTxs(iterator mempool.Iterator, maxBytes int64) []sdk.Tx { func (s *MempoolTestSuite) TestDefaultMempool() { t := s.T() - ctx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) accounts := simtypes.RandomAccounts(rand.New(rand.NewSource(0)), 10) txCount := 1000 var txs []testTx @@ -218,7 +218,7 @@ func TestMempoolTestSuite(t *testing.T) { } func (s *MempoolTestSuite) TestSampleTxs() { - ctxt := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) + ctxt := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) t := s.T() s.resetMempool() mp := s.mempool diff --git a/types/mempool/priority_nonce_test.go b/types/mempool/priority_nonce_test.go index a2493a7d12b4..5ae4b90d4db2 100644 --- a/types/mempool/priority_nonce_test.go +++ b/types/mempool/priority_nonce_test.go @@ -8,7 +8,7 @@ import ( "time" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -61,7 +61,7 @@ func TestOutOfOrder(t *testing.T) { func (s *MempoolTestSuite) TestPriorityNonceTxOrder() { t := s.T() - ctx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) accounts := simtypes.RandomAccounts(rand.New(rand.NewSource(0)), 5) sa := accounts[0].Address sb := accounts[1].Address @@ -258,7 +258,7 @@ func (s *MempoolTestSuite) TestPriorityNonceTxOrder() { } func (s *MempoolTestSuite) TestPriorityTies() { - ctx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) accounts := simtypes.RandomAccounts(rand.New(rand.NewSource(0)), 3) sa := accounts[0].Address sb := accounts[1].Address @@ -375,7 +375,7 @@ func (s *MempoolTestSuite) TestRandomGeneratedTxs() { s.iterations++ })) t := s.T() - ctx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) seed := time.Now().UnixNano() t.Logf("running with seed: %d", seed) @@ -411,7 +411,7 @@ func (s *MempoolTestSuite) TestRandomWalkTxs() { s.mempool = mempool.NewPriorityMempool() t := s.T() - ctx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) seed := time.Now().UnixNano() // interesting failing seeds: @@ -584,7 +584,7 @@ func TestTxOrderN(t *testing.T) { func TestTxLimit(t *testing.T) { accounts := simtypes.RandomAccounts(rand.New(rand.NewSource(0)), 2) - ctx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) sa := accounts[0].Address sb := accounts[1].Address @@ -641,7 +641,7 @@ func TestTxLimit(t *testing.T) { func TestTxReplacement(t *testing.T) { accounts := simtypes.RandomAccounts(rand.New(rand.NewSource(0)), 1) - ctx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) sa := accounts[0].Address txs := []testTx{ diff --git a/types/mempool/sender_nonce_property_test.go b/types/mempool/sender_nonce_property_test.go index 6930e6aa1a96..cf471a21e06c 100644 --- a/types/mempool/sender_nonce_property_test.go +++ b/types/mempool/sender_nonce_property_test.go @@ -6,7 +6,7 @@ import ( "pgregory.net/rapid" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" mempool "github.com/cosmos/cosmos-sdk/types/mempool" @@ -33,7 +33,7 @@ func AddressGenerator(t *rapid.T) *rapid.Generator[sdk.AccAddress] { } func testMempoolProperties(t *rapid.T) { - ctx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) mp := mempool.NewSenderNonceMempool() genMultipleAddress := rapid.SliceOfNDistinct(AddressGenerator(t), 1, 10, func(acc sdk.AccAddress) string { diff --git a/types/mempool/sender_nonce_test.go b/types/mempool/sender_nonce_test.go index 42f13be622aa..69a21a10a6c4 100644 --- a/types/mempool/sender_nonce_test.go +++ b/types/mempool/sender_nonce_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -16,7 +16,7 @@ import ( func (s *MempoolTestSuite) TestTxOrder() { t := s.T() - ctx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) accounts := simtypes.RandomAccounts(rand.New(rand.NewSource(0)), 5) sa := accounts[0].Address sb := accounts[1].Address @@ -140,7 +140,7 @@ func (s *MempoolTestSuite) TestTxOrder() { func (s *MempoolTestSuite) TestMaxTx() { t := s.T() - ctx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) accounts := simtypes.RandomAccounts(rand.New(rand.NewSource(0)), 1) mp := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(1)) @@ -170,7 +170,7 @@ func (s *MempoolTestSuite) TestMaxTx() { func (s *MempoolTestSuite) TestTxNotFoundOnSender() { t := s.T() - ctx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) accounts := simtypes.RandomAccounts(rand.New(rand.NewSource(0)), 1) mp := mempool.NewSenderNonceMempool() diff --git a/types/module/module_test.go b/types/module/module_test.go index 43d885d0bec8..e77e21fa2071 100644 --- a/types/module/module_test.go +++ b/types/module/module_test.go @@ -10,7 +10,7 @@ import ( "cosmossdk.io/core/appmodule" abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/golang/mock/gomock" "github.com/spf13/cobra" "github.com/stretchr/testify/require" @@ -187,7 +187,7 @@ func TestManager_InitGenesis(t *testing.T) { require.NotNil(t, mm) require.Equal(t, 3, len(mm.Modules)) - ctx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) interfaceRegistry := types.NewInterfaceRegistry() cdc := codec.NewProtoCodec(interfaceRegistry) genesisData := map[string]json.RawMessage{"module1": json.RawMessage(`{"key": "value"}`)} @@ -231,7 +231,7 @@ func TestManager_ExportGenesis(t *testing.T) { require.NotNil(t, mm) require.Equal(t, 3, len(mm.Modules)) - ctx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) interfaceRegistry := types.NewInterfaceRegistry() cdc := codec.NewProtoCodec(interfaceRegistry) mockAppModule1.EXPECT().ExportGenesis(gomock.Eq(ctx), gomock.Eq(cdc)).AnyTimes().Return(json.RawMessage(`{"key1": "value1"}`)) @@ -339,7 +339,7 @@ func TestCoreAPIManager_InitGenesis(t *testing.T) { require.NotNil(t, mm) require.Equal(t, 1, len(mm.Modules)) - ctx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) interfaceRegistry := types.NewInterfaceRegistry() cdc := codec.NewProtoCodec(interfaceRegistry) genesisData := map[string]json.RawMessage{"module1": json.RawMessage(`{"key": "value"}`)} @@ -363,7 +363,7 @@ func TestCoreAPIManager_ExportGenesis(t *testing.T) { require.NotNil(t, mm) require.Equal(t, 2, len(mm.Modules)) - ctx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) interfaceRegistry := types.NewInterfaceRegistry() cdc := codec.NewProtoCodec(interfaceRegistry) want := map[string]json.RawMessage{ diff --git a/types/query/pagination_test.go b/types/query/pagination_test.go index 568f9e026eaf..025806e05b88 100644 --- a/types/query/pagination_test.go +++ b/types/query/pagination_test.go @@ -6,7 +6,7 @@ import ( "testing" "cosmossdk.io/math" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/suite" "cosmossdk.io/store/prefix" @@ -76,7 +76,7 @@ func (s *paginationTestSuite) SetupTest() { s.NoError(err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{Height: 1}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{Height: 1}) s.ctx, s.bankKeeper, s.accountKeeper, s.cdc, s.app, s.interfaceReg = ctx, bankKeeper, accountKeeper, cdc, app, reg } diff --git a/x/auth/ante/sigverify_benchmark_test.go b/x/auth/ante/sigverify_benchmark_test.go index 9094eabf2e30..b598e6df1888 100644 --- a/x/auth/ante/sigverify_benchmark_test.go +++ b/x/auth/ante/sigverify_benchmark_test.go @@ -3,7 +3,7 @@ package ante_test import ( "testing" - tmcrypto "github.com/cometbft/cometbft/crypto" + cmtcrypto "github.com/cometbft/cometbft/crypto" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -13,7 +13,7 @@ import ( // This benchmark is used to asses the ante.Secp256k1ToR1GasFactor value func BenchmarkSig(b *testing.B) { require := require.New(b) - msg := tmcrypto.CRandBytes(1000) + msg := cmtcrypto.CRandBytes(1000) skK := secp256k1.GenPrivKey() pkK := skK.PubKey() diff --git a/x/auth/ante/testutil_test.go b/x/auth/ante/testutil_test.go index da214d0f0a5b..1730974bd5bb 100644 --- a/x/auth/ante/testutil_test.go +++ b/x/auth/ante/testutil_test.go @@ -64,7 +64,7 @@ func SetupTestSuite(t *testing.T, isCheckTx bool) *AnteTestSuite { key := storetypes.NewKVStoreKey(types.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) - suite.ctx = testCtx.Ctx.WithIsCheckTx(isCheckTx).WithBlockHeight(1) // app.BaseApp.NewContext(isCheckTx, tmproto.Header{}).WithBlockHeight(1) + suite.ctx = testCtx.Ctx.WithIsCheckTx(isCheckTx).WithBlockHeight(1) // app.BaseApp.NewContext(isCheckTx, cmtproto.Header{}).WithBlockHeight(1) suite.encCfg = moduletestutil.MakeTestEncodingConfig(auth.AppModuleBasic{}, bank.AppModuleBasic{}) maccPerms := map[string][]string{ @@ -89,7 +89,7 @@ func SetupTestSuite(t *testing.T, isCheckTx bool) *AnteTestSuite { suite.clientCtx = client.Context{}. WithTxConfig(suite.encCfg.TxConfig). - WithClient(clitestutil.NewMockTendermintRPC(abci.ResponseQuery{})) + WithClient(clitestutil.NewMockCometRPC(abci.ResponseQuery{})) anteHandler, err := ante.NewAnteHandler( ante.HandlerOptions{ diff --git a/x/auth/client/cli/query.go b/x/auth/client/cli/query.go index a48fdbd20bd0..5f7ba3a6f856 100644 --- a/x/auth/client/cli/query.go +++ b/x/auth/client/cli/query.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" @@ -297,7 +297,7 @@ $ %s query txs --%s 'message.sender=cosmos1...&message.action=withdraw_delegator } tokens := strings.Split(event, "=") - if tokens[0] == tmtypes.TxHeightKey { + if tokens[0] == cmttypes.TxHeightKey { event = fmt.Sprintf("%s=%s", tokens[0], tokens[1]) } else { event = fmt.Sprintf("%s='%s'", tokens[0], tokens[1]) diff --git a/x/auth/client/cli/suite_test.go b/x/auth/client/cli/suite_test.go index d4abb9fa6059..1d8a106aacb8 100644 --- a/x/auth/client/cli/suite_test.go +++ b/x/auth/client/cli/suite_test.go @@ -59,7 +59,7 @@ func (s *CLITestSuite) SetupSuite() { WithKeyring(s.kr). WithTxConfig(s.encCfg.TxConfig). WithCodec(s.encCfg.Codec). - WithClient(clitestutil.MockTendermintRPC{Client: rpcclientmock.Client{}}). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). WithAccountRetriever(client.MockAccountRetriever{}). WithOutput(io.Discard). WithChainID("test-chain") @@ -67,7 +67,7 @@ func (s *CLITestSuite) SetupSuite() { var outBuf bytes.Buffer ctxGen := func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) diff --git a/x/auth/client/testutil/helpers.go b/x/auth/client/testutil/helpers.go index 954bb0f6a1bf..cbaff7f77a0f 100644 --- a/x/auth/client/testutil/helpers.go +++ b/x/auth/client/testutil/helpers.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - tmcli "github.com/cometbft/cometbft/libs/cli" + cmtcli "github.com/cometbft/cometbft/libs/cli" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -23,7 +23,7 @@ func TxSignExec(clientCtx client.Context, from fmt.Stringer, filename string, ex } cmd := cli.GetSignCommand() - tmcli.PrepareBaseCmd(cmd, "", "") + cmtcli.PrepareBaseCmd(cmd, "", "") return clitestutil.ExecTestCLICmd(clientCtx, cmd, append(args, extraArgs...)) } @@ -92,7 +92,7 @@ func TxAuxToFeeExec(clientCtx client.Context, filename string, extraArgs ...stri } func QueryAccountExec(clientCtx client.Context, address fmt.Stringer, extraArgs ...string) (testutil.BufferWriter, error) { - args := []string{address.String(), fmt.Sprintf("--%s=json", tmcli.OutputFlag)} + args := []string{address.String(), fmt.Sprintf("--%s=json", cmtcli.OutputFlag)} return clitestutil.ExecTestCLICmd(clientCtx, cli.GetAccountCmd(), append(args, extraArgs...)) } diff --git a/x/auth/keeper/deterministic_test.go b/x/auth/keeper/deterministic_test.go index 50045d73dd1a..e756f6075fda 100644 --- a/x/auth/keeper/deterministic_test.go +++ b/x/auth/keeper/deterministic_test.go @@ -5,7 +5,7 @@ import ( "sort" "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/suite" "pgregory.net/rapid" @@ -49,7 +49,7 @@ func (suite *DeterministicTestSuite) SetupTest() { suite.Require() key := storetypes.NewKVStoreKey(types.StoreKey) testCtx := testutil.DefaultContextWithDB(suite.T(), key, storetypes.NewTransientStoreKey("transient_test")) - suite.ctx = testCtx.Ctx.WithBlockHeader(tmproto.Header{}) + suite.ctx = testCtx.Ctx.WithBlockHeader(cmtproto.Header{}) maccPerms := map[string][]string{ "fee_collector": nil, diff --git a/x/auth/keeper/keeper_bench_test.go b/x/auth/keeper/keeper_bench_test.go index ab3d6140625e..b493ca863024 100644 --- a/x/auth/keeper/keeper_bench_test.go +++ b/x/auth/keeper/keeper_bench_test.go @@ -3,7 +3,7 @@ package keeper_test import ( "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/keeper" @@ -17,7 +17,7 @@ func BenchmarkAccountMapperGetAccountFound(b *testing.B) { app, err := simtestutil.Setup(testutil.AppConfig, &accountKeeper) require.NoError(b, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) // assumes b.N < 2**24 for i := 0; i < b.N; i++ { @@ -40,7 +40,7 @@ func BenchmarkAccountMapperSetAccount(b *testing.B) { app, err := simtestutil.Setup(testutil.AppConfig, &accountKeeper) require.NoError(b, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) b.ResetTimer() diff --git a/x/auth/keeper/keeper_test.go b/x/auth/keeper/keeper_test.go index cc351cde1879..94a6744596ff 100644 --- a/x/auth/keeper/keeper_test.go +++ b/x/auth/keeper/keeper_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/suite" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" storetypes "cosmossdk.io/store/types" @@ -47,7 +47,7 @@ func (suite *KeeperTestSuite) SetupTest() { key := storetypes.NewKVStoreKey(types.StoreKey) testCtx := testutil.DefaultContextWithDB(suite.T(), key, storetypes.NewTransientStoreKey("transient_test")) - suite.ctx = testCtx.Ctx.WithBlockHeader(tmproto.Header{}) + suite.ctx = testCtx.Ctx.WithBlockHeader(cmtproto.Header{}) maccPerms := map[string][]string{ "fee_collector": nil, diff --git a/x/auth/migrations/legacytx/stdtx_test.go b/x/auth/migrations/legacytx/stdtx_test.go index 1c60a4c96d6a..1dab54293082 100644 --- a/x/auth/migrations/legacytx/stdtx_test.go +++ b/x/auth/migrations/legacytx/stdtx_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec" @@ -150,7 +150,7 @@ func TestStdSignBytes(t *testing.T) { } func TestTxValidateBasic(t *testing.T) { - ctx := sdk.NewContext(nil, tmproto.Header{ChainID: "mychainid"}, false, log.NewNopLogger()) + ctx := sdk.NewContext(nil, cmtproto.Header{ChainID: "mychainid"}, false, log.NewNopLogger()) // keys and addresses priv1, _, addr1 := testdata.KeyTestPubAddr() diff --git a/x/auth/migrations/v2/store_test.go b/x/auth/migrations/v2/store_test.go index 3c6b06645982..eccc71fbe2e2 100644 --- a/x/auth/migrations/v2/store_test.go +++ b/x/auth/migrations/v2/store_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" storetypes "cosmossdk.io/store/types" @@ -66,7 +66,7 @@ func TestMigrateVestingAccounts(t *testing.T) { legacySubspace := newMockSubspace(authtypes.DefaultParams()) require.NoError(t, v4.Migrate(ctx, store, legacySubspace, cdc)) - ctx = app.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) + ctx = app.BaseApp.NewContext(false, cmtproto.Header{Time: time.Now()}) stakingKeeper.SetParams(ctx, stakingtypes.DefaultParams()) testCases := []struct { diff --git a/x/auth/migrations/v3/store_test.go b/x/auth/migrations/v3/store_test.go index 1a3e6200e43a..633735870702 100644 --- a/x/auth/migrations/v3/store_test.go +++ b/x/auth/migrations/v3/store_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" storetypes "cosmossdk.io/store/types" @@ -62,7 +62,7 @@ func TestMigrateMapAccAddressToAccNumberKey(t *testing.T) { randAccNumber := uint64(rand.Intn(100000-10000) + 10000) acc := authtypes.NewBaseAccount(senderPrivKey.PubKey().Address().Bytes(), senderPrivKey.PubKey(), randAccNumber, 0) - ctx = app.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) + ctx = app.BaseApp.NewContext(false, cmtproto.Header{Time: time.Now()}) // migrator m := keeper.NewMigrator(accountKeeper, app.GRPCQueryRouter(), legacySubspace) diff --git a/x/auth/module_test.go b/x/auth/module_test.go index 1ded4c74a38b..73ab20793194 100644 --- a/x/auth/module_test.go +++ b/x/auth/module_test.go @@ -3,7 +3,7 @@ package auth_test import ( "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -17,7 +17,7 @@ func TestItCreatesModuleAccountOnInitBlock(t *testing.T) { app, err := simtestutil.SetupAtGenesis(testutil.AppConfig, &accountKeeper) require.NoError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) acc := accountKeeper.GetAccount(ctx, types.NewModuleAddress(types.FeeCollectorName)) require.NotNil(t, acc) } diff --git a/x/auth/signing/verify_test.go b/x/auth/signing/verify_test.go index e43bed2d60c8..2d523fe83713 100644 --- a/x/auth/signing/verify_test.go +++ b/x/auth/signing/verify_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" storetypes "cosmossdk.io/store/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" kmultisig "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -54,7 +54,7 @@ func TestVerifySignature(t *testing.T) { ) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{}) encCfg.Amino.RegisterConcrete(testdata.TestMsg{}, "cosmos-sdk/Test", nil) acc1 := accountKeeper.NewAccountWithAddress(ctx, addr) diff --git a/x/auth/simulation/proposals_test.go b/x/auth/simulation/proposals_test.go index 1685ceecccbe..580be215b488 100644 --- a/x/auth/simulation/proposals_test.go +++ b/x/auth/simulation/proposals_test.go @@ -4,7 +4,7 @@ import ( "math/rand" "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" sdk "github.com/cosmos/cosmos-sdk/types" @@ -19,7 +19,7 @@ func TestProposalMsgs(t *testing.T) { s := rand.NewSource(1) r := rand.New(s) - ctx := sdk.NewContext(nil, tmproto.Header{}, true, nil) + ctx := sdk.NewContext(nil, cmtproto.Header{}, true, nil) accounts := simtypes.RandomAccounts(r, 3) // execute ProposalMsgs function diff --git a/x/auth/tx/query.go b/x/auth/tx/query.go index f28ddef3ddb8..c052451ead0c 100644 --- a/x/auth/tx/query.go +++ b/x/auth/tx/query.go @@ -16,7 +16,7 @@ import ( ) // QueryTxsByEvents performs a search for transactions for a given set of events -// via the Tendermint RPC. An event takes the form of: +// via the CometBFT RPC. An event takes the form of: // "{eventAttribute}.{attributeKey} = '{attributeValue}'". Each event is // concatenated with an 'AND' operand. It returns a slice of Info object // containing txs and metadata. An error is returned if the query fails. diff --git a/x/auth/vesting/msg_server_test.go b/x/auth/vesting/msg_server_test.go index 1929130d2a6b..6a4c5ecbb0ee 100644 --- a/x/auth/vesting/msg_server_test.go +++ b/x/auth/vesting/msg_server_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtime "github.com/cometbft/cometbft/types/time" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttime "github.com/cometbft/cometbft/types/time" "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" @@ -42,7 +42,7 @@ type VestingTestSuite struct { func (s *VestingTestSuite) SetupTest() { key := storetypes.NewKVStoreKey(authtypes.StoreKey) testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) - s.ctx = testCtx.Ctx.WithBlockHeader(tmproto.Header{Time: tmtime.Now()}) + s.ctx = testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: cmttime.Now()}) encCfg := moduletestutil.MakeTestEncodingConfig() maccPerms := map[string][]string{} diff --git a/x/auth/vesting/types/vesting_account_test.go b/x/auth/vesting/types/vesting_account_test.go index 9d671fef9742..46502aff0f41 100644 --- a/x/auth/vesting/types/vesting_account_test.go +++ b/x/auth/vesting/types/vesting_account_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" tmtime "github.com/cometbft/cometbft/types/time" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -40,7 +40,7 @@ func (s *VestingAccountTestSuite) SetupTest() { key := storetypes.NewKVStoreKey(authtypes.StoreKey) testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) - s.ctx = testCtx.Ctx.WithBlockHeader(tmproto.Header{}) + s.ctx = testCtx.Ctx.WithBlockHeader(cmtproto.Header{}) maccPerms := map[string][]string{ "fee_collector": nil, diff --git a/x/authz/client/cli/tx_test.go b/x/authz/client/cli/tx_test.go index 7355c3591601..969129489fa4 100644 --- a/x/authz/client/cli/tx_test.go +++ b/x/authz/client/cli/tx_test.go @@ -59,7 +59,7 @@ func (s *CLITestSuite) SetupSuite() { WithKeyring(s.kr). WithTxConfig(s.encCfg.TxConfig). WithCodec(s.encCfg.Codec). - WithClient(clitestutil.MockTendermintRPC{Client: rpcclientmock.Client{}}). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). WithAccountRetriever(client.MockAccountRetriever{}). WithOutput(io.Discard). WithChainID("test-chain") @@ -67,7 +67,7 @@ func (s *CLITestSuite) SetupSuite() { var outBuf bytes.Buffer ctxGen := func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) diff --git a/x/authz/keeper/genesis_test.go b/x/authz/keeper/genesis_test.go index ddaa5fb07bab..74576e1f90cf 100644 --- a/x/authz/keeper/genesis_test.go +++ b/x/authz/keeper/genesis_test.go @@ -5,7 +5,7 @@ import ( "time" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/suite" storetypes "cosmossdk.io/store/types" @@ -35,7 +35,7 @@ type GenesisTestSuite struct { func (suite *GenesisTestSuite) SetupTest() { key := storetypes.NewKVStoreKey(keeper.StoreKey) testCtx := testutil.DefaultContextWithDB(suite.T(), key, storetypes.NewTransientStoreKey("transient_test")) - suite.ctx = testCtx.Ctx.WithBlockHeader(tmproto.Header{Height: 1}) + suite.ctx = testCtx.Ctx.WithBlockHeader(cmtproto.Header{Height: 1}) suite.encCfg = moduletestutil.MakeTestEncodingConfig(authzmodule.AppModuleBasic{}) // gomock initializations diff --git a/x/authz/keeper/keeper_test.go b/x/authz/keeper/keeper_test.go index 6e0d41529cf5..13768dc0d172 100644 --- a/x/authz/keeper/keeper_test.go +++ b/x/authz/keeper/keeper_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtime "github.com/cometbft/cometbft/types/time" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttime "github.com/cometbft/cometbft/types/time" "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" @@ -48,7 +48,7 @@ type TestSuite struct { func (s *TestSuite) SetupTest() { key := storetypes.NewKVStoreKey(authzkeeper.StoreKey) testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) - s.ctx = testCtx.Ctx.WithBlockHeader(tmproto.Header{Time: tmtime.Now()}) + s.ctx = testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: cmttime.Now()}) s.encCfg = moduletestutil.MakeTestEncodingConfig(authzmodule.AppModuleBasic{}) s.baseApp = baseapp.NewBaseApp( diff --git a/x/authz/simulation/operations_test.go b/x/authz/simulation/operations_test.go index 434c0f7550bb..3a5ec4c9380d 100644 --- a/x/authz/simulation/operations_test.go +++ b/x/authz/simulation/operations_test.go @@ -6,7 +6,7 @@ import ( "time" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/codec" @@ -51,7 +51,7 @@ func (suite *SimTestSuite) SetupTest() { ) suite.Require().NoError(err) suite.app = app - suite.ctx = app.BaseApp.NewContext(false, tmproto.Header{}) + suite.ctx = app.BaseApp.NewContext(false, cmtproto.Header{}) } func (suite *SimTestSuite) TestWeightedOperations() { @@ -115,7 +115,7 @@ func (suite *SimTestSuite) TestSimulateGrant() { // begin a new block suite.app.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{ + Header: cmtproto.Header{ Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash, }, @@ -145,7 +145,7 @@ func (suite *SimTestSuite) TestSimulateRevoke() { // begin a new block suite.app.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{ + Header: cmtproto.Header{ Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash, }, @@ -184,7 +184,7 @@ func (suite *SimTestSuite) TestSimulateExec() { accounts := suite.getTestingAccounts(r, 3) // begin a new block - suite.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) + suite.app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) initAmt := sdk.TokensFromConsensusPower(200000, sdk.DefaultPowerReduction) initCoins := sdk.NewCoins(sdk.NewCoin("stake", initAmt)) diff --git a/x/bank/app_test.go b/x/bank/app_test.go index fde991ef4711..e6bcf28355fa 100644 --- a/x/bank/app_test.go +++ b/x/bank/app_test.go @@ -3,7 +3,7 @@ package bank_test import ( "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -128,7 +128,7 @@ func createTestSuite(t *testing.T, genesisAccounts []authtypes.GenesisAccount) s // CheckBalance checks the balance of an account. func checkBalance(t *testing.T, baseApp *baseapp.BaseApp, addr sdk.AccAddress, balances sdk.Coins, keeper bankkeeper.Keeper) { - ctxCheck := baseApp.NewContext(true, tmproto.Header{}) + ctxCheck := baseApp.NewContext(true, cmtproto.Header{}) require.True(t, balances.Equal(keeper.GetAllBalances(ctxCheck, addr))) } @@ -140,7 +140,7 @@ func TestSendNotEnoughBalance(t *testing.T) { genAccs := []authtypes.GenesisAccount{acc} s := createTestSuite(t, genAccs) baseApp := s.App.BaseApp - ctx := baseApp.NewContext(false, tmproto.Header{}) + ctx := baseApp.NewContext(false, cmtproto.Header{}) require.NoError(t, testutil.FundAccount(s.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 67)))) @@ -154,14 +154,14 @@ func TestSendNotEnoughBalance(t *testing.T) { origSeq := res1.GetSequence() sendMsg := types.NewMsgSend(addr1, addr2, sdk.Coins{sdk.NewInt64Coin("foocoin", 100)}) - header := tmproto.Header{Height: baseApp.LastBlockHeight() + 1} + header := cmtproto.Header{Height: baseApp.LastBlockHeight() + 1} txConfig := moduletestutil.MakeTestEncodingConfig().TxConfig _, _, err := simtestutil.SignCheckDeliver(t, txConfig, baseApp, header, []sdk.Msg{sendMsg}, "", []uint64{origAccNum}, []uint64{origSeq}, false, false, priv1) require.Error(t, err) checkBalance(t, baseApp, addr1, sdk.Coins{sdk.NewInt64Coin("foocoin", 67)}, s.BankKeeper) - ctx2 := baseApp.NewContext(true, tmproto.Header{}) + ctx2 := baseApp.NewContext(true, cmtproto.Header{}) res2 := s.AccountKeeper.GetAccount(ctx2, addr1) require.NotNil(t, res2) @@ -177,7 +177,7 @@ func TestMsgMultiSendWithAccounts(t *testing.T) { genAccs := []authtypes.GenesisAccount{acc} s := createTestSuite(t, genAccs) baseApp := s.App.BaseApp - ctx := baseApp.NewContext(false, tmproto.Header{}) + ctx := baseApp.NewContext(false, cmtproto.Header{}) require.NoError(t, testutil.FundAccount(s.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 67)))) @@ -231,7 +231,7 @@ func TestMsgMultiSendWithAccounts(t *testing.T) { } for _, tc := range testCases { - header := tmproto.Header{Height: baseApp.LastBlockHeight() + 1} + header := cmtproto.Header{Height: baseApp.LastBlockHeight() + 1} txConfig := moduletestutil.MakeTestEncodingConfig().TxConfig _, _, err := simtestutil.SignCheckDeliver(t, txConfig, baseApp, header, tc.msgs, "", tc.accNums, tc.accSeqs, tc.expSimPass, tc.expPass, tc.privKeys...) if tc.expPass { @@ -257,7 +257,7 @@ func TestMsgMultiSendMultipleOut(t *testing.T) { genAccs := []authtypes.GenesisAccount{acc1, acc2} s := createTestSuite(t, genAccs) baseApp := s.App.BaseApp - ctx := baseApp.NewContext(false, tmproto.Header{}) + ctx := baseApp.NewContext(false, cmtproto.Header{}) require.NoError(t, testutil.FundAccount(s.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 42)))) @@ -282,7 +282,7 @@ func TestMsgMultiSendMultipleOut(t *testing.T) { } for _, tc := range testCases { - header := tmproto.Header{Height: baseApp.LastBlockHeight() + 1} + header := cmtproto.Header{Height: baseApp.LastBlockHeight() + 1} txConfig := moduletestutil.MakeTestEncodingConfig().TxConfig _, _, err := simtestutil.SignCheckDeliver(t, txConfig, baseApp, header, tc.msgs, "", tc.accNums, tc.accSeqs, tc.expSimPass, tc.expPass, tc.privKeys...) require.NoError(t, err) @@ -302,7 +302,7 @@ func TestMsgMultiSendDependent(t *testing.T) { genAccs := []authtypes.GenesisAccount{acc1, acc2} s := createTestSuite(t, genAccs) baseApp := s.App.BaseApp - ctx := baseApp.NewContext(false, tmproto.Header{}) + ctx := baseApp.NewContext(false, cmtproto.Header{}) require.NoError(t, testutil.FundAccount(s.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 42)))) @@ -335,7 +335,7 @@ func TestMsgMultiSendDependent(t *testing.T) { } for _, tc := range testCases { - header := tmproto.Header{Height: baseApp.LastBlockHeight() + 1} + header := cmtproto.Header{Height: baseApp.LastBlockHeight() + 1} txConfig := moduletestutil.MakeTestEncodingConfig().TxConfig _, _, err := simtestutil.SignCheckDeliver(t, txConfig, baseApp, header, tc.msgs, "", tc.accNums, tc.accSeqs, tc.expSimPass, tc.expPass, tc.privKeys...) require.NoError(t, err) @@ -352,7 +352,7 @@ func TestMsgSetSendEnabled(t *testing.T) { genAccs := []authtypes.GenesisAccount{acc1} s := createTestSuite(t, genAccs) - ctx := s.App.BaseApp.NewContext(false, tmproto.Header{}) + ctx := s.App.BaseApp.NewContext(false, cmtproto.Header{}) require.NoError(t, testutil.FundAccount(s.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 101)))) addr1Str := addr1.String() govAddr := s.BankKeeper.GetAuthority() @@ -439,7 +439,7 @@ func TestMsgSetSendEnabled(t *testing.T) { for _, tc := range testCases { t.Run(tc.desc, func(tt *testing.T) { - header := tmproto.Header{Height: s.App.LastBlockHeight() + 1} + header := cmtproto.Header{Height: s.App.LastBlockHeight() + 1} txGen := moduletestutil.MakeTestEncodingConfig().TxConfig _, _, err = simtestutil.SignCheckDeliver(tt, txGen, s.App.BaseApp, header, tc.msgs, "", []uint64{0}, tc.accSeqs, tc.expSimPass, tc.expPass, priv1) if len(tc.expInError) > 0 { diff --git a/x/bank/bench_test.go b/x/bank/bench_test.go index 52ff28d61488..ce0dbb23dc9c 100644 --- a/x/bank/bench_test.go +++ b/x/bank/bench_test.go @@ -6,7 +6,7 @@ import ( "time" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/client" @@ -70,7 +70,7 @@ func BenchmarkOneBankSendTxPerBlock(b *testing.B) { genAccs := []authtypes.GenesisAccount{&acc} s := createTestSuite(&testing.T{}, genAccs) baseApp := s.App.BaseApp - ctx := baseApp.NewContext(false, tmproto.Header{}) + ctx := baseApp.NewContext(false, cmtproto.Header{}) // some value conceivably higher than the benchmarks would ever go require.NoError(b, testutil.FundAccount(s.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 100000000000)))) @@ -88,7 +88,7 @@ func BenchmarkOneBankSendTxPerBlock(b *testing.B) { // Run this with a profiler, so its easy to distinguish what time comes from // Committing, and what time comes from Check/Deliver Tx. for i := 0; i < b.N; i++ { - baseApp.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: height}}) + baseApp.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: height}}) _, _, err := baseApp.SimCheck(txGen.TxEncoder(), txs[i]) if err != nil { panic("something is broken in checking transaction") @@ -115,7 +115,7 @@ func BenchmarkOneBankMultiSendTxPerBlock(b *testing.B) { genAccs := []authtypes.GenesisAccount{&acc} s := createTestSuite(&testing.T{}, genAccs) baseApp := s.App.BaseApp - ctx := baseApp.NewContext(false, tmproto.Header{}) + ctx := baseApp.NewContext(false, cmtproto.Header{}) // some value conceivably higher than the benchmarks would ever go require.NoError(b, testutil.FundAccount(s.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 100000000000)))) @@ -133,7 +133,7 @@ func BenchmarkOneBankMultiSendTxPerBlock(b *testing.B) { // Run this with a profiler, so its easy to distinguish what time comes from // Committing, and what time comes from Check/Deliver Tx. for i := 0; i < b.N; i++ { - baseApp.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: height}}) + baseApp.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: height}}) _, _, err := baseApp.SimCheck(txGen.TxEncoder(), txs[i]) if err != nil { panic("something is broken in checking transaction") diff --git a/x/bank/client/cli/query.go b/x/bank/client/cli/query.go index c493c390e1d9..7c1a0f7ae53f 100644 --- a/x/bank/client/cli/query.go +++ b/x/bank/client/cli/query.go @@ -19,7 +19,7 @@ const ( ) // GetQueryCmd returns the parent command for all x/bank CLi query commands. The -// provided clientCtx should have, at a minimum, a verifier, Tendermint RPC client, +// provided clientCtx should have, at a minimum, a verifier, CometBFT RPC client, // and marshaler set. func GetQueryCmd() *cobra.Command { cmd := &cobra.Command{ diff --git a/x/bank/client/cli/query_test.go b/x/bank/client/cli/query_test.go index e8a0daa28eb6..2708a9063625 100644 --- a/x/bank/client/cli/query_test.go +++ b/x/bank/client/cli/query_test.go @@ -36,7 +36,7 @@ func (s *CLITestSuite) TestGetBalancesCmd() { "valid query", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&types.QueryAllBalancesResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -54,7 +54,7 @@ func (s *CLITestSuite) TestGetBalancesCmd() { bz, _ := s.encCfg.Codec.Marshal(&types.QueryBalanceResponse{ Balance: &sdk.Coin{}, }) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -81,7 +81,7 @@ func (s *CLITestSuite) TestGetBalancesCmd() { { "invalid denom", func() client.Context { - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Code: 1, }) return s.baseCtx.WithClient(c) @@ -137,7 +137,7 @@ func (s *CLITestSuite) TestGetSpendableBalancesCmd() { "valid query", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&types.QuerySpendableBalancesResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -153,7 +153,7 @@ func (s *CLITestSuite) TestGetSpendableBalancesCmd() { "valid query with denom flag", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&types.QuerySpendableBalanceByDenomRequest{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -219,7 +219,7 @@ func (s *CLITestSuite) TestGetCmdDenomsMetadata() { "valid query", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&types.QueryDenomsMetadataResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -234,7 +234,7 @@ func (s *CLITestSuite) TestGetCmdDenomsMetadata() { "valid query with denom", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&types.QueryDenomMetadataResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -249,7 +249,7 @@ func (s *CLITestSuite) TestGetCmdDenomsMetadata() { { "invalid query with denom", func() client.Context { - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Code: 1, }) return s.baseCtx.WithClient(c) @@ -302,7 +302,7 @@ func (s *CLITestSuite) TestGetCmdQueryTotalSupply() { "valid query", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&types.QueryTotalSupplyResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -319,7 +319,7 @@ func (s *CLITestSuite) TestGetCmdQueryTotalSupply() { bz, _ := s.encCfg.Codec.Marshal(&types.QuerySupplyOfResponse{ Amount: sdk.Coin{}, }) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -334,7 +334,7 @@ func (s *CLITestSuite) TestGetCmdQueryTotalSupply() { { "invalid query with denom", func() client.Context { - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Code: 1, }) return s.baseCtx.WithClient(c) @@ -390,7 +390,7 @@ func (s *CLITestSuite) TestGetCmdQuerySendEnabled() { bz, _ := s.encCfg.Codec.Marshal(&types.QuerySendEnabledResponse{ SendEnabled: []*types.SendEnabled{}, }) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -407,7 +407,7 @@ func (s *CLITestSuite) TestGetCmdQuerySendEnabled() { bz, _ := s.encCfg.Codec.Marshal(&types.QuerySendEnabledResponse{ SendEnabled: []*types.SendEnabled{}, }) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) diff --git a/x/bank/client/cli/suite_test.go b/x/bank/client/cli/suite_test.go index 648a701ce35b..cf68074bf59f 100644 --- a/x/bank/client/cli/suite_test.go +++ b/x/bank/client/cli/suite_test.go @@ -33,7 +33,7 @@ func (s *CLITestSuite) SetupSuite() { WithKeyring(s.kr). WithTxConfig(s.encCfg.TxConfig). WithCodec(s.encCfg.Codec). - WithClient(clitestutil.MockTendermintRPC{Client: rpcclientmock.Client{}}). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). WithAccountRetriever(client.MockAccountRetriever{}). WithOutput(io.Discard) } diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index 2ea04815fda9..b0fcc72e9b94 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -9,8 +9,8 @@ import ( "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtime "github.com/cometbft/cometbft/types/time" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttime "github.com/cometbft/cometbft/types/time" "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" @@ -124,7 +124,7 @@ func TestKeeperTestSuite(t *testing.T) { func (suite *KeeperTestSuite) SetupTest() { key := storetypes.NewKVStoreKey(banktypes.StoreKey) testCtx := testutil.DefaultContextWithDB(suite.T(), key, storetypes.NewTransientStoreKey("transient_test")) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Time: tmtime.Now()}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: cmttime.Now()}) encCfg := moduletestutil.MakeTestEncodingConfig() // gomock initializations @@ -607,7 +607,7 @@ func (suite *KeeperTestSuite) TestSendCoins() { func (suite *KeeperTestSuite) TestSendCoins_Invalid_SendLockedCoins() { balances := sdk.NewCoins(newFooCoin(50)) - now := tmtime.Now() + now := cmttime.Now() endTime := now.Add(24 * time.Hour) origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100)) @@ -626,7 +626,7 @@ func (suite *KeeperTestSuite) TestSendCoins_Invalid_SendLockedCoins() { func (suite *KeeperTestSuite) TestValidateBalance() { ctx := suite.ctx require := suite.Require() - now := tmtime.Now() + now := cmttime.Now() endTime := now.Add(24 * time.Hour) acc0 := authtypes.NewBaseAccountWithAddress(accAddrs[0]) @@ -846,7 +846,7 @@ func (suite *KeeperTestSuite) TestMsgMultiSendEvents() { func (suite *KeeperTestSuite) TestSpendableCoins() { ctx := suite.ctx require := suite.Require() - now := tmtime.Now() + now := cmttime.Now() endTime := now.Add(24 * time.Hour) origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100)) @@ -879,7 +879,7 @@ func (suite *KeeperTestSuite) TestSpendableCoins() { func (suite *KeeperTestSuite) TestVestingAccountSend() { ctx := suite.ctx require := suite.Require() - now := tmtime.Now() + now := cmttime.Now() endTime := now.Add(24 * time.Hour) origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100)) @@ -908,7 +908,7 @@ func (suite *KeeperTestSuite) TestVestingAccountSend() { func (suite *KeeperTestSuite) TestPeriodicVestingAccountSend() { ctx := suite.ctx require := suite.Require() - now := tmtime.Now() + now := cmttime.Now() origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100)) sendCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 50)) @@ -942,7 +942,7 @@ func (suite *KeeperTestSuite) TestPeriodicVestingAccountSend() { func (suite *KeeperTestSuite) TestVestingAccountReceive() { ctx := suite.ctx require := suite.Require() - now := tmtime.Now() + now := cmttime.Now() endTime := now.Add(24 * time.Hour) origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100)) @@ -974,7 +974,7 @@ func (suite *KeeperTestSuite) TestVestingAccountReceive() { func (suite *KeeperTestSuite) TestPeriodicVestingAccountReceive() { ctx := suite.ctx require := suite.Require() - now := tmtime.Now() + now := cmttime.Now() origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100)) sendCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 50)) @@ -1011,7 +1011,7 @@ func (suite *KeeperTestSuite) TestPeriodicVestingAccountReceive() { func (suite *KeeperTestSuite) TestDelegateCoins() { ctx := suite.ctx require := suite.Require() - now := tmtime.Now() + now := cmttime.Now() endTime := now.Add(24 * time.Hour) origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100)) @@ -1068,7 +1068,7 @@ func (suite *KeeperTestSuite) TestDelegateCoins_Invalid() { func (suite *KeeperTestSuite) TestUndelegateCoins() { ctx := suite.ctx require := suite.Require() - now := tmtime.Now() + now := cmttime.Now() endTime := now.Add(24 * time.Hour) origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100)) diff --git a/x/bank/simulation/operations_test.go b/x/bank/simulation/operations_test.go index 57831b7ba276..ee50ddf0cd59 100644 --- a/x/bank/simulation/operations_test.go +++ b/x/bank/simulation/operations_test.go @@ -5,7 +5,7 @@ import ( "testing" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/codec" @@ -52,7 +52,7 @@ func (suite *SimTestSuite) SetupTest() { suite.NoError(err) - suite.ctx = suite.app.BaseApp.NewContext(false, tmproto.Header{}) + suite.ctx = suite.app.BaseApp.NewContext(false, cmtproto.Header{}) } // TestWeightedOperations tests the weights of the operations. @@ -98,7 +98,7 @@ func (suite *SimTestSuite) TestSimulateMsgSend() { accounts := suite.getTestingAccounts(r, 3) // begin a new block - suite.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) + suite.app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) // execute operation op := simulation.SimulateMsgSend(suite.accountKeeper, suite.bankKeeper) @@ -125,7 +125,7 @@ func (suite *SimTestSuite) TestSimulateMsgMultiSend() { accounts := suite.getTestingAccounts(r, 3) // begin a new block - suite.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) + suite.app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) // execute operation op := simulation.SimulateMsgMultiSend(suite.accountKeeper, suite.bankKeeper) @@ -158,7 +158,7 @@ func (suite *SimTestSuite) TestSimulateModuleAccountMsgSend() { accounts := suite.getTestingAccounts(r, accCount) // begin a new block - suite.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) + suite.app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) // execute operation op := simulation.SimulateMsgSendToModuleAccount(suite.accountKeeper, suite.bankKeeper, moduleAccCount) @@ -189,7 +189,7 @@ func (suite *SimTestSuite) TestSimulateMsgMultiSendToModuleAccount() { accounts := suite.getTestingAccounts(r, accCount) // begin a new block - suite.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) + suite.app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) // execute operation op := simulation.SimulateMsgMultiSendToModuleAccount(suite.accountKeeper, suite.bankKeeper, mAccCount) diff --git a/x/bank/simulation/proposals_test.go b/x/bank/simulation/proposals_test.go index 8edbda299c80..cc9ca7e55c08 100644 --- a/x/bank/simulation/proposals_test.go +++ b/x/bank/simulation/proposals_test.go @@ -5,7 +5,7 @@ import ( "math/rand" "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" sdk "github.com/cosmos/cosmos-sdk/types" @@ -20,7 +20,7 @@ func TestProposalMsgs(t *testing.T) { s := rand.NewSource(1) r := rand.New(s) - ctx := sdk.NewContext(nil, tmproto.Header{}, true, nil) + ctx := sdk.NewContext(nil, cmtproto.Header{}, true, nil) accounts := simtypes.RandomAccounts(r, 3) // execute ProposalMsgs function diff --git a/x/bank/types/send_authorization_test.go b/x/bank/types/send_authorization_test.go index 7d4d8a250cca..642463c3e55d 100644 --- a/x/bank/types/send_authorization_test.go +++ b/x/bank/types/send_authorization_test.go @@ -4,7 +4,7 @@ import ( fmt "fmt" "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" storetypes "cosmossdk.io/store/types" @@ -23,7 +23,7 @@ var ( ) func TestSendAuthorization(t *testing.T) { - ctx := testutil.DefaultContextWithDB(t, storetypes.NewKVStoreKey(types.StoreKey), storetypes.NewTransientStoreKey("transient_test")).Ctx.WithBlockHeader(tmproto.Header{}) + ctx := testutil.DefaultContextWithDB(t, storetypes.NewKVStoreKey(types.StoreKey), storetypes.NewTransientStoreKey("transient_test")).Ctx.WithBlockHeader(cmtproto.Header{}) allowList := make([]sdk.AccAddress, 1) allowList[0] = toAddr authorization := types.NewSendAuthorization(coins1000, nil) diff --git a/x/capability/capability_test.go b/x/capability/capability_test.go index de7176bcf0e8..9e5c43a16ba8 100644 --- a/x/capability/capability_test.go +++ b/x/capability/capability_test.go @@ -4,7 +4,7 @@ import ( "testing" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/suite" storetypes "cosmossdk.io/store/types" @@ -47,7 +47,7 @@ func (suite *CapabilityTestSuite) SetupTest() { suite.Require().NoError(err) suite.app = app - suite.ctx = app.BaseApp.NewContext(false, tmproto.Header{Height: 1}) + suite.ctx = app.BaseApp.NewContext(false, cmtproto.Header{Height: 1}) } // The following test case mocks a specific bug discovered in https://github.com/cosmos/cosmos-sdk/issues/9800 @@ -64,12 +64,12 @@ func (suite *CapabilityTestSuite) TestInitializeMemStore() { newSk1 := newKeeper.ScopeToModule(banktypes.ModuleName) // Mock App startup - ctx := suite.app.BaseApp.NewUncachedContext(false, tmproto.Header{}) + ctx := suite.app.BaseApp.NewUncachedContext(false, cmtproto.Header{}) newKeeper.Seal() suite.Require().False(newKeeper.IsInitialized(ctx), "memstore initialized flag set before BeginBlock") // Mock app beginblock and ensure that no gas has been consumed and memstore is initialized - ctx = suite.app.BaseApp.NewContext(false, tmproto.Header{}).WithBlockGasMeter(storetypes.NewGasMeter(50)) + ctx = suite.app.BaseApp.NewContext(false, cmtproto.Header{}).WithBlockGasMeter(storetypes.NewGasMeter(50)) prevGas := ctx.BlockGasMeter().GasConsumed() restartedModule := capability.NewAppModule(suite.cdc, *newKeeper, true) restartedModule.BeginBlock(ctx, abci.RequestBeginBlock{}) @@ -85,7 +85,7 @@ func (suite *CapabilityTestSuite) TestInitializeMemStore() { suite.Require().True(ok) // Ensure that the second transaction can still receive capability even if first tx fails. - ctx = suite.app.BaseApp.NewContext(false, tmproto.Header{}) + ctx = suite.app.BaseApp.NewContext(false, cmtproto.Header{}) cap1, ok = newSk1.GetCapability(ctx, "transfer") suite.Require().True(ok) diff --git a/x/capability/genesis_test.go b/x/capability/genesis_test.go index ab136f4546c6..9dc9798fae97 100644 --- a/x/capability/genesis_test.go +++ b/x/capability/genesis_test.go @@ -1,9 +1,8 @@ package capability_test import ( - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - storetypes "cosmossdk.io/store/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -38,7 +37,7 @@ func (suite *CapabilityTestSuite) TestGenesis() { newSk1 := newKeeper.ScopeToModule(banktypes.ModuleName) newSk2 := newKeeper.ScopeToModule(stakingtypes.ModuleName) - deliverCtx, _ := newApp.BaseApp.NewUncachedContext(false, tmproto.Header{}).WithBlockGasMeter(storetypes.NewInfiniteGasMeter()).CacheContext() + deliverCtx, _ := newApp.BaseApp.NewUncachedContext(false, cmtproto.Header{}).WithBlockGasMeter(storetypes.NewInfiniteGasMeter()).CacheContext() capability.InitGenesis(deliverCtx, *newKeeper, *genState) diff --git a/x/circuit/go.mod b/x/circuit/go.mod index 632c9e01bf7f..f68cb9c78c64 100644 --- a/x/circuit/go.mod +++ b/x/circuit/go.mod @@ -3,8 +3,9 @@ module github.com/cosmos/cosmos-sdk/x/circuit go 1.19 require ( - cosmossdk.io/store v0.0.0-20230206083820-8cf814fb8c4c - github.com/cosmos/cosmos-sdk v0.0.0-00010101000000-000000000000 + cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 + // TODO to replace by a tagged version of the SDK (with CometBFT) when available + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230205135133-41a3dfeced29 github.com/cosmos/gogoproto v1.4.4 github.com/regen-network/gocuke v0.6.2 google.golang.org/grpc v1.52.3 @@ -34,6 +35,7 @@ require ( github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.0-rc.1 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.1 // indirect + github.com/cosmos/iavl v0.20.0-alpha3 // indirect github.com/cucumber/common/gherkin/go/v22 v22.0.0 // indirect github.com/cucumber/common/messages/go/v17 v17.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -84,19 +86,17 @@ require ( github.com/subosito/gotenv v1.4.2 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect + github.com/tidwall/btree v1.6.0 // indirect golang.org/x/crypto v0.5.0 // indirect golang.org/x/exp v0.0.0-20230203172020-98cc5a0785f9 // indirect golang.org/x/net v0.5.0 // indirect golang.org/x/sys v0.4.0 // indirect golang.org/x/text v0.6.0 // indirect google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 // indirect - google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a // indirect + google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect pgregory.net/rapid v0.5.5 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) - -// This can be deleted after the CometBFT PR is merged -replace github.com/cosmos/cosmos-sdk => ../.. diff --git a/x/circuit/go.sum b/x/circuit/go.sum index a9869b557551..43cdabfda401 100644 --- a/x/circuit/go.sum +++ b/x/circuit/go.sum @@ -47,8 +47,10 @@ cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= cosmossdk.io/math v1.0.0-beta.6 h1:WF29SiFYNde5eYvqO2kdOM9nYbDb44j3YW5B8M1m9KE= cosmossdk.io/math v1.0.0-beta.6/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= -cosmossdk.io/store v0.0.0-20230206083820-8cf814fb8c4c h1:YV+1+3XDnycX8Gnc3ARL8dzj42yAILFSK1laERHsmOE= -cosmossdk.io/store v0.0.0-20230206083820-8cf814fb8c4c/go.mod h1:Sf3G8SV8e8H31CD6w+o2syqCwyaoL0fe244JcPSsaD4= +cosmossdk.io/store v0.0.0-20230204135315-697871069999 h1:NrV990BIbdDngOoTrD3Hg5kqqgvy6c+ETaKGY5bSUmo= +cosmossdk.io/store v0.0.0-20230204135315-697871069999/go.mod h1:Sf3G8SV8e8H31CD6w+o2syqCwyaoL0fe244JcPSsaD4= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7/go.mod h1:1XOtuYs7jsfQkn7G3VQXB6I+2tHXKHZw2U/AafNbnlk= cosmossdk.io/x/tx v0.1.0 h1:uyyYVjG22B+jf54N803Z99Y1uPvfuNP3K1YShoCHYL8= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= @@ -92,6 +94,7 @@ github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOF github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -131,11 +134,14 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9 github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso= github.com/cosmos/cosmos-proto v1.0.0-beta.1 h1:iDL5qh++NoXxG8hSy93FdYJut4XfgbShIocllGaXx/0= github.com/cosmos/cosmos-proto v1.0.0-beta.1/go.mod h1:8k2GNZghi5sDRFw/scPL8gMSowT1vDA+5ouxL8GjaUE= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230205135133-41a3dfeced29 h1:HJIOs0YfTumgmw8MU1QIiCHO+tz2IWoLpXNOXzLJqnE= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230205135133-41a3dfeced29/go.mod h1:9dul7UbanQCWIiz4b6FZ8QcKKU28EMgvXVNCTcc6Ivk= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogoproto v1.4.4 h1:nVAsgLlAf5jeN0fV7hRlkZvf768zU+dy4pG+hxc2P34= github.com/cosmos/gogoproto v1.4.4/go.mod h1:/yl6/nLwsZcZ2JY3OrqjRqvqCG9InUMcXRfRjQiF9DU= github.com/cosmos/iavl v0.20.0-alpha3 h1:hbUyr0dkiGDlmmbrArvte0lXv6VkMrGQNr3b29xvmVk= +github.com/cosmos/iavl v0.20.0-alpha3/go.mod h1:25YJYzilTErJ2mKfNB3xyWL9IsCwEQdNzdIutg2mh3U= github.com/cosmos/ledger-cosmos-go v0.13.0 h1:ex0CvCxToSR7j5WjrghPu2Bu9sSXKikjnVvUryNnx4s= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -524,6 +530,7 @@ github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJ github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= +github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= @@ -915,6 +922,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a h1:KJVqJe240LvVd+8lfzRx3hQ0UZ0fyeXEMDMHviRNQKs= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af h1:rAgzfIj9FJtmJ6ZPDlxXX6Fzzix6NOpPTvVmPY5rwQg= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/consensus/exported/exported.go b/x/consensus/exported/exported.go index 4430795b20e0..1e0a138e95a7 100644 --- a/x/consensus/exported/exported.go +++ b/x/consensus/exported/exported.go @@ -1,7 +1,8 @@ package exported import ( - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -17,8 +18,8 @@ type ( // ConsensusParamSetter defines the interface fulfilled by BaseApp's // ParamStore which allows setting its appVersion field. ConsensusParamSetter interface { - Get(ctx sdk.Context) (*tmproto.ConsensusParams, error) + Get(ctx sdk.Context) (*cmtproto.ConsensusParams, error) Has(ctx sdk.Context) bool - Set(ctx sdk.Context, cp *tmproto.ConsensusParams) + Set(ctx sdk.Context, cp *cmtproto.ConsensusParams) } ) diff --git a/x/consensus/keeper/grpc_query_test.go b/x/consensus/keeper/grpc_query_test.go index ccd1b49f0e21..eeee2ccf5cbc 100644 --- a/x/consensus/keeper/grpc_query_test.go +++ b/x/consensus/keeper/grpc_query_test.go @@ -1,14 +1,14 @@ package keeper_test import ( - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/x/consensus/types" ) func (s *KeeperTestSuite) TestGRPCQueryConsensusParams() { - defaultConsensusParams := tmtypes.DefaultConsensusParams().ToProto() + defaultConsensusParams := cmttypes.DefaultConsensusParams().ToProto() testCases := []struct { msg string @@ -30,7 +30,7 @@ func (s *KeeperTestSuite) TestGRPCQueryConsensusParams() { s.msgServer.UpdateParams(s.ctx, input) }, types.QueryParamsResponse{ - Params: &tmproto.ConsensusParams{ + Params: &cmtproto.ConsensusParams{ Block: defaultConsensusParams.Block, Validator: defaultConsensusParams.Validator, Evidence: defaultConsensusParams.Evidence, diff --git a/x/consensus/keeper/keeper.go b/x/consensus/keeper/keeper.go index 968c3824fb62..2702f49abc91 100644 --- a/x/consensus/keeper/keeper.go +++ b/x/consensus/keeper/keeper.go @@ -1,7 +1,7 @@ package keeper import ( - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" storetypes "cosmossdk.io/store/types" @@ -33,10 +33,10 @@ func (k *Keeper) GetAuthority() string { } // Get gets the consensus parameters -func (k *Keeper) Get(ctx sdk.Context) (*tmproto.ConsensusParams, error) { +func (k *Keeper) Get(ctx sdk.Context) (*cmtproto.ConsensusParams, error) { store := ctx.KVStore(k.storeKey) - cp := &tmproto.ConsensusParams{} + cp := &cmtproto.ConsensusParams{} bz := store.Get(types.ParamStoreKeyConsensusParams) if err := k.cdc.Unmarshal(bz, cp); err != nil { @@ -53,7 +53,7 @@ func (k *Keeper) Has(ctx sdk.Context) bool { } // Set sets the consensus parameters -func (k *Keeper) Set(ctx sdk.Context, cp *tmproto.ConsensusParams) { +func (k *Keeper) Set(ctx sdk.Context, cp *cmtproto.ConsensusParams) { store := ctx.KVStore(k.storeKey) store.Set(types.ParamStoreKeyConsensusParams, k.cdc.MustMarshal(cp)) } diff --git a/x/consensus/keeper/keeper_test.go b/x/consensus/keeper/keeper_test.go index d7e92662f856..e7d4dc1ed44b 100644 --- a/x/consensus/keeper/keeper_test.go +++ b/x/consensus/keeper/keeper_test.go @@ -3,7 +3,7 @@ package keeper_test import ( "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/suite" storetypes "cosmossdk.io/store/types" @@ -30,7 +30,7 @@ type KeeperTestSuite struct { func (s *KeeperTestSuite) SetupTest() { key := storetypes.NewKVStoreKey(consensusparamtypes.StoreKey) testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{}) encCfg := moduletestutil.MakeTestEncodingConfig() keeper := consensusparamkeeper.NewKeeper(encCfg.Codec, key, authtypes.NewModuleAddress(govtypes.ModuleName).String()) diff --git a/x/consensus/keeper/msg_server.go b/x/consensus/keeper/msg_server.go index ada64ac83f51..f4312bbbf49b 100644 --- a/x/consensus/keeper/msg_server.go +++ b/x/consensus/keeper/msg_server.go @@ -3,7 +3,7 @@ package keeper import ( "context" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -31,7 +31,7 @@ func (k msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParam ctx := sdk.UnwrapSDKContext(goCtx) consensusParams := req.ToProtoConsensusParams() - if err := tmtypes.ConsensusParamsFromProto(consensusParams).ValidateBasic(); err != nil { + if err := cmttypes.ConsensusParamsFromProto(consensusParams).ValidateBasic(); err != nil { return nil, err } diff --git a/x/consensus/keeper/msg_server_test.go b/x/consensus/keeper/msg_server_test.go index 2c2745ba962a..0de099a83e82 100644 --- a/x/consensus/keeper/msg_server_test.go +++ b/x/consensus/keeper/msg_server_test.go @@ -1,13 +1,13 @@ package keeper_test import ( - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/x/consensus/types" ) func (s *KeeperTestSuite) TestUpdateParams() { - defaultConsensusParams := tmtypes.DefaultConsensusParams().ToProto() + defaultConsensusParams := cmttypes.DefaultConsensusParams().ToProto() testCases := []struct { name string input *types.MsgUpdateParams @@ -29,7 +29,7 @@ func (s *KeeperTestSuite) TestUpdateParams() { name: "invalid params", input: &types.MsgUpdateParams{ Authority: s.consensusParamsKeeper.GetAuthority(), - Block: &tmproto.BlockParams{MaxGas: -10, MaxBytes: -10}, + Block: &cmtproto.BlockParams{MaxGas: -10, MaxBytes: -10}, Validator: defaultConsensusParams.Validator, Evidence: defaultConsensusParams.Evidence, }, diff --git a/x/consensus/types/msgs.go b/x/consensus/types/msgs.go index 91e3b7ef13ee..7b0ac5c94da1 100644 --- a/x/consensus/types/msgs.go +++ b/x/consensus/types/msgs.go @@ -1,8 +1,8 @@ package types import ( - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttypes "github.com/cometbft/cometbft/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" @@ -28,24 +28,24 @@ func (msg MsgUpdateParams) GetSignBytes() []byte { // ValidateBasic performs basic MsgUpdateParams message validation. func (msg MsgUpdateParams) ValidateBasic() error { - params := tmtypes.ConsensusParamsFromProto(msg.ToProtoConsensusParams()) + params := cmttypes.ConsensusParamsFromProto(msg.ToProtoConsensusParams()) return params.ValidateBasic() } -func (msg MsgUpdateParams) ToProtoConsensusParams() tmproto.ConsensusParams { - return tmproto.ConsensusParams{ - Block: &tmproto.BlockParams{ +func (msg MsgUpdateParams) ToProtoConsensusParams() cmtproto.ConsensusParams { + return cmtproto.ConsensusParams{ + Block: &cmtproto.BlockParams{ MaxBytes: msg.Block.MaxBytes, MaxGas: msg.Block.MaxGas, }, - Evidence: &tmproto.EvidenceParams{ + Evidence: &cmtproto.EvidenceParams{ MaxAgeNumBlocks: msg.Evidence.MaxAgeNumBlocks, MaxAgeDuration: msg.Evidence.MaxAgeDuration, MaxBytes: msg.Evidence.MaxBytes, }, - Validator: &tmproto.ValidatorParams{ + Validator: &cmtproto.ValidatorParams{ PubKeyTypes: msg.Validator.PubKeyTypes, }, - Version: tmtypes.DefaultConsensusParams().ToProto().Version, // Version is stored in x/upgrade + Version: cmttypes.DefaultConsensusParams().ToProto().Version, // Version is stored in x/upgrade } } diff --git a/x/crisis/client/cli/tx_test.go b/x/crisis/client/cli/tx_test.go index b6315f4a0087..f479949bac0f 100644 --- a/x/crisis/client/cli/tx_test.go +++ b/x/crisis/client/cli/tx_test.go @@ -28,7 +28,7 @@ func TestNewMsgVerifyInvariantTxCmd(t *testing.T) { WithKeyring(kr). WithTxConfig(encCfg.TxConfig). WithCodec(encCfg.Codec). - WithClient(clitestutil.MockTendermintRPC{Client: rpcclientmock.Client{}}). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). WithAccountRetriever(client.MockAccountRetriever{}). WithOutput(io.Discard). WithChainID("test-chain") diff --git a/x/distribution/client/cli/suite_test.go b/x/distribution/client/cli/suite_test.go index fce975803fa4..150acf8b97d2 100644 --- a/x/distribution/client/cli/suite_test.go +++ b/x/distribution/client/cli/suite_test.go @@ -48,7 +48,7 @@ func (s *CLITestSuite) SetupSuite() { WithKeyring(s.kr). WithTxConfig(s.encCfg.TxConfig). WithCodec(s.encCfg.Codec). - WithClient(clitestutil.MockTendermintRPC{Client: rpcclientmock.Client{}}). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). WithAccountRetriever(client.MockAccountRetriever{}). WithOutput(io.Discard). WithChainID("test-chain") @@ -56,7 +56,7 @@ func (s *CLITestSuite) SetupSuite() { var outBuf bytes.Buffer ctxGen := func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) diff --git a/x/distribution/keeper/allocation_test.go b/x/distribution/keeper/allocation_test.go index 3a76b8c893f7..edbb2b68d881 100644 --- a/x/distribution/keeper/allocation_test.go +++ b/x/distribution/keeper/allocation_test.go @@ -6,7 +6,7 @@ import ( "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" @@ -28,7 +28,7 @@ func TestAllocateTokensToValidatorWithCommission(t *testing.T) { key := storetypes.NewKVStoreKey(disttypes.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) encCfg := moduletestutil.MakeTestEncodingConfig(distribution.AppModuleBasic{}) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Time: time.Now()}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: time.Now()}) bankKeeper := distrtestutil.NewMockBankKeeper(ctrl) stakingKeeper := distrtestutil.NewMockStakingKeeper(ctrl) @@ -73,7 +73,7 @@ func TestAllocateTokensToManyValidators(t *testing.T) { key := storetypes.NewKVStoreKey(disttypes.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) encCfg := moduletestutil.MakeTestEncodingConfig(distribution.AppModuleBasic{}) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Time: time.Now()}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: time.Now()}) bankKeeper := distrtestutil.NewMockBankKeeper(ctrl) stakingKeeper := distrtestutil.NewMockStakingKeeper(ctrl) @@ -171,7 +171,7 @@ func TestAllocateTokensTruncation(t *testing.T) { key := storetypes.NewKVStoreKey(disttypes.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) encCfg := moduletestutil.MakeTestEncodingConfig(distribution.AppModuleBasic{}) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Time: time.Now()}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: time.Now()}) bankKeeper := distrtestutil.NewMockBankKeeper(ctrl) stakingKeeper := distrtestutil.NewMockStakingKeeper(ctrl) diff --git a/x/distribution/keeper/delegation_test.go b/x/distribution/keeper/delegation_test.go index 87665f2b10b8..98225d703891 100644 --- a/x/distribution/keeper/delegation_test.go +++ b/x/distribution/keeper/delegation_test.go @@ -3,7 +3,7 @@ package keeper_test import ( "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" @@ -26,7 +26,7 @@ func TestCalculateRewardsBasic(t *testing.T) { key := storetypes.NewKVStoreKey(disttypes.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) encCfg := moduletestutil.MakeTestEncodingConfig(distribution.AppModuleBasic{}) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Height: 1}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Height: 1}) bankKeeper := distrtestutil.NewMockBankKeeper(ctrl) stakingKeeper := distrtestutil.NewMockStakingKeeper(ctrl) @@ -104,7 +104,7 @@ func TestCalculateRewardsAfterSlash(t *testing.T) { key := storetypes.NewKVStoreKey(disttypes.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) encCfg := moduletestutil.MakeTestEncodingConfig(distribution.AppModuleBasic{}) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Height: 1}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Height: 1}) bankKeeper := distrtestutil.NewMockBankKeeper(ctrl) stakingKeeper := distrtestutil.NewMockStakingKeeper(ctrl) @@ -199,7 +199,7 @@ func TestCalculateRewardsAfterManySlashes(t *testing.T) { key := storetypes.NewKVStoreKey(disttypes.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) encCfg := moduletestutil.MakeTestEncodingConfig(distribution.AppModuleBasic{}) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Height: 1}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Height: 1}) bankKeeper := distrtestutil.NewMockBankKeeper(ctrl) stakingKeeper := distrtestutil.NewMockStakingKeeper(ctrl) @@ -314,7 +314,7 @@ func TestCalculateRewardsMultiDelegator(t *testing.T) { key := storetypes.NewKVStoreKey(disttypes.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) encCfg := moduletestutil.MakeTestEncodingConfig(distribution.AppModuleBasic{}) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Height: 1}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Height: 1}) bankKeeper := distrtestutil.NewMockBankKeeper(ctrl) stakingKeeper := distrtestutil.NewMockStakingKeeper(ctrl) @@ -404,7 +404,7 @@ func TestWithdrawDelegationRewardsBasic(t *testing.T) { key := storetypes.NewKVStoreKey(disttypes.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) encCfg := moduletestutil.MakeTestEncodingConfig(distribution.AppModuleBasic{}) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Height: 1}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Height: 1}) bankKeeper := distrtestutil.NewMockBankKeeper(ctrl) stakingKeeper := distrtestutil.NewMockStakingKeeper(ctrl) @@ -476,7 +476,7 @@ func TestCalculateRewardsAfterManySlashesInSameBlock(t *testing.T) { key := storetypes.NewKVStoreKey(disttypes.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) encCfg := moduletestutil.MakeTestEncodingConfig(distribution.AppModuleBasic{}) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Height: 1}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Height: 1}) bankKeeper := distrtestutil.NewMockBankKeeper(ctrl) stakingKeeper := distrtestutil.NewMockStakingKeeper(ctrl) @@ -583,7 +583,7 @@ func TestCalculateRewardsMultiDelegatorMultiSlash(t *testing.T) { key := storetypes.NewKVStoreKey(disttypes.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) encCfg := moduletestutil.MakeTestEncodingConfig(distribution.AppModuleBasic{}) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Height: 1}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Height: 1}) bankKeeper := distrtestutil.NewMockBankKeeper(ctrl) stakingKeeper := distrtestutil.NewMockStakingKeeper(ctrl) @@ -710,7 +710,7 @@ func TestCalculateRewardsMultiDelegatorMultWithdraw(t *testing.T) { key := storetypes.NewKVStoreKey(disttypes.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) encCfg := moduletestutil.MakeTestEncodingConfig(distribution.AppModuleBasic{}) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Height: 1}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Height: 1}) bankKeeper := distrtestutil.NewMockBankKeeper(ctrl) stakingKeeper := distrtestutil.NewMockStakingKeeper(ctrl) @@ -893,7 +893,7 @@ func Test100PercentCommissionReward(t *testing.T) { key := storetypes.NewKVStoreKey(disttypes.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) encCfg := moduletestutil.MakeTestEncodingConfig(distribution.AppModuleBasic{}) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Height: 1}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Height: 1}) bankKeeper := distrtestutil.NewMockBankKeeper(ctrl) stakingKeeper := distrtestutil.NewMockStakingKeeper(ctrl) diff --git a/x/distribution/keeper/keeper_test.go b/x/distribution/keeper/keeper_test.go index 7dd2ea45115d..754a42d35374 100644 --- a/x/distribution/keeper/keeper_test.go +++ b/x/distribution/keeper/keeper_test.go @@ -5,7 +5,7 @@ import ( "time" "cosmossdk.io/math" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" @@ -27,7 +27,7 @@ func TestSetWithdrawAddr(t *testing.T) { key := storetypes.NewKVStoreKey(types.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) encCfg := moduletestutil.MakeTestEncodingConfig(distribution.AppModuleBasic{}) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Time: time.Now()}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: time.Now()}) addrs := simtestutil.CreateIncrementalAccounts(2) delegatorAddr := addrs[0] @@ -73,7 +73,7 @@ func TestWithdrawValidatorCommission(t *testing.T) { key := storetypes.NewKVStoreKey(types.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) encCfg := moduletestutil.MakeTestEncodingConfig(distribution.AppModuleBasic{}) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Time: time.Now()}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: time.Now()}) addrs := simtestutil.CreateIncrementalAccounts(1) valAddr := sdk.ValAddress(addrs[0]) @@ -128,7 +128,7 @@ func TestGetTotalRewards(t *testing.T) { key := storetypes.NewKVStoreKey(types.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) encCfg := moduletestutil.MakeTestEncodingConfig(distribution.AppModuleBasic{}) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Time: time.Now()}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: time.Now()}) addrs := simtestutil.CreateIncrementalAccounts(2) valAddr0 := sdk.ValAddress(addrs[0]) @@ -169,7 +169,7 @@ func TestFundCommunityPool(t *testing.T) { key := storetypes.NewKVStoreKey(types.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) encCfg := moduletestutil.MakeTestEncodingConfig(distribution.AppModuleBasic{}) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Time: time.Now()}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: time.Now()}) addrs := simtestutil.CreateIncrementalAccounts(1) bankKeeper := distrtestutil.NewMockBankKeeper(ctrl) diff --git a/x/distribution/keeper/params_test.go b/x/distribution/keeper/params_test.go index 9ea3b453dfd6..7a4530dd5002 100644 --- a/x/distribution/keeper/params_test.go +++ b/x/distribution/keeper/params_test.go @@ -4,7 +4,7 @@ import ( "testing" storetypes "cosmossdk.io/store/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" @@ -23,7 +23,7 @@ func TestParams(t *testing.T) { key := storetypes.NewKVStoreKey(types.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) encCfg := moduletestutil.MakeTestEncodingConfig(distribution.AppModuleBasic{}) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Height: 1}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Height: 1}) bankKeeper := distrtestutil.NewMockBankKeeper(ctrl) stakingKeeper := distrtestutil.NewMockStakingKeeper(ctrl) diff --git a/x/distribution/simulation/operations_test.go b/x/distribution/simulation/operations_test.go index c3fc152b0933..2fc4d738d318 100644 --- a/x/distribution/simulation/operations_test.go +++ b/x/distribution/simulation/operations_test.go @@ -6,7 +6,7 @@ import ( "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/client" @@ -71,7 +71,7 @@ func (suite *SimTestSuite) TestSimulateMsgSetWithdrawAddress() { accounts := suite.getTestingAccounts(r, 3) // begin a new block - suite.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) + suite.app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) // execute operation op := simulation.SimulateMsgSetWithdrawAddress(suite.txConfig, suite.accountKeeper, suite.bankKeeper, suite.distrKeeper) @@ -111,7 +111,7 @@ func (suite *SimTestSuite) TestSimulateMsgWithdrawDelegatorReward() { suite.setupValidatorRewards(validator0.GetOperator()) // begin a new block - suite.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) + suite.app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) // execute operation op := simulation.SimulateMsgWithdrawDelegatorReward(suite.txConfig, suite.accountKeeper, suite.bankKeeper, suite.distrKeeper, suite.stakingKeeper) @@ -168,7 +168,7 @@ func (suite *SimTestSuite) testSimulateMsgWithdrawValidatorCommission(tokenName suite.distrKeeper.SetValidatorAccumulatedCommission(suite.ctx, suite.genesisVals[0].GetOperator(), types.ValidatorAccumulatedCommission{Commission: valCommission}) // begin a new block - suite.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) + suite.app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) // execute operation op := simulation.SimulateMsgWithdrawValidatorCommission(suite.txConfig, suite.accountKeeper, suite.bankKeeper, suite.distrKeeper, suite.stakingKeeper) @@ -197,7 +197,7 @@ func (suite *SimTestSuite) TestSimulateMsgFundCommunityPool() { accounts := suite.getTestingAccounts(r, 3) // begin a new block - suite.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) + suite.app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) // execute operation op := simulation.SimulateMsgFundCommunityPool(suite.txConfig, suite.accountKeeper, suite.bankKeeper, suite.distrKeeper, suite.stakingKeeper) @@ -253,7 +253,7 @@ func (suite *SimTestSuite) SetupTest() { suite.NoError(err) - suite.ctx = suite.app.BaseApp.NewContext(false, tmproto.Header{}) + suite.ctx = suite.app.BaseApp.NewContext(false, cmtproto.Header{}) genesisVals := suite.stakingKeeper.GetAllValidators(suite.ctx) suite.Require().Len(genesisVals, 1) diff --git a/x/distribution/simulation/proposals_test.go b/x/distribution/simulation/proposals_test.go index a9939c95b98f..fdb59301f622 100644 --- a/x/distribution/simulation/proposals_test.go +++ b/x/distribution/simulation/proposals_test.go @@ -4,7 +4,7 @@ import ( "math/rand" "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" sdk "github.com/cosmos/cosmos-sdk/types" @@ -19,7 +19,7 @@ func TestProposalMsgs(t *testing.T) { s := rand.NewSource(1) r := rand.New(s) - ctx := sdk.NewContext(nil, tmproto.Header{}, true, nil) + ctx := sdk.NewContext(nil, cmtproto.Header{}, true, nil) accounts := simtypes.RandomAccounts(r, 3) // execute ProposalMsgs function diff --git a/x/evidence/README.md b/x/evidence/README.md index 7ef68bc55305..c3f0731af92d 100644 --- a/x/evidence/README.md +++ b/x/evidence/README.md @@ -54,7 +54,7 @@ type Evidence interface { Route() string String() string - Hash() tmbytes.HexBytes + Hash() cmtbytes.HexBytes ValidateBasic() error // Height at which the infraction occurred diff --git a/x/evidence/client/cli/query_test.go b/x/evidence/client/cli/query_test.go index b8e289024df5..25bc3bd4bce3 100644 --- a/x/evidence/client/cli/query_test.go +++ b/x/evidence/client/cli/query_test.go @@ -30,7 +30,7 @@ func TestGetQueryCmd(t *testing.T) { WithKeyring(kr). WithTxConfig(encCfg.TxConfig). WithCodec(encCfg.Codec). - WithClient(clitestutil.MockTendermintRPC{Client: rpcclientmock.Client{}}). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). WithAccountRetriever(client.MockAccountRetriever{}). WithOutput(io.Discard). WithChainID("test-chain") @@ -46,7 +46,7 @@ func TestGetQueryCmd(t *testing.T) { []string{"DF0C23E8634E480F84B9D5674A7CDC9816466DEC28A3358F73260F68D28D7660"}, func() client.Context { bz, _ := encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return baseCtx.WithClient(c) @@ -59,7 +59,7 @@ func TestGetQueryCmd(t *testing.T) { []string{}, func() client.Context { bz, _ := encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return baseCtx.WithClient(c) @@ -74,7 +74,7 @@ func TestGetQueryCmd(t *testing.T) { }, func() client.Context { bz, _ := encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return baseCtx.WithClient(c) diff --git a/x/evidence/exported/evidence.go b/x/evidence/exported/evidence.go index d936fc4e2ccc..57a70e55d014 100644 --- a/x/evidence/exported/evidence.go +++ b/x/evidence/exported/evidence.go @@ -1,7 +1,7 @@ package exported import ( - tmbytes "github.com/cometbft/cometbft/libs/bytes" + cmtbytes "github.com/cometbft/cometbft/libs/bytes" "github.com/cosmos/gogoproto/proto" sdk "github.com/cosmos/cosmos-sdk/types" @@ -14,7 +14,7 @@ type Evidence interface { Route() string String() string - Hash() tmbytes.HexBytes + Hash() cmtbytes.HexBytes ValidateBasic() error // Height at which the infraction occurred diff --git a/x/evidence/genesis_test.go b/x/evidence/genesis_test.go index 09f3263273d0..de985ae3d7d8 100644 --- a/x/evidence/genesis_test.go +++ b/x/evidence/genesis_test.go @@ -10,7 +10,7 @@ import ( "cosmossdk.io/x/evidence/keeper" "cosmossdk.io/x/evidence/testutil" "cosmossdk.io/x/evidence/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -32,7 +32,7 @@ func (suite *GenesisTestSuite) SetupTest() { app, err := simtestutil.Setup(testutil.AppConfig, &evidenceKeeper) require.NoError(suite.T(), err) - suite.ctx = app.BaseApp.NewContext(false, tmproto.Header{Height: 1}) + suite.ctx = app.BaseApp.NewContext(false, cmtproto.Header{Height: 1}) suite.keeper = evidenceKeeper } diff --git a/x/evidence/go.mod b/x/evidence/go.mod index 9b8a96e4e10f..34407fc39fda 100644 --- a/x/evidence/go.mod +++ b/x/evidence/go.mod @@ -7,7 +7,7 @@ require ( cosmossdk.io/core v0.5.1 cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/math v1.0.0-beta.6 - cosmossdk.io/store v0.0.0-20230204135315-697871069999 + cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 github.com/cometbft/cometbft v0.0.0-20230203130311-387422ac220d github.com/cosmos/cosmos-proto v1.0.0-beta.1 github.com/cosmos/cosmos-sdk v0.47.0-rc2 @@ -19,7 +19,7 @@ require ( github.com/stretchr/testify v1.8.1 google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 google.golang.org/grpc v1.52.3 - google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a + google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af ) require ( @@ -147,7 +147,6 @@ require ( replace ( github.com/cosmos/cosmos-sdk => ../.. - // Fix upstream GHSA-h395-qcrw-5vmq vulnerability. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.8.1 diff --git a/x/evidence/go.sum b/x/evidence/go.sum index 87ca033b60c5..2972dc70a2cc 100644 --- a/x/evidence/go.sum +++ b/x/evidence/go.sum @@ -49,6 +49,8 @@ cosmossdk.io/math v1.0.0-beta.6 h1:WF29SiFYNde5eYvqO2kdOM9nYbDb44j3YW5B8M1m9KE= cosmossdk.io/math v1.0.0-beta.6/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= cosmossdk.io/store v0.0.0-20230204135315-697871069999 h1:NrV990BIbdDngOoTrD3Hg5kqqgvy6c+ETaKGY5bSUmo= cosmossdk.io/store v0.0.0-20230204135315-697871069999/go.mod h1:Sf3G8SV8e8H31CD6w+o2syqCwyaoL0fe244JcPSsaD4= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7/go.mod h1:1XOtuYs7jsfQkn7G3VQXB6I+2tHXKHZw2U/AafNbnlk= cosmossdk.io/x/tx v0.1.0 h1:uyyYVjG22B+jf54N803Z99Y1uPvfuNP3K1YShoCHYL8= cosmossdk.io/x/tx v0.1.0/go.mod h1:qsDv7e1fSftkF16kpSAk+7ROOojyj+SC0Mz3ukI52EQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -1266,6 +1268,8 @@ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a h1:KJVqJe240LvVd+8lfzRx3hQ0UZ0fyeXEMDMHviRNQKs= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af h1:rAgzfIj9FJtmJ6ZPDlxXX6Fzzix6NOpPTvVmPY5rwQg= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/evidence/keeper/keeper.go b/x/evidence/keeper/keeper.go index f61a99499bd7..6dfc53490d52 100644 --- a/x/evidence/keeper/keeper.go +++ b/x/evidence/keeper/keeper.go @@ -5,7 +5,7 @@ import ( "cosmossdk.io/x/evidence/exported" "cosmossdk.io/x/evidence/types" - tmbytes "github.com/cometbft/cometbft/libs/bytes" + cmtbytes "github.com/cometbft/cometbft/libs/bytes" "github.com/cometbft/cometbft/libs/log" "cosmossdk.io/store/prefix" @@ -109,7 +109,7 @@ func (k Keeper) SetEvidence(ctx sdk.Context, evidence exported.Evidence) { // GetEvidence retrieves Evidence by hash if it exists. If no Evidence exists for // the given hash, (nil, false) is returned. -func (k Keeper) GetEvidence(ctx sdk.Context, hash tmbytes.HexBytes) (exported.Evidence, bool) { +func (k Keeper) GetEvidence(ctx sdk.Context, hash cmtbytes.HexBytes) (exported.Evidence, bool) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixEvidence) bz := store.Get(hash) diff --git a/x/evidence/keeper/keeper_test.go b/x/evidence/keeper/keeper_test.go index 166fc9cf0d31..ff8de64f5bc7 100644 --- a/x/evidence/keeper/keeper_test.go +++ b/x/evidence/keeper/keeper_test.go @@ -10,7 +10,7 @@ import ( "cosmossdk.io/x/evidence/keeper" evidencetestutil "cosmossdk.io/x/evidence/testutil" "cosmossdk.io/x/evidence/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" @@ -111,7 +111,7 @@ func (suite *KeeperTestSuite) SetupTest() { router = router.AddRoute(types.RouteEquivocation, testEquivocationHandler(evidenceKeeper)) evidenceKeeper.SetRouter(router) - suite.ctx = testCtx.Ctx.WithBlockHeader(tmproto.Header{Height: 1}) + suite.ctx = testCtx.Ctx.WithBlockHeader(cmtproto.Header{Height: 1}) suite.encCfg = moduletestutil.MakeTestEncodingConfig(evidence.AppModuleBasic{}) suite.accountKeeper = accountKeeper diff --git a/x/evidence/types/evidence.go b/x/evidence/types/evidence.go index 18329edbab52..b74d310166f8 100644 --- a/x/evidence/types/evidence.go +++ b/x/evidence/types/evidence.go @@ -7,7 +7,7 @@ import ( "cosmossdk.io/x/evidence/exported" abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/crypto/tmhash" - tmbytes "github.com/cometbft/cometbft/libs/bytes" + cmtbytes "github.com/cometbft/cometbft/libs/bytes" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -21,7 +21,7 @@ var _ exported.Evidence = &Equivocation{} func (e *Equivocation) Route() string { return RouteEquivocation } // Hash returns the hash of an Equivocation object. -func (e *Equivocation) Hash() tmbytes.HexBytes { +func (e *Equivocation) Hash() cmtbytes.HexBytes { bz, err := e.Marshal() if err != nil { panic(err) diff --git a/x/evidence/types/genesis_test.go b/x/evidence/types/genesis_test.go index 07d899542aeb..b06df5622c37 100644 --- a/x/evidence/types/genesis_test.go +++ b/x/evidence/types/genesis_test.go @@ -7,7 +7,7 @@ import ( "cosmossdk.io/x/evidence/exported" "cosmossdk.io/x/evidence/types" - tmbytes "github.com/cometbft/cometbft/libs/bytes" + cmtbytes "github.com/cometbft/cometbft/libs/bytes" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec" @@ -171,8 +171,8 @@ func (*TestEvidence) Route() string { func (*TestEvidence) ProtoMessage() {} func (*TestEvidence) Reset() {} -func (*TestEvidence) Hash() tmbytes.HexBytes { - return tmbytes.HexBytes([]byte("test-hash")) +func (*TestEvidence) Hash() cmtbytes.HexBytes { + return cmtbytes.HexBytes([]byte("test-hash")) } func (*TestEvidence) ValidateBasic() error { diff --git a/x/feegrant/basic_fee_test.go b/x/feegrant/basic_fee_test.go index cb2e02a20467..00e5ce5cc367 100644 --- a/x/feegrant/basic_fee_test.go +++ b/x/feegrant/basic_fee_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -19,7 +19,7 @@ func TestBasicFeeValidAllow(t *testing.T) { key := storetypes.NewKVStoreKey(feegrant.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Height: 1}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Height: 1}) badTime := ctx.BlockTime().AddDate(0, 0, -1) allowace := &feegrant.BasicAllowance{ @@ -27,7 +27,7 @@ func TestBasicFeeValidAllow(t *testing.T) { } require.Error(t, allowace.ValidateBasic()) - ctx = ctx.WithBlockHeader(tmproto.Header{ + ctx = ctx.WithBlockHeader(cmtproto.Header{ Time: time.Now(), }) eth := sdk.NewCoins(sdk.NewInt64Coin("eth", 10)) diff --git a/x/feegrant/client/cli/tx_test.go b/x/feegrant/client/cli/tx_test.go index 710555ded8e9..776e8c12bac9 100644 --- a/x/feegrant/client/cli/tx_test.go +++ b/x/feegrant/client/cli/tx_test.go @@ -63,7 +63,7 @@ func (s *CLITestSuite) SetupSuite() { WithKeyring(s.kr). WithTxConfig(s.encCfg.TxConfig). WithCodec(s.encCfg.Codec). - WithClient(clitestutil.MockTendermintRPC{Client: rpcclientmock.Client{}}). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). WithAccountRetriever(client.MockAccountRetriever{}). WithOutput(io.Discard). WithChainID("test-chain") @@ -71,7 +71,7 @@ func (s *CLITestSuite) SetupSuite() { var outBuf bytes.Buffer ctxGen := func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) diff --git a/x/feegrant/go.mod b/x/feegrant/go.mod index 5c2aaec69e56..f752c77608da 100644 --- a/x/feegrant/go.mod +++ b/x/feegrant/go.mod @@ -7,7 +7,7 @@ require ( cosmossdk.io/core v0.5.1 cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/math v1.0.0-beta.6 - cosmossdk.io/store v0.0.0-20230204135315-697871069999 + cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 github.com/cometbft/cometbft v0.0.0-20230203130311-387422ac220d github.com/cosmos/cosmos-proto v1.0.0-beta.1 github.com/cosmos/cosmos-sdk v0.47.0-rc2 @@ -19,7 +19,7 @@ require ( github.com/stretchr/testify v1.8.1 google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 google.golang.org/grpc v1.52.3 - google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a + google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af ) require ( @@ -149,7 +149,6 @@ require ( replace ( github.com/cosmos/cosmos-sdk => ../.. - // Fix upstream GHSA-h395-qcrw-5vmq vulnerability. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.8.1 diff --git a/x/feegrant/go.sum b/x/feegrant/go.sum index 986b4d421c1f..ff887969913f 100644 --- a/x/feegrant/go.sum +++ b/x/feegrant/go.sum @@ -49,6 +49,8 @@ cosmossdk.io/math v1.0.0-beta.6 h1:WF29SiFYNde5eYvqO2kdOM9nYbDb44j3YW5B8M1m9KE= cosmossdk.io/math v1.0.0-beta.6/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= cosmossdk.io/store v0.0.0-20230204135315-697871069999 h1:NrV990BIbdDngOoTrD3Hg5kqqgvy6c+ETaKGY5bSUmo= cosmossdk.io/store v0.0.0-20230204135315-697871069999/go.mod h1:Sf3G8SV8e8H31CD6w+o2syqCwyaoL0fe244JcPSsaD4= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7/go.mod h1:1XOtuYs7jsfQkn7G3VQXB6I+2tHXKHZw2U/AafNbnlk= cosmossdk.io/x/tx v0.1.0 h1:uyyYVjG22B+jf54N803Z99Y1uPvfuNP3K1YShoCHYL8= cosmossdk.io/x/tx v0.1.0/go.mod h1:qsDv7e1fSftkF16kpSAk+7ROOojyj+SC0Mz3ukI52EQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -1269,6 +1271,8 @@ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a h1:KJVqJe240LvVd+8lfzRx3hQ0UZ0fyeXEMDMHviRNQKs= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af h1:rAgzfIj9FJtmJ6ZPDlxXX6Fzzix6NOpPTvVmPY5rwQg= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/feegrant/grant_test.go b/x/feegrant/grant_test.go index 603f149d0a0c..eff034d1650c 100644 --- a/x/feegrant/grant_test.go +++ b/x/feegrant/grant_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" storetypes "cosmossdk.io/store/types" @@ -20,7 +20,7 @@ func TestGrant(t *testing.T) { testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) encCfg := moduletestutil.MakeTestEncodingConfig(module.AppModuleBasic{}) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Time: time.Now()}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: time.Now()}) addr, err := sdk.AccAddressFromBech32("cosmos1qk93t4j0yyzgqgt6k5qf8deh8fq6smpn3ntu3x") require.NoError(t, err) diff --git a/x/feegrant/periodic_fee_test.go b/x/feegrant/periodic_fee_test.go index 9a2ac25e0037..a5f0cb6e8f85 100644 --- a/x/feegrant/periodic_fee_test.go +++ b/x/feegrant/periodic_fee_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -18,7 +18,7 @@ func TestPeriodicFeeValidAllow(t *testing.T) { key := storetypes.NewKVStoreKey(feegrant.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Time: time.Now()}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: time.Now()}) atom := sdk.NewCoins(sdk.NewInt64Coin("atom", 555)) smallAtom := sdk.NewCoins(sdk.NewInt64Coin("atom", 43)) diff --git a/x/feegrant/simulation/operations_test.go b/x/feegrant/simulation/operations_test.go index 7fdb6d542108..354b1bd80a0d 100644 --- a/x/feegrant/simulation/operations_test.go +++ b/x/feegrant/simulation/operations_test.go @@ -10,7 +10,7 @@ import ( "cosmossdk.io/x/feegrant/simulation" "cosmossdk.io/x/feegrant/testutil" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" @@ -48,7 +48,7 @@ func (suite *SimTestSuite) SetupTest() { ) suite.Require().NoError(err) - suite.ctx = suite.app.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) + suite.ctx = suite.app.BaseApp.NewContext(false, cmtproto.Header{Time: time.Now()}) } func (suite *SimTestSuite) getTestingAccounts(r *rand.Rand, n int) []simtypes.Account { @@ -121,7 +121,7 @@ func (suite *SimTestSuite) TestSimulateMsgGrantAllowance() { accounts := suite.getTestingAccounts(r, 3) // begin a new block - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash}}) + app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash}}) // execute operation op := simulation.SimulateMsgGrantAllowance(codec.NewProtoCodec(suite.interfaceRegistry), suite.accountKeeper, suite.bankKeeper, suite.feegrantKeeper) @@ -146,7 +146,7 @@ func (suite *SimTestSuite) TestSimulateMsgRevokeAllowance() { accounts := suite.getTestingAccounts(r, 3) // begin a new block - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) + app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) feeAmt := sdk.TokensFromConsensusPower(200000, sdk.DefaultPowerReduction) feeCoins := sdk.NewCoins(sdk.NewCoin("foo", feeAmt)) diff --git a/x/genutil/client/cli/collect.go b/x/genutil/client/cli/collect.go index 1f18b0b278f9..84860c9f5155 100644 --- a/x/genutil/client/cli/collect.go +++ b/x/genutil/client/cli/collect.go @@ -4,7 +4,7 @@ import ( "encoding/json" "path/filepath" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/pkg/errors" "github.com/spf13/cobra" @@ -36,7 +36,7 @@ func CollectGenTxsCmd(genBalIterator types.GenesisBalancesIterator, defaultNodeH return errors.Wrap(err, "failed to initialize node validator files") } - genDoc, err := tmtypes.GenesisDocFromFile(config.GenesisFile()) + genDoc, err := cmttypes.GenesisDocFromFile(config.GenesisFile()) if err != nil { return errors.Wrap(err, "failed to read genesis doc from file") } diff --git a/x/genutil/client/cli/gentx.go b/x/genutil/client/cli/gentx.go index 73c195bf745a..70fc44100420 100644 --- a/x/genutil/client/cli/gentx.go +++ b/x/genutil/client/cli/gentx.go @@ -9,7 +9,7 @@ import ( "os" "path/filepath" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/pkg/errors" "github.com/spf13/cobra" @@ -81,7 +81,7 @@ $ %s gentx my-key-name 1000000stake --home=/path/to/home/dir --keyring-backend=o } } - genDoc, err := tmtypes.GenesisDocFromFile(config.GenesisFile()) + genDoc, err := cmttypes.GenesisDocFromFile(config.GenesisFile()) if err != nil { return errors.Wrapf(err, "failed to read genesis doc file %s", config.GenesisFile()) } diff --git a/x/genutil/client/cli/gentx_test.go b/x/genutil/client/cli/gentx_test.go index 79855a29da43..ee4d9cf30085 100644 --- a/x/genutil/client/cli/gentx_test.go +++ b/x/genutil/client/cli/gentx_test.go @@ -46,7 +46,7 @@ func (s *CLITestSuite) SetupSuite() { WithKeyring(s.kr). WithTxConfig(s.encCfg.TxConfig). WithCodec(s.encCfg.Codec). - WithClient(clitestutil.MockTendermintRPC{Client: rpcclientmock.Client{}}). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). WithAccountRetriever(client.MockAccountRetriever{}). WithOutput(io.Discard). WithChainID("test-chain") @@ -54,7 +54,7 @@ func (s *CLITestSuite) SetupSuite() { var outBuf bytes.Buffer ctxGen := func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) diff --git a/x/genutil/client/cli/init.go b/x/genutil/client/cli/init.go index 1a7c6472e06f..408fd6e396d9 100644 --- a/x/genutil/client/cli/init.go +++ b/x/genutil/client/cli/init.go @@ -9,7 +9,7 @@ import ( cfg "github.com/cometbft/cometbft/config" "github.com/cometbft/cometbft/libs/cli" - tmrand "github.com/cometbft/cometbft/libs/rand" + cmtrand "github.com/cometbft/cometbft/libs/rand" "github.com/cometbft/cometbft/types" "github.com/cosmos/go-bip39" "github.com/pkg/errors" @@ -86,7 +86,7 @@ func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command { case clientCtx.ChainID != "": chainID = clientCtx.ChainID default: - chainID = fmt.Sprintf("test-chain-%v", tmrand.Str(6)) + chainID = fmt.Sprintf("test-chain-%v", cmtrand.Str(6)) } // Get bip39 mnemonic diff --git a/x/genutil/client/cli/migrate.go b/x/genutil/client/cli/migrate.go index 5adee805648e..b041449c1e7c 100644 --- a/x/genutil/client/cli/migrate.go +++ b/x/genutil/client/cli/migrate.go @@ -6,7 +6,7 @@ import ( "sort" "time" - tmjson "github.com/cometbft/cometbft/libs/json" + cmtjson "github.com/cometbft/cometbft/libs/json" "github.com/pkg/errors" "github.com/spf13/cobra" "golang.org/x/exp/maps" @@ -112,7 +112,7 @@ $ %s migrate v0.36 /path/to/genesis.json --chain-id=cosmoshub-3 --genesis-time=2 genDoc.ChainID = chainID } - bz, err := tmjson.Marshal(genDoc) + bz, err := cmtjson.Marshal(genDoc) if err != nil { return errors.Wrap(err, "failed to marshal genesis doc") } diff --git a/x/genutil/client/cli/validate_genesis.go b/x/genutil/client/cli/validate_genesis.go index 1aee29a64e28..7a3eae970f09 100644 --- a/x/genutil/client/cli/validate_genesis.go +++ b/x/genutil/client/cli/validate_genesis.go @@ -4,7 +4,7 @@ import ( "encoding/json" "fmt" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" @@ -57,8 +57,8 @@ func ValidateGenesisCmd(mbm module.BasicManager) *cobra.Command { // validateGenDoc reads a genesis file and validates that it is a correct // Tendermint GenesisDoc. This function does not do any cosmos-related // validation. -func validateGenDoc(importGenesisFile string) (*tmtypes.GenesisDoc, error) { - genDoc, err := tmtypes.GenesisDocFromFile(importGenesisFile) +func validateGenDoc(importGenesisFile string) (*cmttypes.GenesisDoc, error) { + genDoc, err := cmttypes.GenesisDocFromFile(importGenesisFile) if err != nil { return nil, fmt.Errorf("%s. Make sure that"+ " you have correctly migrated all Tendermint consensus params, please see the"+ diff --git a/x/genutil/client/testutil/helpers.go b/x/genutil/client/testutil/helpers.go index d809ec3eff69..a27ecd29acd7 100644 --- a/x/genutil/client/testutil/helpers.go +++ b/x/genutil/client/testutil/helpers.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - tmcfg "github.com/cometbft/cometbft/config" + cmtcfg "github.com/cometbft/cometbft/config" "github.com/cometbft/cometbft/libs/cli" "github.com/cometbft/cometbft/libs/log" "github.com/spf13/viper" @@ -40,10 +40,10 @@ func ExecInitCmd(testMbm module.BasicManager, home string, cdc codec.Codec) erro return cmd.ExecuteContext(ctx) } -func CreateDefaultTendermintConfig(rootDir string) (*tmcfg.Config, error) { - conf := tmcfg.DefaultConfig() +func CreateDefaultTendermintConfig(rootDir string) (*cmtcfg.Config, error) { + conf := cmtcfg.DefaultConfig() conf.SetRoot(rootDir) - tmcfg.EnsureRoot(rootDir) + cmtcfg.EnsureRoot(rootDir) if err := conf.ValidateBasic(); err != nil { return nil, fmt.Errorf("error in config file: %v", err) diff --git a/x/genutil/collect.go b/x/genutil/collect.go index 44cc95686808..8a8f856ea0f1 100644 --- a/x/genutil/collect.go +++ b/x/genutil/collect.go @@ -11,7 +11,7 @@ import ( "strings" cfg "github.com/cometbft/cometbft/config" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -23,7 +23,7 @@ import ( // GenAppStateFromConfig gets the genesis app state from the config func GenAppStateFromConfig(cdc codec.JSONCodec, txEncodingConfig client.TxEncodingConfig, - config *cfg.Config, initCfg types.InitConfig, genDoc tmtypes.GenesisDoc, genBalIterator types.GenesisBalancesIterator, + config *cfg.Config, initCfg types.InitConfig, genDoc cmttypes.GenesisDoc, genBalIterator types.GenesisBalancesIterator, validator types.MessageValidator, ) (appState json.RawMessage, err error) { // process genesis transactions, else create default genesis.json @@ -66,7 +66,7 @@ func GenAppStateFromConfig(cdc codec.JSONCodec, txEncodingConfig client.TxEncodi // CollectTxs processes and validates application's genesis Txs and returns // the list of appGenTxs, and persistent peers required to generate genesis.json. func CollectTxs(cdc codec.JSONCodec, txJSONDecoder sdk.TxDecoder, moniker, genTxsDir string, - genDoc tmtypes.GenesisDoc, genBalIterator types.GenesisBalancesIterator, + genDoc cmttypes.GenesisDoc, genBalIterator types.GenesisBalancesIterator, validator types.MessageValidator, ) (appGenTxs []sdk.Tx, persistentPeers string, err error) { // prepare a map of all balances in genesis state to then validate diff --git a/x/genutil/collect_test.go b/x/genutil/collect_test.go index b8ed0f2da971..ac1a9f66bbfd 100644 --- a/x/genutil/collect_test.go +++ b/x/genutil/collect_test.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/gogoproto/proto" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -57,7 +57,7 @@ func TestCollectTxsHandlesDirectories(t *testing.T) { srvCtx := server.NewDefaultContext() _ = srvCtx cdc := codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) - gdoc := tmtypes.GenesisDoc{AppState: []byte("{}")} + gdoc := cmttypes.GenesisDoc{AppState: []byte("{}")} balItr := new(doNothingIterator) dnc := &doNothingUnmarshalJSON{cdc} diff --git a/x/genutil/testutil/expected_keepers_mocks.go b/x/genutil/testutil/expected_keepers_mocks.go index 5bd59a767b13..51d75e6e8962 100644 --- a/x/genutil/testutil/expected_keepers_mocks.go +++ b/x/genutil/testutil/expected_keepers_mocks.go @@ -8,11 +8,11 @@ import ( json "encoding/json" reflect "reflect" + types "github.com/cometbft/cometbft/abci/types" codec "github.com/cosmos/cosmos-sdk/codec" - types "github.com/cosmos/cosmos-sdk/types" + types0 "github.com/cosmos/cosmos-sdk/types" exported "github.com/cosmos/cosmos-sdk/x/bank/exported" gomock "github.com/golang/mock/gomock" - types0 "github.com/cometbft/cometbft/abci/types" ) // MockStakingKeeper is a mock of StakingKeeper interface. @@ -39,10 +39,10 @@ func (m *MockStakingKeeper) EXPECT() *MockStakingKeeperMockRecorder { } // ApplyAndReturnValidatorSetUpdates mocks base method. -func (m *MockStakingKeeper) ApplyAndReturnValidatorSetUpdates(arg0 types.Context) ([]types0.ValidatorUpdate, error) { +func (m *MockStakingKeeper) ApplyAndReturnValidatorSetUpdates(arg0 types0.Context) ([]types.ValidatorUpdate, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ApplyAndReturnValidatorSetUpdates", arg0) - ret0, _ := ret[0].([]types0.ValidatorUpdate) + ret0, _ := ret[0].([]types.ValidatorUpdate) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -77,7 +77,7 @@ func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder { } // IterateAccounts mocks base method. -func (m *MockAccountKeeper) IterateAccounts(ctx types.Context, process func(types.AccountI) bool) { +func (m *MockAccountKeeper) IterateAccounts(ctx types0.Context, process func(types0.AccountI) bool) { m.ctrl.T.Helper() m.ctrl.Call(m, "IterateAccounts", ctx, process) } @@ -89,10 +89,10 @@ func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process interface{ } // NewAccount mocks base method. -func (m *MockAccountKeeper) NewAccount(arg0 types.Context, arg1 types.AccountI) types.AccountI { +func (m *MockAccountKeeper) NewAccount(arg0 types0.Context, arg1 types0.AccountI) types0.AccountI { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "NewAccount", arg0, arg1) - ret0, _ := ret[0].(types.AccountI) + ret0, _ := ret[0].(types0.AccountI) return ret0 } @@ -103,7 +103,7 @@ func (mr *MockAccountKeeperMockRecorder) NewAccount(arg0, arg1 interface{}) *gom } // SetAccount mocks base method. -func (m *MockAccountKeeper) SetAccount(arg0 types.Context, arg1 types.AccountI) { +func (m *MockAccountKeeper) SetAccount(arg0 types0.Context, arg1 types0.AccountI) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetAccount", arg0, arg1) } @@ -138,7 +138,7 @@ func (m *MockGenesisAccountsIterator) EXPECT() *MockGenesisAccountsIteratorMockR } // IterateGenesisAccounts mocks base method. -func (m *MockGenesisAccountsIterator) IterateGenesisAccounts(cdc *codec.LegacyAmino, appGenesis map[string]json.RawMessage, cb func(types.AccountI) bool) { +func (m *MockGenesisAccountsIterator) IterateGenesisAccounts(cdc *codec.LegacyAmino, appGenesis map[string]json.RawMessage, cb func(types0.AccountI) bool) { m.ctrl.T.Helper() m.ctrl.Call(m, "IterateGenesisAccounts", cdc, appGenesis, cb) } diff --git a/x/genutil/types/genesis_state.go b/x/genutil/types/genesis_state.go index 79daf2cee093..f1b4f6884de2 100644 --- a/x/genutil/types/genesis_state.go +++ b/x/genutil/types/genesis_state.go @@ -5,7 +5,7 @@ import ( "fmt" "os" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" @@ -66,7 +66,7 @@ func SetGenesisStateInAppState( // for the application. // // NOTE: The pubkey input is this machines pubkey. -func GenesisStateFromGenDoc(genDoc tmtypes.GenesisDoc) (genesisState map[string]json.RawMessage, err error) { +func GenesisStateFromGenDoc(genDoc cmttypes.GenesisDoc) (genesisState map[string]json.RawMessage, err error) { if err = json.Unmarshal(genDoc.AppState, &genesisState); err != nil { return genesisState, err } @@ -77,13 +77,13 @@ func GenesisStateFromGenDoc(genDoc tmtypes.GenesisDoc) (genesisState map[string] // for the application. // // NOTE: The pubkey input is this machines pubkey. -func GenesisStateFromGenFile(genFile string) (genesisState map[string]json.RawMessage, genDoc *tmtypes.GenesisDoc, err error) { +func GenesisStateFromGenFile(genFile string) (genesisState map[string]json.RawMessage, genDoc *cmttypes.GenesisDoc, err error) { if _, err := os.Stat(genFile); os.IsNotExist(err) { return genesisState, genDoc, fmt.Errorf("%s does not exist, run `init` first", genFile) } - genDoc, err = tmtypes.GenesisDocFromFile(genFile) + genDoc, err = cmttypes.GenesisDocFromFile(genFile) if err != nil { return genesisState, genDoc, err } diff --git a/x/genutil/utils.go b/x/genutil/utils.go index 05a5b2c40142..b65d958e24db 100644 --- a/x/genutil/utils.go +++ b/x/genutil/utils.go @@ -11,7 +11,7 @@ import ( tmed25519 "github.com/cometbft/cometbft/crypto/ed25519" "github.com/cometbft/cometbft/p2p" "github.com/cometbft/cometbft/privval" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/go-bip39" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" @@ -20,7 +20,7 @@ import ( // ExportGenesisFile creates and writes the genesis configuration to disk. An // error is returned if building or writing the configuration to file fails. -func ExportGenesisFile(genDoc *tmtypes.GenesisDoc, genFile string) error { +func ExportGenesisFile(genDoc *cmttypes.GenesisDoc, genFile string) error { if err := genDoc.ValidateAndComplete(); err != nil { return err } @@ -31,10 +31,10 @@ func ExportGenesisFile(genDoc *tmtypes.GenesisDoc, genFile string) error { // ExportGenesisFileWithTime creates and writes the genesis configuration to disk. // An error is returned if building or writing the configuration to file fails. func ExportGenesisFileWithTime( - genFile, chainID string, validators []tmtypes.GenesisValidator, + genFile, chainID string, validators []cmttypes.GenesisValidator, appState json.RawMessage, genTime time.Time, ) error { - genDoc := tmtypes.GenesisDoc{ + genDoc := cmttypes.GenesisDoc{ GenesisTime: genTime, ChainID: chainID, Validators: validators, diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index a6f10b9bfde4..93df9fc4809d 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -6,7 +6,7 @@ import ( "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -25,10 +25,10 @@ import ( func TestTickExpiredDepositPeriod(t *testing.T) { suite := createTestSuite(t) app := suite.App - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) addrs := simtestutil.AddTestAddrs(suite.BankKeeper, suite.StakingKeeper, ctx, 10, valTokens) - header := tmproto.Header{Height: app.LastBlockHeight() + 1} + header := cmtproto.Header{Height: app.LastBlockHeight() + 1} app.BeginBlock(abci.RequestBeginBlock{Header: header}) govMsgSvr := keeper.NewMsgServerImpl(suite.GovKeeper) @@ -82,10 +82,10 @@ func TestTickExpiredDepositPeriod(t *testing.T) { func TestTickMultipleExpiredDepositPeriod(t *testing.T) { suite := createTestSuite(t) app := suite.App - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) addrs := simtestutil.AddTestAddrs(suite.BankKeeper, suite.StakingKeeper, ctx, 10, valTokens) - header := tmproto.Header{Height: app.LastBlockHeight() + 1} + header := cmtproto.Header{Height: app.LastBlockHeight() + 1} app.BeginBlock(abci.RequestBeginBlock{Header: header}) govMsgSvr := keeper.NewMsgServerImpl(suite.GovKeeper) @@ -168,10 +168,10 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { func TestTickPassedDepositPeriod(t *testing.T) { suite := createTestSuite(t) app := suite.App - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) addrs := simtestutil.AddTestAddrs(suite.BankKeeper, suite.StakingKeeper, ctx, 10, valTokens) - header := tmproto.Header{Height: app.LastBlockHeight() + 1} + header := cmtproto.Header{Height: app.LastBlockHeight() + 1} app.BeginBlock(abci.RequestBeginBlock{Header: header}) govMsgSvr := keeper.NewMsgServerImpl(suite.GovKeeper) @@ -241,13 +241,13 @@ func TestTickPassedVotingPeriod(t *testing.T) { t.Run(tc.name, func(t *testing.T) { suite := createTestSuite(t) app := suite.App - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) depositMultiplier := getDepositMultiplier(tc.expedited) addrs := simtestutil.AddTestAddrs(suite.BankKeeper, suite.StakingKeeper, ctx, 10, valTokens.Mul(math.NewInt(depositMultiplier))) SortAddresses(addrs) - header := tmproto.Header{Height: app.LastBlockHeight() + 1} + header := cmtproto.Header{Height: app.LastBlockHeight() + 1} app.BeginBlock(abci.RequestBeginBlock{Header: header}) govMsgSvr := keeper.NewMsgServerImpl(suite.GovKeeper) @@ -345,7 +345,7 @@ func TestProposalPassedEndblocker(t *testing.T) { t.Run(tc.name, func(t *testing.T) { suite := createTestSuite(t) app := suite.App - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) depositMultiplier := getDepositMultiplier(tc.expedited) addrs := simtestutil.AddTestAddrs(suite.BankKeeper, suite.StakingKeeper, ctx, 10, valTokens.Mul(math.NewInt(depositMultiplier))) @@ -354,7 +354,7 @@ func TestProposalPassedEndblocker(t *testing.T) { govMsgSvr := keeper.NewMsgServerImpl(suite.GovKeeper) stakingMsgSvr := stakingkeeper.NewMsgServerImpl(suite.StakingKeeper) - header := tmproto.Header{Height: app.LastBlockHeight() + 1} + header := cmtproto.Header{Height: app.LastBlockHeight() + 1} app.BeginBlock(abci.RequestBeginBlock{Header: header}) valAddr := sdk.ValAddress(addrs[0]) @@ -403,13 +403,13 @@ func TestProposalPassedEndblocker(t *testing.T) { func TestEndBlockerProposalHandlerFailed(t *testing.T) { suite := createTestSuite(t) app := suite.App - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) addrs := simtestutil.AddTestAddrs(suite.BankKeeper, suite.StakingKeeper, ctx, 1, valTokens) SortAddresses(addrs) stakingMsgSvr := stakingkeeper.NewMsgServerImpl(suite.StakingKeeper) - header := tmproto.Header{Height: app.LastBlockHeight() + 1} + header := cmtproto.Header{Height: app.LastBlockHeight() + 1} app.BeginBlock(abci.RequestBeginBlock{Header: header}) valAddr := sdk.ValAddress(addrs[0]) @@ -473,7 +473,7 @@ func TestExpeditedProposal_PassAndConversionToRegular(t *testing.T) { t.Run(tc.name, func(t *testing.T) { suite := createTestSuite(t) app := suite.App - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) depositMultiplier := getDepositMultiplier(true) addrs := simtestutil.AddTestAddrs(suite.BankKeeper, suite.StakingKeeper, ctx, 3, valTokens.Mul(math.NewInt(depositMultiplier))) params := suite.GovKeeper.GetParams(ctx) @@ -483,7 +483,7 @@ func TestExpeditedProposal_PassAndConversionToRegular(t *testing.T) { govMsgSvr := keeper.NewMsgServerImpl(suite.GovKeeper) stakingMsgSvr := stakingkeeper.NewMsgServerImpl(suite.StakingKeeper) - header := tmproto.Header{Height: app.LastBlockHeight() + 1} + header := cmtproto.Header{Height: app.LastBlockHeight() + 1} app.BeginBlock(abci.RequestBeginBlock{Header: header}) valAddr := sdk.ValAddress(addrs[0]) diff --git a/x/gov/client/cli/tx_test.go b/x/gov/client/cli/tx_test.go index 56e4deb0a491..d052aa779e54 100644 --- a/x/gov/client/cli/tx_test.go +++ b/x/gov/client/cli/tx_test.go @@ -48,7 +48,7 @@ func (s *CLITestSuite) SetupSuite() { WithKeyring(s.kr). WithTxConfig(s.encCfg.TxConfig). WithCodec(s.encCfg.Codec). - WithClient(clitestutil.MockTendermintRPC{Client: rpcclientmock.Client{}}). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). WithAccountRetriever(client.MockAccountRetriever{}). WithOutput(io.Discard). WithChainID("test-chain") @@ -56,7 +56,7 @@ func (s *CLITestSuite) SetupSuite() { var outBuf bytes.Buffer ctxGen := func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) diff --git a/x/gov/client/utils/query_test.go b/x/gov/client/utils/query_test.go index 9619d6ce54ef..66dc7b2539a1 100644 --- a/x/gov/client/utils/query_test.go +++ b/x/gov/client/utils/query_test.go @@ -7,7 +7,7 @@ import ( "github.com/cometbft/cometbft/rpc/client/mock" coretypes "github.com/cometbft/cometbft/rpc/core/types" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/client" @@ -21,7 +21,7 @@ import ( type TxSearchMock struct { txConfig client.TxConfig mock.Client - txs []tmtypes.Tx + txs []cmttypes.Tx } func (mock TxSearchMock) TxSearch(ctx context.Context, query string, prove bool, page, perPage *int, orderBy string) (*coretypes.ResultTxSearch, error) { @@ -38,7 +38,7 @@ func (mock TxSearchMock) TxSearch(ctx context.Context, query string, prove bool, msgType := messageAction.FindStringSubmatch(query)[1] // Filter only the txs that match the query - matchingTxs := make([]tmtypes.Tx, 0) + matchingTxs := make([]cmttypes.Tx, 0) for _, tx := range mock.txs { sdkTx, err := mock.txConfig.TxDecoder()(tx) if err != nil { @@ -71,7 +71,7 @@ func (mock TxSearchMock) TxSearch(ctx context.Context, query string, prove bool, func (mock TxSearchMock) Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error) { // any non nil Block needs to be returned. used to get time value - return &coretypes.ResultBlock{Block: &tmtypes.Block{}}, nil + return &coretypes.ResultBlock{Block: &cmttypes.Block{}}, nil } func TestGetPaginatedVotes(t *testing.T) { @@ -163,7 +163,7 @@ func TestGetPaginatedVotes(t *testing.T) { tc := tc t.Run(tc.description, func(t *testing.T) { - marshalled := make([]tmtypes.Tx, len(tc.msgs)) + marshalled := make([]cmttypes.Tx, len(tc.msgs)) cli := TxSearchMock{txs: marshalled, txConfig: encCfg.TxConfig} clientCtx := client.Context{}. WithLegacyAmino(encCfg.Amino). diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index 1afcb9ed1dcc..909a5d0ca992 100644 --- a/x/gov/genesis_test.go +++ b/x/gov/genesis_test.go @@ -3,7 +3,7 @@ package gov_test import ( "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -14,7 +14,7 @@ import ( func TestImportExportQueues_ErrorUnconsistentState(t *testing.T) { suite := createTestSuite(t) app := suite.App - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) require.Panics(t, func() { gov.InitGenesis(ctx, suite.AccountKeeper, suite.BankKeeper, suite.GovKeeper, &v1.GenesisState{ Deposits: v1.Deposits{ diff --git a/x/gov/keeper/common_test.go b/x/gov/keeper/common_test.go index d462edb4bf63..3c1af49a2aeb 100644 --- a/x/gov/keeper/common_test.go +++ b/x/gov/keeper/common_test.go @@ -5,8 +5,8 @@ import ( "testing" "cosmossdk.io/math" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtime "github.com/cometbft/cometbft/types/time" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttime "github.com/cometbft/cometbft/types/time" "github.com/golang/mock/gomock" storetypes "cosmossdk.io/store/types" @@ -59,7 +59,7 @@ func setupGovKeeper(t *testing.T) ( ) { key := storetypes.NewKVStoreKey(types.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Time: tmtime.Now()}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: cmttime.Now()}) encCfg := moduletestutil.MakeTestEncodingConfig() v1.RegisterInterfaces(encCfg.InterfaceRegistry) v1beta1.RegisterInterfaces(encCfg.InterfaceRegistry) diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index 806beb5d0d42..6293d9815e87 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -7,7 +7,7 @@ import ( "time" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/runtime" @@ -140,7 +140,7 @@ func TestSimulateMsgSubmitProposal(t *testing.T) { accounts := getTestingAccounts(t, r, suite.AccountKeeper, suite.BankKeeper, suite.StakingKeeper, ctx, 3) // begin a new block - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash}}) + app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash}}) // execute operation op := simulation.SimulateMsgSubmitProposal(suite.AccountKeeper, suite.BankKeeper, suite.GovKeeper, MockWeightedProposals{3}.MsgSimulatorFn()) @@ -170,7 +170,7 @@ func TestSimulateMsgSubmitLegacyProposal(t *testing.T) { accounts := getTestingAccounts(t, r, suite.AccountKeeper, suite.BankKeeper, suite.StakingKeeper, ctx, 3) // begin a new block - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash}}) + app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash}}) // execute operation op := simulation.SimulateMsgSubmitLegacyProposal(suite.AccountKeeper, suite.BankKeeper, suite.GovKeeper, MockWeightedProposals{3}.ContentSimulatorFn()) @@ -217,7 +217,7 @@ func TestSimulateMsgCancelProposal(t *testing.T) { suite.GovKeeper.SetProposal(ctx, proposal) // begin a new block - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash, Time: blockTime}}) + app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash, Time: blockTime}}) // execute operation op := simulation.SimulateMsgCancelProposal(suite.AccountKeeper, suite.BankKeeper, suite.GovKeeper) @@ -261,7 +261,7 @@ func TestSimulateMsgDeposit(t *testing.T) { suite.GovKeeper.SetProposal(ctx, proposal) // begin a new block - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash, Time: blockTime}}) + app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash, Time: blockTime}}) // execute operation op := simulation.SimulateMsgDeposit(suite.AccountKeeper, suite.BankKeeper, suite.GovKeeper) @@ -307,7 +307,7 @@ func TestSimulateMsgVote(t *testing.T) { suite.GovKeeper.ActivateVotingPeriod(ctx, proposal) // begin a new block - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash, Time: blockTime}}) + app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash, Time: blockTime}}) // execute operation op := simulation.SimulateMsgVote(suite.AccountKeeper, suite.BankKeeper, suite.GovKeeper) @@ -350,7 +350,7 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { suite.GovKeeper.ActivateVotingPeriod(ctx, proposal) // begin a new block - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash, Time: blockTime}}) + app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash, Time: blockTime}}) // execute operation op := simulation.SimulateMsgVoteWeighted(suite.AccountKeeper, suite.BankKeeper, suite.GovKeeper) @@ -392,7 +392,7 @@ func createTestSuite(t *testing.T, isCheckTx bool) (suite, sdk.Context) { ), &res.AccountKeeper, &res.BankKeeper, &res.GovKeeper, &res.StakingKeeper, &res.DistributionKeeper) require.NoError(t, err) - ctx := app.BaseApp.NewContext(isCheckTx, tmproto.Header{}) + ctx := app.BaseApp.NewContext(isCheckTx, cmtproto.Header{}) res.App = app return res, ctx diff --git a/x/gov/simulation/proposals_test.go b/x/gov/simulation/proposals_test.go index b3f877594ad9..066d24a905bf 100644 --- a/x/gov/simulation/proposals_test.go +++ b/x/gov/simulation/proposals_test.go @@ -4,7 +4,7 @@ import ( "math/rand" "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" sdk "github.com/cosmos/cosmos-sdk/types" @@ -17,7 +17,7 @@ func TestProposalMsgs(t *testing.T) { s := rand.NewSource(1) r := rand.New(s) - ctx := sdk.NewContext(nil, tmproto.Header{}, true, nil) + ctx := sdk.NewContext(nil, cmtproto.Header{}, true, nil) accounts := simtypes.RandomAccounts(r, 3) // execute ProposalMsgs function @@ -39,7 +39,7 @@ func TestProposalContents(t *testing.T) { s := rand.NewSource(1) r := rand.New(s) - ctx := sdk.NewContext(nil, tmproto.Header{}, true, nil) + ctx := sdk.NewContext(nil, cmtproto.Header{}, true, nil) accounts := simtypes.RandomAccounts(r, 3) // execute ProposalContents function diff --git a/x/group/client/cli/tx_test.go b/x/group/client/cli/tx_test.go index 9ed4126bf268..46f35b137c80 100644 --- a/x/group/client/cli/tx_test.go +++ b/x/group/client/cli/tx_test.go @@ -55,7 +55,7 @@ func (s *CLITestSuite) SetupSuite() { WithKeyring(s.kr). WithTxConfig(s.encCfg.TxConfig). WithCodec(s.encCfg.Codec). - WithClient(clitestutil.MockTendermintRPC{Client: rpcclientmock.Client{}}). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). WithAccountRetriever(client.MockAccountRetriever{}). WithOutput(io.Discard). WithChainID("test-chain") @@ -72,7 +72,7 @@ func (s *CLITestSuite) SetupSuite() { var outBuf bytes.Buffer ctxGen := func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -167,7 +167,7 @@ func (s *CLITestSuite) TestTxCreateGroup() { "correct data", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -189,7 +189,7 @@ func (s *CLITestSuite) TestTxCreateGroup() { "with amino-json", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -212,7 +212,7 @@ func (s *CLITestSuite) TestTxCreateGroup() { "invalid members address", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -234,7 +234,7 @@ func (s *CLITestSuite) TestTxCreateGroup() { "invalid members weight", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -294,7 +294,7 @@ func (s *CLITestSuite) TestTxUpdateGroupAdmin() { ctxGen := func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -341,7 +341,7 @@ func (s *CLITestSuite) TestTxUpdateGroupAdmin() { "correct data", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -363,7 +363,7 @@ func (s *CLITestSuite) TestTxUpdateGroupAdmin() { "with amino-json", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -386,7 +386,7 @@ func (s *CLITestSuite) TestTxUpdateGroupAdmin() { "group id invalid", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -452,7 +452,7 @@ func (s *CLITestSuite) TestTxUpdateGroupMetadata() { "correct data", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -471,7 +471,7 @@ func (s *CLITestSuite) TestTxUpdateGroupMetadata() { "with amino-json", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -491,7 +491,7 @@ func (s *CLITestSuite) TestTxUpdateGroupMetadata() { "group metadata too long", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -565,7 +565,7 @@ func (s *CLITestSuite) TestTxUpdateGroupMembers() { "correct data", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -584,7 +584,7 @@ func (s *CLITestSuite) TestTxUpdateGroupMembers() { "with amino-json", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -604,7 +604,7 @@ func (s *CLITestSuite) TestTxUpdateGroupMembers() { "group member metadata too long", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -623,7 +623,7 @@ func (s *CLITestSuite) TestTxUpdateGroupMembers() { "group doesn't exist", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -701,7 +701,7 @@ func (s *CLITestSuite) TestTxCreateGroupWithPolicy() { "correct data", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -726,7 +726,7 @@ func (s *CLITestSuite) TestTxCreateGroupWithPolicy() { "group-policy-as-admin is true", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -751,7 +751,7 @@ func (s *CLITestSuite) TestTxCreateGroupWithPolicy() { "with amino-json", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -777,7 +777,7 @@ func (s *CLITestSuite) TestTxCreateGroupWithPolicy() { "invalid members address", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -802,7 +802,7 @@ func (s *CLITestSuite) TestTxCreateGroupWithPolicy() { "invalid members weight", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -882,7 +882,7 @@ func (s *CLITestSuite) TestTxCreateGroupPolicy() { "correct data", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -905,7 +905,7 @@ func (s *CLITestSuite) TestTxCreateGroupPolicy() { "correct data with percentage decision policy", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -928,7 +928,7 @@ func (s *CLITestSuite) TestTxCreateGroupPolicy() { "with amino-json", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -952,7 +952,7 @@ func (s *CLITestSuite) TestTxCreateGroupPolicy() { "wrong admin", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -975,7 +975,7 @@ func (s *CLITestSuite) TestTxCreateGroupPolicy() { "invalid percentage decision policy with negative value", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -998,7 +998,7 @@ func (s *CLITestSuite) TestTxCreateGroupPolicy() { "invalid percentage decision policy with value greater than 1", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1071,7 +1071,7 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyAdmin() { "correct data", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1090,7 +1090,7 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyAdmin() { "with amino-json", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1110,7 +1110,7 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyAdmin() { "wrong admin", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1129,7 +1129,7 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyAdmin() { "wrong group policy", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1194,7 +1194,7 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyDecisionPolicy() { "correct data", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1213,7 +1213,7 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyDecisionPolicy() { "correct data with percentage decision policy", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1232,7 +1232,7 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyDecisionPolicy() { "with amino-json", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1252,7 +1252,7 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyDecisionPolicy() { "wrong admin", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1271,7 +1271,7 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyDecisionPolicy() { "wrong group policy", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1290,7 +1290,7 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyDecisionPolicy() { "invalid percentage decision policy with negative value", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1309,7 +1309,7 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyDecisionPolicy() { "invalid percentage decision policy with value greater than 1", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1368,7 +1368,7 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyMetadata() { "correct data", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1387,7 +1387,7 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyMetadata() { "with amino-json", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1407,7 +1407,7 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyMetadata() { "long metadata", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1426,7 +1426,7 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyMetadata() { "wrong admin", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1445,7 +1445,7 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyMetadata() { "wrong group policy", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1510,7 +1510,7 @@ func (s *CLITestSuite) TestTxSubmitProposal() { "correct data", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1527,7 +1527,7 @@ func (s *CLITestSuite) TestTxSubmitProposal() { "with try exec", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1545,7 +1545,7 @@ func (s *CLITestSuite) TestTxSubmitProposal() { "with try exec, not enough yes votes for proposal to pass", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1563,7 +1563,7 @@ func (s *CLITestSuite) TestTxSubmitProposal() { "with amino-json", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1621,7 +1621,7 @@ func (s *CLITestSuite) TestTxVote() { "correct data", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1641,7 +1641,7 @@ func (s *CLITestSuite) TestTxVote() { "with try exec", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1662,7 +1662,7 @@ func (s *CLITestSuite) TestTxVote() { "with amino-json", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1683,7 +1683,7 @@ func (s *CLITestSuite) TestTxVote() { "metadata too long", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1742,7 +1742,7 @@ func (s *CLITestSuite) TestTxWithdrawProposal() { "correct data", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) @@ -1760,7 +1760,7 @@ func (s *CLITestSuite) TestTxWithdrawProposal() { "wrong admin", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) diff --git a/x/group/keeper/invariants_test.go b/x/group/keeper/invariants_test.go index 7b190286b8f5..45982ce7527b 100644 --- a/x/group/keeper/invariants_test.go +++ b/x/group/keeper/invariants_test.go @@ -4,9 +4,9 @@ import ( "testing" "github.com/cometbft/cometbft/libs/log" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/suite" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "cosmossdk.io/store" @@ -43,7 +43,7 @@ func (s *invariantTestSuite) SetupSuite() { cms := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) cms.MountStoreWithDB(key, storetypes.StoreTypeIAVL, db) _ = cms.LoadLatestVersion() - sdkCtx := sdk.NewContext(cms, tmproto.Header{}, false, log.NewNopLogger()) + sdkCtx := sdk.NewContext(cms, cmtproto.Header{}, false, log.NewNopLogger()) s.ctx = sdkCtx s.cdc = cdc diff --git a/x/group/keeper/keeper_test.go b/x/group/keeper/keeper_test.go index 014467131e43..66b023dfae80 100644 --- a/x/group/keeper/keeper_test.go +++ b/x/group/keeper/keeper_test.go @@ -11,7 +11,7 @@ import ( "time" "github.com/cometbft/cometbft/libs/log" - tmtime "github.com/cometbft/cometbft/types/time" + cmttime "github.com/cometbft/cometbft/types/time" "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" @@ -52,7 +52,7 @@ type TestSuite struct { } func (s *TestSuite) SetupTest() { - s.blockTime = tmtime.Now() + s.blockTime = cmttime.Now() key := storetypes.NewKVStoreKey(group.StoreKey) testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) diff --git a/x/group/module/abci_test.go b/x/group/module/abci_test.go index 4a8427b957e9..f4d006f375c4 100644 --- a/x/group/module/abci_test.go +++ b/x/group/module/abci_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtime "github.com/cometbft/cometbft/types/time" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttime "github.com/cometbft/cometbft/types/time" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -48,9 +48,9 @@ func (s *IntegrationTestSuite) SetupTest() { ) s.Require().NoError(err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) - ctx = ctx.WithBlockHeader(tmproto.Header{Time: tmtime.Now()}) + ctx = ctx.WithBlockHeader(cmtproto.Header{Time: cmttime.Now()}) s.ctx = ctx s.addrs = simtestutil.AddTestAddrsIncremental(s.bankKeeper, s.stakingKeeper, ctx, 4, sdk.NewInt(30000000)) diff --git a/x/group/simulation/operations_test.go b/x/group/simulation/operations_test.go index 01c0a3c3722e..b3f4ccc539c2 100644 --- a/x/group/simulation/operations_test.go +++ b/x/group/simulation/operations_test.go @@ -6,7 +6,7 @@ import ( "time" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/codec" @@ -50,7 +50,7 @@ func (suite *SimTestSuite) SetupTest() { suite.Require().NoError(err) suite.app = app - suite.ctx = app.BaseApp.NewContext(false, tmproto.Header{}) + suite.ctx = app.BaseApp.NewContext(false, cmtproto.Header{}) } func (suite *SimTestSuite) TestWeightedOperations() { @@ -124,7 +124,7 @@ func (suite *SimTestSuite) TestSimulateCreateGroup() { // begin a new block suite.app.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{ + Header: cmtproto.Header{ Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash, }, @@ -153,7 +153,7 @@ func (suite *SimTestSuite) TestSimulateCreateGroupWithPolicy() { // begin a new block suite.app.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{ + Header: cmtproto.Header{ Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash, }, @@ -197,7 +197,7 @@ func (suite *SimTestSuite) TestSimulateCreateGroupPolicy() { // begin a new block suite.app.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{ + Header: cmtproto.Header{ Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash, }, @@ -250,7 +250,7 @@ func (suite *SimTestSuite) TestSimulateSubmitProposal() { // begin a new block suite.app.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{ + Header: cmtproto.Header{ Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash, }, @@ -316,7 +316,7 @@ func (suite *SimTestSuite) TestWithdrawProposal() { // begin a new block suite.app.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{ + Header: cmtproto.Header{ Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash, }, @@ -383,7 +383,7 @@ func (suite *SimTestSuite) TestSimulateVote() { // begin a new block suite.app.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{ + Header: cmtproto.Header{ Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash, }, @@ -458,7 +458,7 @@ func (suite *SimTestSuite) TestSimulateExec() { // begin a new block suite.app.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{ + Header: cmtproto.Header{ Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash, }, @@ -500,7 +500,7 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupAdmin() { // begin a new block suite.app.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{ + Header: cmtproto.Header{ Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash, }, @@ -542,7 +542,7 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupMetadata() { // begin a new block suite.app.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{ + Header: cmtproto.Header{ Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash, }, @@ -584,7 +584,7 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupMembers() { // begin a new block suite.app.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{ + Header: cmtproto.Header{ Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash, }, @@ -637,7 +637,7 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupPolicyAdmin() { // begin a new block suite.app.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{ + Header: cmtproto.Header{ Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash, }, @@ -690,7 +690,7 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupPolicyDecisionPolicy() { // begin a new block suite.app.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{ + Header: cmtproto.Header{ Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash, }, @@ -743,7 +743,7 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupPolicyMetadata() { // begin a new block suite.app.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{ + Header: cmtproto.Header{ Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash, }, @@ -809,7 +809,7 @@ func (suite *SimTestSuite) TestSimulateLeaveGroup() { // begin a new block suite.app.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{ + Header: cmtproto.Header{ Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash, }, diff --git a/x/mint/client/cli/query_test.go b/x/mint/client/cli/query_test.go index abf592e43d7c..9bb4199fe293 100644 --- a/x/mint/client/cli/query_test.go +++ b/x/mint/client/cli/query_test.go @@ -28,7 +28,7 @@ func TestGetCmdQueryParams(t *testing.T) { WithKeyring(kr). WithTxConfig(encCfg.TxConfig). WithCodec(encCfg.Codec). - WithClient(clitestutil.MockTendermintRPC{Client: rpcclientmock.Client{}}). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). WithAccountRetriever(client.MockAccountRetriever{}). WithOutput(io.Discard). WithChainID("test-chain") @@ -93,7 +93,7 @@ func TestGetCmdQueryInflation(t *testing.T) { WithKeyring(kr). WithTxConfig(encCfg.TxConfig). WithCodec(encCfg.Codec). - WithClient(clitestutil.MockTendermintRPC{Client: rpcclientmock.Client{}}). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). WithAccountRetriever(client.MockAccountRetriever{}). WithOutput(io.Discard). WithChainID("test-chain") @@ -153,7 +153,7 @@ func TestGetCmdQueryAnnualProvisions(t *testing.T) { WithKeyring(kr). WithTxConfig(encCfg.TxConfig). WithCodec(encCfg.Codec). - WithClient(clitestutil.MockTendermintRPC{Client: rpcclientmock.Client{}}). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). WithAccountRetriever(client.MockAccountRetriever{}). WithOutput(io.Discard). WithChainID("test-chain") diff --git a/x/mint/module_test.go b/x/mint/module_test.go index 4de8ab6f61db..ed4f510bfc68 100644 --- a/x/mint/module_test.go +++ b/x/mint/module_test.go @@ -3,7 +3,7 @@ package mint_test import ( "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -19,7 +19,7 @@ func TestItCreatesModuleAccountOnInitBlock(t *testing.T) { app, err := simtestutil.SetupAtGenesis(testutil.AppConfig, &accountKeeper) require.NoError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) acc := accountKeeper.GetAccount(ctx, authtypes.NewModuleAddress(types.ModuleName)) require.NotNil(t, acc) } diff --git a/x/mint/simulation/proposals_test.go b/x/mint/simulation/proposals_test.go index 32051506fbd2..9b3aef1660c8 100644 --- a/x/mint/simulation/proposals_test.go +++ b/x/mint/simulation/proposals_test.go @@ -4,7 +4,7 @@ import ( "math/rand" "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" sdk "github.com/cosmos/cosmos-sdk/types" @@ -19,7 +19,7 @@ func TestProposalMsgs(t *testing.T) { s := rand.NewSource(1) r := rand.New(s) - ctx := sdk.NewContext(nil, tmproto.Header{}, true, nil) + ctx := sdk.NewContext(nil, cmtproto.Header{}, true, nil) accounts := simtypes.RandomAccounts(r, 3) // execute ProposalMsgs function diff --git a/x/nft/client/cli/tx_test.go b/x/nft/client/cli/tx_test.go index 50948c18d9f2..5d78c89d699f 100644 --- a/x/nft/client/cli/tx_test.go +++ b/x/nft/client/cli/tx_test.go @@ -88,7 +88,7 @@ func (s *CLITestSuite) SetupSuite() { WithKeyring(s.kr). WithTxConfig(s.encCfg.TxConfig). WithCodec(s.encCfg.Codec). - WithClient(clitestutil.MockTendermintRPC{Client: rpcclientmock.Client{}}). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). WithAccountRetriever(client.MockAccountRetriever{}). WithOutput(io.Discard). WithChainID("test-chain") @@ -97,7 +97,7 @@ func (s *CLITestSuite) SetupSuite() { var outBuf bytes.Buffer ctxGen := func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) diff --git a/x/nft/go.mod b/x/nft/go.mod index 500e2136a82a..ebec478cb070 100644 --- a/x/nft/go.mod +++ b/x/nft/go.mod @@ -8,7 +8,7 @@ require ( cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/errors v1.0.0-beta.7 cosmossdk.io/math v1.0.0-beta.6 - cosmossdk.io/store v0.0.0-20230204135315-697871069999 + cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 github.com/cometbft/cometbft v0.0.0-20230203130311-387422ac220d github.com/cosmos/cosmos-proto v1.0.0-beta.1 github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230109172818-c9acb1bd72b3 @@ -135,7 +135,7 @@ require ( golang.org/x/sys v0.4.0 // indirect golang.org/x/term v0.4.0 // indirect golang.org/x/text v0.6.0 // indirect - google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a // indirect + google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/x/nft/go.sum b/x/nft/go.sum index 87ca033b60c5..2972dc70a2cc 100644 --- a/x/nft/go.sum +++ b/x/nft/go.sum @@ -49,6 +49,8 @@ cosmossdk.io/math v1.0.0-beta.6 h1:WF29SiFYNde5eYvqO2kdOM9nYbDb44j3YW5B8M1m9KE= cosmossdk.io/math v1.0.0-beta.6/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= cosmossdk.io/store v0.0.0-20230204135315-697871069999 h1:NrV990BIbdDngOoTrD3Hg5kqqgvy6c+ETaKGY5bSUmo= cosmossdk.io/store v0.0.0-20230204135315-697871069999/go.mod h1:Sf3G8SV8e8H31CD6w+o2syqCwyaoL0fe244JcPSsaD4= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7/go.mod h1:1XOtuYs7jsfQkn7G3VQXB6I+2tHXKHZw2U/AafNbnlk= cosmossdk.io/x/tx v0.1.0 h1:uyyYVjG22B+jf54N803Z99Y1uPvfuNP3K1YShoCHYL8= cosmossdk.io/x/tx v0.1.0/go.mod h1:qsDv7e1fSftkF16kpSAk+7ROOojyj+SC0Mz3ukI52EQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -1266,6 +1268,8 @@ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a h1:KJVqJe240LvVd+8lfzRx3hQ0UZ0fyeXEMDMHviRNQKs= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af h1:rAgzfIj9FJtmJ6ZPDlxXX6Fzzix6NOpPTvVmPY5rwQg= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/nft/keeper/keeper_test.go b/x/nft/keeper/keeper_test.go index 8605b405cafb..36abc07a6c09 100644 --- a/x/nft/keeper/keeper_test.go +++ b/x/nft/keeper/keeper_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtime "github.com/cometbft/cometbft/types/time" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttime "github.com/cometbft/cometbft/types/time" "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" @@ -51,7 +51,7 @@ func (s *TestSuite) SetupTest() { key := storetypes.NewKVStoreKey(nft.StoreKey) testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Time: tmtime.Now()}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: cmttime.Now()}) // gomock initializations ctrl := gomock.NewController(s.T()) diff --git a/x/nft/simulation/operations_test.go b/x/nft/simulation/operations_test.go index 7feea4a7faa5..f32daf2dec87 100644 --- a/x/nft/simulation/operations_test.go +++ b/x/nft/simulation/operations_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/suite" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "cosmossdk.io/x/nft" nftkeeper "cosmossdk.io/x/nft/keeper" @@ -53,7 +53,7 @@ func (suite *SimTestSuite) SetupTest() { suite.Require().NoError(err) suite.app = app - suite.ctx = app.BaseApp.NewContext(false, tmproto.Header{}) + suite.ctx = app.BaseApp.NewContext(false, cmtproto.Header{}) } func (suite *SimTestSuite) TestWeightedOperations() { @@ -117,7 +117,7 @@ func (suite *SimTestSuite) TestSimulateMsgSend() { // begin new block suite.app.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{ + Header: cmtproto.Header{ Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash, }, diff --git a/x/params/simulation/operations_test.go b/x/params/simulation/operations_test.go index 1dd88e08f887..a23e42bf7011 100644 --- a/x/params/simulation/operations_test.go +++ b/x/params/simulation/operations_test.go @@ -5,7 +5,7 @@ import ( "math/rand" "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -43,7 +43,7 @@ func TestSimulateParamChangeProposalContent(t *testing.T) { s := rand.NewSource(1) r := rand.New(s) - ctx := sdk.NewContext(nil, tmproto.Header{}, true, nil) + ctx := sdk.NewContext(nil, cmtproto.Header{}, true, nil) accounts := simtypes.RandomAccounts(r, 3) paramChangePool := []simtypes.LegacyParamChange{MockParamChange{1}, MockParamChange{2}, MockParamChange{3}} diff --git a/x/params/simulation/proposals_test.go b/x/params/simulation/proposals_test.go index 18c795107fc8..aa80a6f0073d 100644 --- a/x/params/simulation/proposals_test.go +++ b/x/params/simulation/proposals_test.go @@ -4,7 +4,7 @@ import ( "math/rand" "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -18,7 +18,7 @@ func TestProposalContents(t *testing.T) { s := rand.NewSource(1) r := rand.New(s) - ctx := sdk.NewContext(nil, tmproto.Header{}, true, nil) + ctx := sdk.NewContext(nil, cmtproto.Header{}, true, nil) accounts := simtypes.RandomAccounts(r, 3) paramChangePool := []simtypes.LegacyParamChange{MockParamChange{1}, MockParamChange{2}, MockParamChange{3}} diff --git a/x/params/types/consensus_params_legacy.go b/x/params/types/consensus_params_legacy.go index 2134b0180948..2ea43d366f47 100644 --- a/x/params/types/consensus_params_legacy.go +++ b/x/params/types/consensus_params_legacy.go @@ -1,7 +1,7 @@ package types import ( - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/baseapp" ) @@ -10,13 +10,13 @@ import ( func ConsensusParamsKeyTable() KeyTable { return NewKeyTable( NewParamSetPair( - baseapp.ParamStoreKeyBlockParams, tmproto.BlockParams{}, baseapp.ValidateBlockParams, + baseapp.ParamStoreKeyBlockParams, cmtproto.BlockParams{}, baseapp.ValidateBlockParams, ), NewParamSetPair( - baseapp.ParamStoreKeyEvidenceParams, tmproto.EvidenceParams{}, baseapp.ValidateEvidenceParams, + baseapp.ParamStoreKeyEvidenceParams, cmtproto.EvidenceParams{}, baseapp.ValidateEvidenceParams, ), NewParamSetPair( - baseapp.ParamStoreKeyValidatorParams, tmproto.ValidatorParams{}, baseapp.ValidateValidatorParams, + baseapp.ParamStoreKeyValidatorParams, cmtproto.ValidatorParams{}, baseapp.ValidateValidatorParams, ), ) } diff --git a/x/params/types/subspace_test.go b/x/params/types/subspace_test.go index d7cf83d35088..24a9d3ebf8cf 100644 --- a/x/params/types/subspace_test.go +++ b/x/params/types/subspace_test.go @@ -7,7 +7,7 @@ import ( "time" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/suite" @@ -46,7 +46,7 @@ func (suite *SubspaceTestSuite) SetupTest() { suite.NoError(err) ss := types.NewSubspace(suite.cdc, suite.amino, key, tkey, "testsubspace") - suite.ctx = sdk.NewContext(ms, tmproto.Header{}, false, log.NewNopLogger()) + suite.ctx = sdk.NewContext(ms, cmtproto.Header{}, false, log.NewNopLogger()) suite.ss = ss.WithKeyTable(paramKeyTable()) } diff --git a/x/simulation/mock_tendermint.go b/x/simulation/mock_cometbft.go similarity index 92% rename from x/simulation/mock_tendermint.go rename to x/simulation/mock_cometbft.go index a7526e60d0c8..b16d563df1ef 100644 --- a/x/simulation/mock_tendermint.go +++ b/x/simulation/mock_cometbft.go @@ -9,8 +9,8 @@ import ( abci "github.com/cometbft/cometbft/abci/types" cryptoenc "github.com/cometbft/cometbft/crypto/encoding" - tmbytes "github.com/cometbft/cometbft/libs/bytes" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtbytes "github.com/cometbft/cometbft/libs/bytes" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" ) type mockValidator struct { @@ -60,7 +60,7 @@ func (vals mockValidators) getKeys() []string { } // randomProposer picks a random proposer from the current validator set -func (vals mockValidators) randomProposer(r *rand.Rand) tmbytes.HexBytes { +func (vals mockValidators) randomProposer(r *rand.Rand) cmtbytes.HexBytes { keys := vals.getKeys() if len(keys) == 0 { return nil @@ -77,7 +77,7 @@ func (vals mockValidators) randomProposer(r *rand.Rand) tmbytes.HexBytes { return pk.Address() } -// updateValidators mimics Tendermint's update logic. +// updateValidators mimics CometBFT's update logic. func updateValidators( tb testing.TB, r *rand.Rand, @@ -117,7 +117,7 @@ func updateValidators( func RandomRequestBeginBlock(r *rand.Rand, params Params, validators mockValidators, pastTimes []time.Time, pastVoteInfos [][]abci.VoteInfo, - event func(route, op, evResult string), header tmproto.Header, + event func(route, op, evResult string), header cmtproto.Header, ) abci.RequestBeginBlock { if len(validators) == 0 { return abci.RequestBeginBlock{ @@ -181,7 +181,7 @@ func RandomRequestBeginBlock(r *rand.Rand, params Params, vals := voteInfos if r.Float64() < params.PastEvidenceFraction() && header.Height > 1 { - height = int64(r.Intn(int(header.Height)-1)) + 1 // Tendermint starts at height 1 + height = int64(r.Intn(int(header.Height)-1)) + 1 // CometBFT starts at height 1 // array indices offset by one time = pastTimes[height-1] vals = pastVoteInfos[height-1] diff --git a/x/simulation/params.go b/x/simulation/params.go index d98373eb92b8..4ac7fac95099 100644 --- a/x/simulation/params.go +++ b/x/simulation/params.go @@ -5,7 +5,7 @@ import ( "fmt" "math/rand" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/codec" @@ -176,7 +176,7 @@ func (w WeightedProposalContent) ContentSimulatorFn() simulation.ContentSimulato // Consensus Params // randomConsensusParams returns random simulation consensus parameters, it extracts the Evidence from the Staking genesis state. -func randomConsensusParams(r *rand.Rand, appState json.RawMessage, cdc codec.JSONCodec) *tmproto.ConsensusParams { +func randomConsensusParams(r *rand.Rand, appState json.RawMessage, cdc codec.JSONCodec) *cmtproto.ConsensusParams { var genesisState map[string]json.RawMessage err := json.Unmarshal(appState, &genesisState) if err != nil { @@ -184,15 +184,15 @@ func randomConsensusParams(r *rand.Rand, appState json.RawMessage, cdc codec.JSO } stakingGenesisState := stakingtypes.GetGenesisStateFromAppState(cdc, genesisState) - consensusParams := &tmproto.ConsensusParams{ - Block: &tmproto.BlockParams{ + consensusParams := &cmtproto.ConsensusParams{ + Block: &cmtproto.BlockParams{ MaxBytes: int64(simulation.RandIntBetween(r, 20000000, 30000000)), MaxGas: -1, }, - Validator: &tmproto.ValidatorParams{ + Validator: &cmtproto.ValidatorParams{ PubKeyTypes: []string{types.ABCIPubKeyTypeEd25519}, }, - Evidence: &tmproto.EvidenceParams{ + Evidence: &cmtproto.EvidenceParams{ MaxAgeNumBlocks: int64(stakingGenesisState.Params.UnbondingTime / AverageBlockTime), MaxAgeDuration: stakingGenesisState.Params.UnbondingTime, }, diff --git a/x/simulation/params_test.go b/x/simulation/params_test.go index d88172e18b1c..496454142c45 100644 --- a/x/simulation/params_test.go +++ b/x/simulation/params_test.go @@ -5,7 +5,7 @@ import ( "math/rand" "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -39,7 +39,7 @@ func TestNewWeightedProposalContent(t *testing.T) { require.Equal(t, key, pContent.AppParamsKey()) require.Equal(t, weight, pContent.DefaultWeight()) - ctx := sdk.NewContext(nil, tmproto.Header{}, true, nil) + ctx := sdk.NewContext(nil, cmtproto.Header{}, true, nil) require.Equal(t, content, pContent.ContentSimulatorFn()(nil, ctx, nil)) } diff --git a/x/simulation/simulate.go b/x/simulation/simulate.go index aca40c94f4b8..c455f499fec5 100644 --- a/x/simulation/simulate.go +++ b/x/simulation/simulate.go @@ -11,7 +11,7 @@ import ( "time" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" @@ -97,7 +97,7 @@ func SimulateFromSeed( accs = tmpAccs nextValidators := validators - header := tmproto.Header{ + header := cmtproto.Header{ ChainID: config.ChainID, Height: 1, Time: genesisTimestamp, @@ -248,7 +248,7 @@ func SimulateFromSeed( } type blockSimFn func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, - accounts []simulation.Account, header tmproto.Header) (opCount int) + accounts []simulation.Account, header cmtproto.Header) (opCount int) // Returns a function to simulate blocks. Written like this to avoid constant // parameters being passed everytime, to minimize memory overhead. @@ -262,7 +262,7 @@ func createBlockSimulator(testingMode bool, tb testing.TB, w io.Writer, params P selectOp := ops.getSelectOpFn() return func( - r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accounts []simulation.Account, header tmproto.Header, + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accounts []simulation.Account, header cmtproto.Header, ) (opCount int) { _, _ = fmt.Fprintf( w, "\rSimulating... block %d/%d, operation %d/%d.", diff --git a/x/slashing/abci_test.go b/x/slashing/abci_test.go index f0758ea9b711..f5a4c45014bc 100644 --- a/x/slashing/abci_test.go +++ b/x/slashing/abci_test.go @@ -5,7 +5,7 @@ import ( "time" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -36,7 +36,7 @@ func TestBeginBlocker(t *testing.T) { ) require.NoError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) pks := simtestutil.CreateTestPubKeys(1) simtestutil.AddTestAddrsFromPubKeys(bankKeeper, stakingKeeper, ctx, pks, stakingKeeper.TokensFromConsensusPower(ctx, 200)) diff --git a/x/slashing/app_test.go b/x/slashing/app_test.go index cafa62273c55..d95c8c5692ac 100644 --- a/x/slashing/app_test.go +++ b/x/slashing/app_test.go @@ -5,7 +5,7 @@ import ( "testing" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" "cosmossdk.io/math" @@ -63,7 +63,7 @@ func TestSlashingMsgs(t *testing.T) { baseApp := app.BaseApp - ctxCheck := baseApp.NewContext(true, tmproto.Header{}) + ctxCheck := baseApp.NewContext(true, cmtproto.Header{}) require.True(t, sdk.Coins{genCoin}.Equal(bankKeeper.GetAllBalances(ctxCheck, addr1))) require.NoError(t, err) @@ -76,16 +76,16 @@ func TestSlashingMsgs(t *testing.T) { ) require.NoError(t, err) - header := tmproto.Header{Height: app.LastBlockHeight() + 1} + header := cmtproto.Header{Height: app.LastBlockHeight() + 1} txConfig := moduletestutil.MakeTestEncodingConfig().TxConfig _, _, err = sims.SignCheckDeliver(t, txConfig, app.BaseApp, header, []sdk.Msg{createValidatorMsg}, "", []uint64{0}, []uint64{0}, true, true, priv1) require.NoError(t, err) require.True(t, sdk.Coins{genCoin.Sub(bondCoin)}.Equal(bankKeeper.GetAllBalances(ctxCheck, addr1))) - header = tmproto.Header{Height: app.LastBlockHeight() + 1} + header = cmtproto.Header{Height: app.LastBlockHeight() + 1} app.BeginBlock(abci.RequestBeginBlock{Header: header}) - ctxCheck = baseApp.NewContext(true, tmproto.Header{}) + ctxCheck = baseApp.NewContext(true, cmtproto.Header{}) validator, found := stakingKeeper.GetValidator(ctxCheck, sdk.ValAddress(addr1)) require.True(t, found) require.Equal(t, sdk.ValAddress(addr1).String(), validator.OperatorAddress) @@ -93,12 +93,12 @@ func TestSlashingMsgs(t *testing.T) { require.True(math.IntEq(t, bondTokens, validator.BondedTokens())) unjailMsg := &types.MsgUnjail{ValidatorAddr: sdk.ValAddress(addr1).String()} - ctxCheck = app.BaseApp.NewContext(true, tmproto.Header{}) + ctxCheck = app.BaseApp.NewContext(true, cmtproto.Header{}) _, found = slashingKeeper.GetValidatorSigningInfo(ctxCheck, sdk.ConsAddress(valAddr)) require.True(t, found) // unjail should fail with unknown validator - header = tmproto.Header{Height: app.LastBlockHeight() + 1} + header = cmtproto.Header{Height: app.LastBlockHeight() + 1} _, res, err := sims.SignCheckDeliver(t, txConfig, app.BaseApp, header, []sdk.Msg{unjailMsg}, "", []uint64{0}, []uint64{1}, false, false, priv1) require.Error(t, err) require.Nil(t, res) diff --git a/x/slashing/client/cli/query_test.go b/x/slashing/client/cli/query_test.go index 2bffd6bbeb59..a86a30a1e7e7 100644 --- a/x/slashing/client/cli/query_test.go +++ b/x/slashing/client/cli/query_test.go @@ -47,7 +47,7 @@ func (s *CLITestSuite) SetupSuite() { WithKeyring(s.kr). WithTxConfig(s.encCfg.TxConfig). WithCodec(s.encCfg.Codec). - WithClient(clitestutil.MockTendermintRPC{Client: rpcclientmock.Client{}}). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). WithAccountRetriever(client.MockAccountRetriever{}). WithOutput(io.Discard). WithChainID("test-chain") @@ -55,7 +55,7 @@ func (s *CLITestSuite) SetupSuite() { var outBuf bytes.Buffer ctxGen := func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) diff --git a/x/slashing/keeper/keeper_test.go b/x/slashing/keeper/keeper_test.go index 36d0262d8381..e27cd8173e03 100644 --- a/x/slashing/keeper/keeper_test.go +++ b/x/slashing/keeper/keeper_test.go @@ -6,8 +6,8 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtime "github.com/cometbft/cometbft/types/time" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttime "github.com/cometbft/cometbft/types/time" storetypes "cosmossdk.io/store/types" @@ -39,7 +39,7 @@ type KeeperTestSuite struct { func (s *KeeperTestSuite) SetupTest() { key := storetypes.NewKVStoreKey(slashingtypes.StoreKey) testCtx := sdktestutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Time: tmtime.Now()}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: cmttime.Now()}) encCfg := moduletestutil.MakeTestEncodingConfig() // gomock initializations diff --git a/x/slashing/simulation/operations_test.go b/x/slashing/simulation/operations_test.go index d3595dd7fcae..8de60874c61f 100644 --- a/x/slashing/simulation/operations_test.go +++ b/x/slashing/simulation/operations_test.go @@ -7,8 +7,8 @@ import ( "time" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/stretchr/testify/suite" "cosmossdk.io/math" @@ -60,16 +60,16 @@ func (suite *SimTestSuite) SetupTest() { accounts := simtypes.RandomAccounts(suite.r, 4) // create validator (non random as using a seed) - createValidator := func() (*tmtypes.ValidatorSet, error) { + createValidator := func() (*cmttypes.ValidatorSet, error) { account := accounts[0] tmPk, err := cryptocodec.ToTmPubKeyInterface(account.PubKey) if err != nil { return nil, fmt.Errorf("failed to create pubkey: %w", err) } - validator := tmtypes.NewValidator(tmPk, 1) + validator := cmttypes.NewValidator(tmPk, 1) - return tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}), nil + return cmttypes.NewValidatorSet([]*cmttypes.Validator{validator}), nil } startupCfg := simtestutil.DefaultStartUpConfig() @@ -91,7 +91,7 @@ func (suite *SimTestSuite) SetupTest() { suite.Require().NoError(err) suite.app = app - suite.ctx = app.BaseApp.NewContext(false, tmproto.Header{}) + suite.ctx = app.BaseApp.NewContext(false, cmtproto.Header{}) // remove genesis validator account suite.accounts = accounts[1:] @@ -172,7 +172,7 @@ func (suite *SimTestSuite) TestSimulateMsgUnjail() { suite.distrKeeper.SetDelegatorStartingInfo(ctx, validator0.GetOperator(), val0AccAddress.Bytes(), distrtypes.NewDelegatorStartingInfo(2, math.LegacyOneDec(), 200)) // begin a new block - suite.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash, Time: blockTime}}) + suite.app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash, Time: blockTime}}) // execute operation op := simulation.SimulateMsgUnjail(codec.NewProtoCodec(suite.interfaceRegistry), suite.accountKeeper, suite.bankKeeper, suite.slashingKeeper, suite.stakingKeeper) diff --git a/x/slashing/simulation/proposals_test.go b/x/slashing/simulation/proposals_test.go index 88ed4b20ac4f..97ac001140c9 100644 --- a/x/slashing/simulation/proposals_test.go +++ b/x/slashing/simulation/proposals_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" sdk "github.com/cosmos/cosmos-sdk/types" @@ -20,7 +20,7 @@ func TestProposalMsgs(t *testing.T) { s := rand.NewSource(1) r := rand.New(s) - ctx := sdk.NewContext(nil, tmproto.Header{}, true, nil) + ctx := sdk.NewContext(nil, cmtproto.Header{}, true, nil) accounts := simtypes.RandomAccounts(r, 3) // execute ProposalMsgs function diff --git a/x/staking/app_test.go b/x/staking/app_test.go index def0b0908c1b..b0f3d0cb1dbf 100644 --- a/x/staking/app_test.go +++ b/x/staking/app_test.go @@ -10,7 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -55,7 +55,7 @@ func TestStakingMsgs(t *testing.T) { app, err := simtestutil.SetupWithConfiguration(testutil.AppConfig, startupCfg, &bankKeeper, &stakingKeeper) require.NoError(t, err) - ctxCheck := app.BaseApp.NewContext(true, tmproto.Header{}) + ctxCheck := app.BaseApp.NewContext(true, cmtproto.Header{}) require.True(t, sdk.Coins{genCoin}.Equal(bankKeeper.GetAllBalances(ctxCheck, addr1))) require.True(t, sdk.Coins{genCoin}.Equal(bankKeeper.GetAllBalances(ctxCheck, addr2))) @@ -67,33 +67,33 @@ func TestStakingMsgs(t *testing.T) { ) require.NoError(t, err) - header := tmproto.Header{Height: app.LastBlockHeight() + 1} + header := cmtproto.Header{Height: app.LastBlockHeight() + 1} txConfig := moduletestutil.MakeTestEncodingConfig().TxConfig _, _, err = simtestutil.SignCheckDeliver(t, txConfig, app.BaseApp, header, []sdk.Msg{createValidatorMsg}, "", []uint64{0}, []uint64{0}, true, true, priv1) require.NoError(t, err) require.True(t, sdk.Coins{genCoin.Sub(bondCoin)}.Equal(bankKeeper.GetAllBalances(ctxCheck, addr1))) - header = tmproto.Header{Height: app.LastBlockHeight() + 1} + header = cmtproto.Header{Height: app.LastBlockHeight() + 1} app.BeginBlock(abci.RequestBeginBlock{Header: header}) - ctxCheck = app.BaseApp.NewContext(true, tmproto.Header{}) + ctxCheck = app.BaseApp.NewContext(true, cmtproto.Header{}) validator, found := stakingKeeper.GetValidator(ctxCheck, sdk.ValAddress(addr1)) require.True(t, found) require.Equal(t, sdk.ValAddress(addr1).String(), validator.OperatorAddress) require.Equal(t, types.Bonded, validator.Status) require.True(math.IntEq(t, bondTokens, validator.BondedTokens())) - header = tmproto.Header{Height: app.LastBlockHeight() + 1} + header = cmtproto.Header{Height: app.LastBlockHeight() + 1} app.BeginBlock(abci.RequestBeginBlock{Header: header}) // edit the validator description = types.NewDescription("bar_moniker", "", "", "", "") editValidatorMsg := types.NewMsgEditValidator(sdk.ValAddress(addr1), description, nil, nil) - header = tmproto.Header{Height: app.LastBlockHeight() + 1} + header = cmtproto.Header{Height: app.LastBlockHeight() + 1} _, _, err = simtestutil.SignCheckDeliver(t, txConfig, app.BaseApp, header, []sdk.Msg{editValidatorMsg}, "", []uint64{0}, []uint64{1}, true, true, priv1) require.NoError(t, err) - ctxCheck = app.BaseApp.NewContext(true, tmproto.Header{}) + ctxCheck = app.BaseApp.NewContext(true, cmtproto.Header{}) validator, found = stakingKeeper.GetValidator(ctxCheck, sdk.ValAddress(addr1)) require.True(t, found) require.Equal(t, description, validator.Description) @@ -102,23 +102,23 @@ func TestStakingMsgs(t *testing.T) { require.True(t, sdk.Coins{genCoin}.Equal(bankKeeper.GetAllBalances(ctxCheck, addr2))) delegateMsg := types.NewMsgDelegate(addr2, sdk.ValAddress(addr1), bondCoin) - header = tmproto.Header{Height: app.LastBlockHeight() + 1} + header = cmtproto.Header{Height: app.LastBlockHeight() + 1} _, _, err = simtestutil.SignCheckDeliver(t, txConfig, app.BaseApp, header, []sdk.Msg{delegateMsg}, "", []uint64{1}, []uint64{0}, true, true, priv2) require.NoError(t, err) - ctxCheck = app.BaseApp.NewContext(true, tmproto.Header{}) + ctxCheck = app.BaseApp.NewContext(true, cmtproto.Header{}) require.True(t, sdk.Coins{genCoin.Sub(bondCoin)}.Equal(bankKeeper.GetAllBalances(ctxCheck, addr2))) _, found = stakingKeeper.GetDelegation(ctxCheck, addr2, sdk.ValAddress(addr1)) require.True(t, found) // begin unbonding beginUnbondingMsg := types.NewMsgUndelegate(addr2, sdk.ValAddress(addr1), bondCoin) - header = tmproto.Header{Height: app.LastBlockHeight() + 1} + header = cmtproto.Header{Height: app.LastBlockHeight() + 1} _, _, err = simtestutil.SignCheckDeliver(t, txConfig, app.BaseApp, header, []sdk.Msg{beginUnbondingMsg}, "", []uint64{1}, []uint64{1}, true, true, priv2) require.NoError(t, err) // delegation should exist anymore - ctxCheck = app.BaseApp.NewContext(true, tmproto.Header{}) + ctxCheck = app.BaseApp.NewContext(true, cmtproto.Header{}) _, found = stakingKeeper.GetDelegation(ctxCheck, addr2, sdk.ValAddress(addr1)) require.False(t, found) diff --git a/x/staking/client/cli/tx_test.go b/x/staking/client/cli/tx_test.go index 3a47554496d8..d07b6c07fd6c 100644 --- a/x/staking/client/cli/tx_test.go +++ b/x/staking/client/cli/tx_test.go @@ -45,7 +45,7 @@ func (s *CLITestSuite) SetupSuite() { WithKeyring(s.kr). WithTxConfig(s.encCfg.TxConfig). WithCodec(s.encCfg.Codec). - WithClient(clitestutil.MockTendermintRPC{Client: rpcclientmock.Client{}}). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). WithAccountRetriever(client.MockAccountRetriever{}). WithOutput(io.Discard). WithChainID("test-chain") @@ -53,7 +53,7 @@ func (s *CLITestSuite) SetupSuite() { var outBuf bytes.Buffer ctxGen := func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, }) return s.baseCtx.WithClient(c) diff --git a/x/staking/genesis.go b/x/staking/genesis.go index f3ed6b165795..9cebe9e076ca 100644 --- a/x/staking/genesis.go +++ b/x/staking/genesis.go @@ -3,7 +3,7 @@ package staking import ( "fmt" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" @@ -12,7 +12,7 @@ import ( ) // WriteValidators returns a slice of bonded genesis validators. -func WriteValidators(ctx sdk.Context, keeper *keeper.Keeper) (vals []tmtypes.GenesisValidator, returnErr error) { +func WriteValidators(ctx sdk.Context, keeper *keeper.Keeper) (vals []cmttypes.GenesisValidator, returnErr error) { keeper.IterateLastValidators(ctx, func(_ int64, validator types.ValidatorI) (stop bool) { pk, err := validator.ConsPubKey() if err != nil { @@ -25,7 +25,7 @@ func WriteValidators(ctx sdk.Context, keeper *keeper.Keeper) (vals []tmtypes.Gen return true } - vals = append(vals, tmtypes.GenesisValidator{ + vals = append(vals, cmttypes.GenesisValidator{ Address: sdk.ConsAddress(tmPk.Address()).Bytes(), PubKey: tmPk, Power: validator.GetConsensusPower(keeper.PowerReduction(ctx)), diff --git a/x/staking/keeper/historical_info_test.go b/x/staking/keeper/historical_info_test.go index 214a1808e406..9709c5440b52 100644 --- a/x/staking/keeper/historical_info_test.go +++ b/x/staking/keeper/historical_info_test.go @@ -1,7 +1,7 @@ package keeper_test import ( - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "cosmossdk.io/math" @@ -60,11 +60,11 @@ func (s *KeeperTestSuite) TestTrackHistoricalInfo() { // set historical info at 5, 4 which should be pruned // and check that it has been stored - h4 := tmproto.Header{ + h4 := cmtproto.Header{ ChainID: "HelloChain", Height: 4, } - h5 := tmproto.Header{ + h5 := cmtproto.Header{ ChainID: "HelloChain", Height: 5, } @@ -99,7 +99,7 @@ func (s *KeeperTestSuite) TestTrackHistoricalInfo() { require.True(IsValSetSorted(vals, keeper.PowerReduction(ctx))) // Set Header for BeginBlock context - header := tmproto.Header{ + header := cmtproto.Header{ ChainID: "HelloChain", Height: 10, } @@ -136,9 +136,9 @@ func (s *KeeperTestSuite) TestGetAllHistoricalInfo() { testutil.NewValidator(s.T(), addrVals[1], PKs[1]), } - header1 := tmproto.Header{ChainID: "HelloChain", Height: 10} - header2 := tmproto.Header{ChainID: "HelloChain", Height: 11} - header3 := tmproto.Header{ChainID: "HelloChain", Height: 12} + header1 := cmtproto.Header{ChainID: "HelloChain", Height: 10} + header2 := cmtproto.Header{ChainID: "HelloChain", Height: 11} + header3 := cmtproto.Header{ChainID: "HelloChain", Height: 12} hist1 := stakingtypes.HistoricalInfo{Header: header1, Valset: valSet} hist2 := stakingtypes.HistoricalInfo{Header: header2, Valset: valSet} diff --git a/x/staking/keeper/keeper_test.go b/x/staking/keeper/keeper_test.go index e7f3660360f7..fb74f5525d78 100644 --- a/x/staking/keeper/keeper_test.go +++ b/x/staking/keeper/keeper_test.go @@ -4,8 +4,8 @@ import ( "testing" "cosmossdk.io/math" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtime "github.com/cometbft/cometbft/types/time" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttime "github.com/cometbft/cometbft/types/time" "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" @@ -43,7 +43,7 @@ type KeeperTestSuite struct { func (s *KeeperTestSuite) SetupTest() { key := storetypes.NewKVStoreKey(stakingtypes.StoreKey) testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Time: tmtime.Now()}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: cmttime.Now()}) encCfg := moduletestutil.MakeTestEncodingConfig() ctrl := gomock.NewController(s.T()) diff --git a/x/staking/keeper/val_state_change.go b/x/staking/keeper/val_state_change.go index 7c0394775aa4..e37db543d0ea 100644 --- a/x/staking/keeper/val_state_change.go +++ b/x/staking/keeper/val_state_change.go @@ -106,7 +106,7 @@ func (k Keeper) BlockValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate { // // CONTRACT: Only validators with non-zero power or zero-power that were bonded // at the previous block height or were removed from the validator set entirely -// are returned to Tendermint. +// are returned to CometBFT. func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []abci.ValidatorUpdate, err error) { params := k.GetParams(ctx) maxValidators := params.MaxValidators diff --git a/x/staking/module_test.go b/x/staking/module_test.go index d2dcd54d956e..aaea7b0cd52c 100644 --- a/x/staking/module_test.go +++ b/x/staking/module_test.go @@ -3,7 +3,7 @@ package staking_test import ( "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -18,7 +18,7 @@ func TestItCreatesModuleAccountOnInitBlock(t *testing.T) { app, err := simtestutil.SetupAtGenesis(testutil.AppConfig, &accountKeeper) require.NoError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) acc := accountKeeper.GetAccount(ctx, authtypes.NewModuleAddress(types.BondedPoolName)) require.NotNil(t, acc) diff --git a/x/staking/simulation/operations_test.go b/x/staking/simulation/operations_test.go index 3df037776877..530cd74bb684 100644 --- a/x/staking/simulation/operations_test.go +++ b/x/staking/simulation/operations_test.go @@ -11,8 +11,8 @@ import ( "github.com/stretchr/testify/suite" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttypes "github.com/cometbft/cometbft/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" "github.com/cosmos/cosmos-sdk/runtime" @@ -70,12 +70,12 @@ func (s *SimTestSuite) SetupTest() { account := accounts[0] tmPk, err := cryptocodec.ToTmPubKeyInterface(account.PubKey) require.NoError(s.T(), err) - validator := tmtypes.NewValidator(tmPk, 1) + validator := cmttypes.NewValidator(tmPk, 1) startupCfg := simtestutil.DefaultStartUpConfig() startupCfg.GenesisAccounts = accs - startupCfg.ValidatorSet = func() (*tmtypes.ValidatorSet, error) { - return tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}), nil + startupCfg.ValidatorSet = func() (*cmttypes.ValidatorSet, error) { + return cmttypes.NewValidatorSet([]*cmttypes.Validator{validator}), nil } var ( @@ -89,7 +89,7 @@ func (s *SimTestSuite) SetupTest() { app, err := simtestutil.SetupWithConfiguration(testutil.AppConfig, startupCfg, &bankKeeper, &accountKeeper, &mintKeeper, &distrKeeper, &stakingKeeper) require.NoError(s.T(), err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false, cmtproto.Header{}) mintKeeper.SetParams(ctx, minttypes.DefaultParams()) mintKeeper.SetMinter(ctx, minttypes.DefaultInitialMinter()) @@ -157,7 +157,7 @@ func (s *SimTestSuite) TestWeightedOperations() { func (s *SimTestSuite) TestSimulateMsgCreateValidator() { require := s.Require() // begin a new block - s.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: s.app.LastBlockHeight() + 1, AppHash: s.app.LastCommitID().Hash}}) + s.app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: s.app.LastBlockHeight() + 1, AppHash: s.app.LastCommitID().Hash}}) // execute operation op := simulation.SimulateMsgCreateValidator(s.accountKeeper, s.bankKeeper, s.stakingKeeper) @@ -202,7 +202,7 @@ func (s *SimTestSuite) TestSimulateMsgCancelUnbondingDelegation() { s.setupValidatorRewards(ctx, validator0.GetOperator()) // begin a new block - s.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: s.app.LastBlockHeight() + 1, AppHash: s.app.LastCommitID().Hash, Time: blockTime}}) + s.app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: s.app.LastBlockHeight() + 1, AppHash: s.app.LastCommitID().Hash, Time: blockTime}}) // execute operation op := simulation.SimulateMsgCancelUnbondingDelegate(s.accountKeeper, s.bankKeeper, s.stakingKeeper) @@ -231,7 +231,7 @@ func (s *SimTestSuite) TestSimulateMsgEditValidator() { _ = s.getTestingValidator0(ctx) // begin a new block - s.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: s.app.LastBlockHeight() + 1, AppHash: s.app.LastCommitID().Hash, Time: blockTime}}) + s.app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: s.app.LastBlockHeight() + 1, AppHash: s.app.LastCommitID().Hash, Time: blockTime}}) // execute operation op := simulation.SimulateMsgEditValidator(s.accountKeeper, s.bankKeeper, s.stakingKeeper) @@ -291,7 +291,7 @@ func (s *SimTestSuite) TestSimulateMsgUndelegate() { s.setupValidatorRewards(ctx, validator0.GetOperator()) // begin a new block - s.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: s.app.LastBlockHeight() + 1, AppHash: s.app.LastCommitID().Hash, Time: blockTime}}) + s.app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: s.app.LastBlockHeight() + 1, AppHash: s.app.LastCommitID().Hash, Time: blockTime}}) // execute operation op := simulation.SimulateMsgUndelegate(s.accountKeeper, s.bankKeeper, s.stakingKeeper) @@ -334,7 +334,7 @@ func (s *SimTestSuite) TestSimulateMsgBeginRedelegate() { s.setupValidatorRewards(ctx, validator1.GetOperator()) // begin a new block - s.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: s.app.LastBlockHeight() + 1, AppHash: s.app.LastCommitID().Hash, Time: blockTime}}) + s.app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: s.app.LastBlockHeight() + 1, AppHash: s.app.LastCommitID().Hash, Time: blockTime}}) // execute operation op := simulation.SimulateMsgBeginRedelegate(s.accountKeeper, s.bankKeeper, s.stakingKeeper) diff --git a/x/staking/simulation/proposals_test.go b/x/staking/simulation/proposals_test.go index b3a6bd69658f..adbafa4ea33a 100644 --- a/x/staking/simulation/proposals_test.go +++ b/x/staking/simulation/proposals_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" sdk "github.com/cosmos/cosmos-sdk/types" @@ -20,7 +20,7 @@ func TestProposalMsgs(t *testing.T) { s := rand.NewSource(1) r := rand.New(s) - ctx := sdk.NewContext(nil, tmproto.Header{}, true, nil) + ctx := sdk.NewContext(nil, cmtproto.Header{}, true, nil) accounts := simtypes.RandomAccounts(r, 3) // execute ProposalMsgs function diff --git a/x/staking/testutil/cmt.go b/x/staking/testutil/cmt.go new file mode 100644 index 000000000000..419c2671b40a --- /dev/null +++ b/x/staking/testutil/cmt.go @@ -0,0 +1,44 @@ +package testutil + +import ( + "cosmossdk.io/math" + cmtcrypto "github.com/cometbft/cometbft/crypto" + cmttypes "github.com/cometbft/cometbft/types" + + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +// GetCmtConsPubKey gets the validator's public key as a cmtcrypto.PubKey. +func GetCmtConsPubKey(v types.Validator) (cmtcrypto.PubKey, error) { + pk, err := v.ConsPubKey() + if err != nil { + return nil, err + } + + return cryptocodec.ToTmPubKeyInterface(pk) +} + +// ToCmtValidator casts an SDK validator to a CometBFT type Validator. +func ToCmtValidator(v types.Validator, r math.Int) (*cmttypes.Validator, error) { + tmPk, err := GetCmtConsPubKey(v) + if err != nil { + return nil, err + } + + return cmttypes.NewValidator(tmPk, v.ConsensusPower(r)), nil +} + +// ToCmtValidators casts all validators to the corresponding CometBFT type. +func ToCmtValidators(v types.Validators, r math.Int) ([]*cmttypes.Validator, error) { + validators := make([]*cmttypes.Validator, len(v)) + var err error + for i, val := range v { + validators[i], err = ToCmtValidator(val, r) + if err != nil { + return nil, err + } + } + + return validators, nil +} diff --git a/x/staking/testutil/tm.go b/x/staking/testutil/tm.go deleted file mode 100644 index 698c7f95ef54..000000000000 --- a/x/staking/testutil/tm.go +++ /dev/null @@ -1,44 +0,0 @@ -package testutil - -import ( - "cosmossdk.io/math" - tmcrypto "github.com/cometbft/cometbft/crypto" - tmtypes "github.com/cometbft/cometbft/types" - - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - "github.com/cosmos/cosmos-sdk/x/staking/types" -) - -// GetTmConsPubKey gets the validator's public key as a tmcrypto.PubKey. -func GetTmConsPubKey(v types.Validator) (tmcrypto.PubKey, error) { - pk, err := v.ConsPubKey() - if err != nil { - return nil, err - } - - return cryptocodec.ToTmPubKeyInterface(pk) -} - -// ToTmValidator casts an SDK validator to a tendermint type Validator. -func ToTmValidator(v types.Validator, r math.Int) (*tmtypes.Validator, error) { - tmPk, err := GetTmConsPubKey(v) - if err != nil { - return nil, err - } - - return tmtypes.NewValidator(tmPk, v.ConsensusPower(r)), nil -} - -// ToTmValidators casts all validators to the corresponding tendermint type. -func ToTmValidators(v types.Validators, r math.Int) ([]*tmtypes.Validator, error) { - validators := make([]*tmtypes.Validator, len(v)) - var err error - for i, val := range v { - validators[i], err = ToTmValidator(val, r) - if err != nil { - return nil, err - } - } - - return validators, nil -} diff --git a/x/staking/types/authz_test.go b/x/staking/types/authz_test.go index c80b84448500..72251c6f1b43 100644 --- a/x/staking/types/authz_test.go +++ b/x/staking/types/authz_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" storetypes "cosmossdk.io/store/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" @@ -26,7 +26,7 @@ var ( func TestAuthzAuthorizations(t *testing.T) { key := storetypes.NewKVStoreKey(stakingtypes.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{}) // verify ValidateBasic returns error for the AUTHORIZATION_TYPE_UNSPECIFIED authorization type delAuth, err := stakingtypes.NewStakeAuthorization([]sdk.ValAddress{val1, val2}, []sdk.ValAddress{}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_UNSPECIFIED, &coin100) diff --git a/x/staking/types/exported.go b/x/staking/types/exported.go index bf83ab09a76a..79f7f23ce085 100644 --- a/x/staking/types/exported.go +++ b/x/staking/types/exported.go @@ -2,7 +2,7 @@ package types import ( "cosmossdk.io/math" - tmprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -25,11 +25,11 @@ type ValidatorI interface { IsUnbonding() bool // check if has status unbonding GetOperator() sdk.ValAddress // operator address to receive/return validators coins ConsPubKey() (cryptotypes.PubKey, error) // validation consensus pubkey (cryptotypes.PubKey) - TmConsPublicKey() (tmprotocrypto.PublicKey, error) // validation consensus pubkey (Tendermint) + TmConsPublicKey() (cmtprotocrypto.PublicKey, error) // validation consensus pubkey (CometBFT) GetConsAddr() (sdk.ConsAddress, error) // validation consensus address GetTokens() math.Int // validation tokens GetBondedTokens() math.Int // validator bonded tokens - GetConsensusPower(math.Int) int64 // validation power in tendermint + GetConsensusPower(math.Int) int64 // validation power in CometBFT GetCommission() math.LegacyDec // validator commission rate GetMinSelfDelegation() math.Int // validator minimum self delegation GetDelegatorShares() math.LegacyDec // total outstanding delegator shares diff --git a/x/staking/types/historical_info.go b/x/staking/types/historical_info.go index 7107758ee438..76fe48e4665d 100644 --- a/x/staking/types/historical_info.go +++ b/x/staking/types/historical_info.go @@ -5,7 +5,7 @@ import ( "cosmossdk.io/math" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/gogoproto/proto" "github.com/cosmos/cosmos-sdk/codec" @@ -15,7 +15,7 @@ import ( // NewHistoricalInfo will create a historical information struct from header and valset // it will first sort valset before inclusion into historical info -func NewHistoricalInfo(header tmproto.Header, valSet Validators, powerReduction math.Int) HistoricalInfo { +func NewHistoricalInfo(header cmtproto.Header, valSet Validators, powerReduction math.Int) HistoricalInfo { // Must sort in the same way that tendermint does sort.SliceStable(valSet, func(i, j int) bool { return ValidatorsByVotingPower(valSet).Less(i, j, powerReduction) diff --git a/x/staking/types/historical_info_test.go b/x/staking/types/historical_info_test.go index ec608fc93d65..f463111d777e 100644 --- a/x/staking/types/historical_info_test.go +++ b/x/staking/types/historical_info_test.go @@ -8,14 +8,14 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/types" ) -var header = tmproto.Header{ +var header = cmtproto.Header{ ChainID: "hello", Height: 5, } diff --git a/x/staking/types/validator.go b/x/staking/types/validator.go index 753cbe9eda89..a164b9f0d394 100644 --- a/x/staking/types/validator.go +++ b/x/staking/types/validator.go @@ -9,7 +9,7 @@ import ( "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" - tmprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -467,16 +467,16 @@ func (v Validator) ConsPubKey() (cryptotypes.PubKey, error) { return pk, nil } -// TmConsPublicKey casts Validator.ConsensusPubkey to tmprotocrypto.PubKey. -func (v Validator) TmConsPublicKey() (tmprotocrypto.PublicKey, error) { +// TmConsPublicKey casts Validator.ConsensusPubkey to cmtprotocrypto.PubKey. +func (v Validator) TmConsPublicKey() (cmtprotocrypto.PublicKey, error) { pk, err := v.ConsPubKey() if err != nil { - return tmprotocrypto.PublicKey{}, err + return cmtprotocrypto.PublicKey{}, err } tmPk, err := cryptocodec.ToTmProtoPublicKey(pk) if err != nil { - return tmprotocrypto.PublicKey{}, err + return cmtprotocrypto.PublicKey{}, err } return tmPk, nil diff --git a/x/staking/types/validator_test.go b/x/staking/types/validator_test.go index 14dc23103853..112f4d3c09e3 100644 --- a/x/staking/types/validator_test.go +++ b/x/staking/types/validator_test.go @@ -6,7 +6,7 @@ import ( "testing" "cosmossdk.io/math" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -271,8 +271,8 @@ func TestValidatorsSortDeterminism(t *testing.T) { } } -// Check SortTendermint sorts the same as tendermint -func TestValidatorsSortTendermint(t *testing.T) { +// Check SortCometBFT sorts the same as CometBFT +func TestValidatorsSortCometBFT(t *testing.T) { vals := make([]types.Validator, 100) for i := range vals { @@ -289,24 +289,24 @@ func TestValidatorsSortTendermint(t *testing.T) { valz := types.Validators(vals) - // create expected tendermint validators by converting to tendermint then sorting - expectedVals, err := testutil.ToTmValidators(valz, sdk.DefaultPowerReduction) + // create expected CometBFT validators by converting to CometBFT then sorting + expectedVals, err := testutil.ToCmtValidators(valz, sdk.DefaultPowerReduction) require.NoError(t, err) - sort.Sort(tmtypes.ValidatorsByVotingPower(expectedVals)) + sort.Sort(cmttypes.ValidatorsByVotingPower(expectedVals)) - // sort in SDK and then convert to tendermint + // sort in SDK and then convert to CometBFT sort.SliceStable(valz, func(i, j int) bool { return types.ValidatorsByVotingPower(valz).Less(i, j, sdk.DefaultPowerReduction) }) - actualVals, err := testutil.ToTmValidators(valz, sdk.DefaultPowerReduction) + actualVals, err := testutil.ToCmtValidators(valz, sdk.DefaultPowerReduction) require.NoError(t, err) - require.Equal(t, expectedVals, actualVals, "sorting in SDK is not the same as sorting in Tendermint") + require.Equal(t, expectedVals, actualVals, "sorting in SDK is not the same as sorting in CometBFT") } func TestValidatorToTm(t *testing.T) { vals := make(types.Validators, 10) - expected := make([]*tmtypes.Validator, 10) + expected := make([]*cmttypes.Validator, 10) for i := range vals { pk := ed25519.GenPrivKey().PubKey() @@ -316,9 +316,9 @@ func TestValidatorToTm(t *testing.T) { vals[i] = val tmPk, err := cryptocodec.ToTmPubKeyInterface(pk) require.NoError(t, err) - expected[i] = tmtypes.NewValidator(tmPk, val.ConsensusPower(sdk.DefaultPowerReduction)) + expected[i] = cmttypes.NewValidator(tmPk, val.ConsensusPower(sdk.DefaultPowerReduction)) } - vs, err := testutil.ToTmValidators(vals, sdk.DefaultPowerReduction) + vs, err := testutil.ToCmtValidators(vals, sdk.DefaultPowerReduction) require.NoError(t, err) require.Equal(t, expected, vs) } diff --git a/x/upgrade/abci_test.go b/x/upgrade/abci_test.go index 619e12909b20..dcaedcf37d98 100644 --- a/x/upgrade/abci_test.go +++ b/x/upgrade/abci_test.go @@ -7,7 +7,7 @@ import ( "time" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -56,7 +56,7 @@ func setupTest(t *testing.T, height int64, skip map[int64]bool) TestSuite { s.keeper = keeper.NewKeeper(skip, key, s.encCfg.Codec, t.TempDir(), nil, authtypes.NewModuleAddress(govtypes.ModuleName).String()) s.keeper.SetVersionSetter(s.baseApp) - s.ctx = testCtx.Ctx.WithBlockHeader(tmproto.Header{Time: time.Now(), Height: height}) + s.ctx = testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: time.Now(), Height: height}) s.module = upgrade.NewAppModule(s.keeper) s.handler = upgrade.NewSoftwareUpgradeProposalHandler(s.keeper) @@ -483,7 +483,7 @@ func TestDowngradeVerification(t *testing.T) { encCfg := moduletestutil.MakeTestEncodingConfig(upgrade.AppModuleBasic{}) key := storetypes.NewKVStoreKey(types.StoreKey) testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) - ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{Time: time.Now(), Height: 10}) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: time.Now(), Height: 10}) skip := map[int64]bool{} tempDir := t.TempDir() diff --git a/x/upgrade/client/cli/query_test.go b/x/upgrade/client/cli/query_test.go index 762032cfa4b6..da890878b5be 100644 --- a/x/upgrade/client/cli/query_test.go +++ b/x/upgrade/client/cli/query_test.go @@ -27,7 +27,7 @@ func TestGetCurrentPlanCmd(t *testing.T) { WithKeyring(kr). WithTxConfig(encCfg.TxConfig). WithCodec(encCfg.Codec). - WithClient(clitestutil.MockTendermintRPC{Client: rpcclientmock.Client{}}). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). WithAccountRetriever(client.MockAccountRetriever{}). WithOutput(io.Discard). WithChainID("test-chain") @@ -75,7 +75,7 @@ func TestGetAppliedPlanCmd(t *testing.T) { WithKeyring(kr). WithTxConfig(encCfg.TxConfig). WithCodec(encCfg.Codec). - WithClient(clitestutil.MockTendermintRPC{Client: rpcclientmock.Client{}}). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). WithAccountRetriever(client.MockAccountRetriever{}). WithOutput(io.Discard). WithChainID("test-chain") @@ -123,7 +123,7 @@ func TestGetModuleVersionsCmd(t *testing.T) { WithKeyring(kr). WithTxConfig(encCfg.TxConfig). WithCodec(encCfg.Codec). - WithClient(clitestutil.MockTendermintRPC{Client: rpcclientmock.Client{}}). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). WithAccountRetriever(client.MockAccountRetriever{}). WithOutput(io.Discard). WithChainID("test-chain") diff --git a/x/upgrade/client/cli/tx_test.go b/x/upgrade/client/cli/tx_test.go index b6af8e6c3c21..dd8d5c9e347b 100644 --- a/x/upgrade/client/cli/tx_test.go +++ b/x/upgrade/client/cli/tx_test.go @@ -31,7 +31,7 @@ func TestModuleVersionsCLI(t *testing.T) { WithKeyring(kr). WithTxConfig(encCfg.TxConfig). WithCodec(encCfg.Codec). - WithClient(clitestutil.MockTendermintRPC{Client: rpcclientmock.Client{}}). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). WithAccountRetriever(client.MockAccountRetriever{}). WithOutput(io.Discard). WithChainID("test-chain") diff --git a/x/upgrade/go.mod b/x/upgrade/go.mod index 35b66220a99e..e43ad9e37ce1 100644 --- a/x/upgrade/go.mod +++ b/x/upgrade/go.mod @@ -6,11 +6,12 @@ require ( cosmossdk.io/api v0.3.0 cosmossdk.io/core v0.5.1 cosmossdk.io/depinject v1.0.0-alpha.3 - cosmossdk.io/store v0.0.0-20230204135315-697871069999 + cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 github.com/cometbft/cometbft v0.0.0-20230203130311-387422ac220d github.com/cosmos/cosmos-db v1.0.0-rc.1 github.com/cosmos/cosmos-proto v1.0.0-beta.1 - github.com/cosmos/cosmos-sdk v0.47.0-rc2 + // TODO to replace by a tagged version of the SDK (with CometBFT) when available + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230205135133-41a3dfeced29 github.com/cosmos/gogoproto v1.4.4 github.com/golang/protobuf v1.5.2 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -21,7 +22,7 @@ require ( github.com/stretchr/testify v1.8.1 google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 google.golang.org/grpc v1.52.3 - google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a + google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af ) require ( @@ -173,7 +174,6 @@ require ( replace ( github.com/cosmos/cosmos-sdk => ../.. - // Fix upstream GHSA-h395-qcrw-5vmq vulnerability. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.8.1 diff --git a/x/upgrade/go.sum b/x/upgrade/go.sum index a5bf54482787..bb77d58bc5d5 100644 --- a/x/upgrade/go.sum +++ b/x/upgrade/go.sum @@ -60,6 +60,8 @@ cosmossdk.io/math v1.0.0-beta.6 h1:WF29SiFYNde5eYvqO2kdOM9nYbDb44j3YW5B8M1m9KE= cosmossdk.io/math v1.0.0-beta.6/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= cosmossdk.io/store v0.0.0-20230204135315-697871069999 h1:NrV990BIbdDngOoTrD3Hg5kqqgvy6c+ETaKGY5bSUmo= cosmossdk.io/store v0.0.0-20230204135315-697871069999/go.mod h1:Sf3G8SV8e8H31CD6w+o2syqCwyaoL0fe244JcPSsaD4= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= +cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7/go.mod h1:1XOtuYs7jsfQkn7G3VQXB6I+2tHXKHZw2U/AafNbnlk= cosmossdk.io/x/tx v0.1.0 h1:uyyYVjG22B+jf54N803Z99Y1uPvfuNP3K1YShoCHYL8= cosmossdk.io/x/tx v0.1.0/go.mod h1:qsDv7e1fSftkF16kpSAk+7ROOojyj+SC0Mz3ukI52EQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -1329,6 +1331,8 @@ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a h1:KJVqJe240LvVd+8lfzRx3hQ0UZ0fyeXEMDMHviRNQKs= google.golang.org/protobuf v1.28.2-0.20230130093322-0430d694e04a/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af h1:rAgzfIj9FJtmJ6ZPDlxXX6Fzzix6NOpPTvVmPY5rwQg= +google.golang.org/protobuf v1.28.2-0.20230206090356-358fe40267af/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/upgrade/keeper/keeper_test.go b/x/upgrade/keeper/keeper_test.go index 66a791fa11b3..9eabd0920d9c 100644 --- a/x/upgrade/keeper/keeper_test.go +++ b/x/upgrade/keeper/keeper_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/suite" storetypes "cosmossdk.io/store/types" @@ -62,7 +62,7 @@ func (s *KeeperTestSuite) SetupTest() { s.Require().Equal(testCtx.Ctx.Logger().With("module", "x/"+types.ModuleName), s.upgradeKeeper.Logger(testCtx.Ctx)) s.T().Log("home dir:", homeDir) s.homeDir = homeDir - s.ctx = testCtx.Ctx.WithBlockHeader(tmproto.Header{Time: time.Now(), Height: 10}) + s.ctx = testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: time.Now(), Height: 10}) s.msgSrvr = keeper.NewMsgServerImpl(s.upgradeKeeper) s.addrs = simtestutil.CreateIncrementalAccounts(1) diff --git a/x/upgrade/types/plan_test.go b/x/upgrade/types/plan_test.go index 61585c5e1b7f..1801db97a814 100644 --- a/x/upgrade/types/plan_test.go +++ b/x/upgrade/types/plan_test.go @@ -5,7 +5,7 @@ import ( "time" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -147,7 +147,7 @@ func TestShouldExecute(t *testing.T) { for name, tc := range cases { tc := tc // copy to local variable for scopelint t.Run(name, func(t *testing.T) { - ctx := sdk.NewContext(nil, tmproto.Header{Height: tc.ctxHeight, Time: tc.ctxTime}, false, log.NewNopLogger()) + ctx := sdk.NewContext(nil, cmtproto.Header{Height: tc.ctxHeight, Time: tc.ctxTime}, false, log.NewNopLogger()) should := tc.p.ShouldExecute(ctx) assert.Equal(t, tc.expected, should) }) diff --git a/x/upgrade/types/storeloader_test.go b/x/upgrade/types/storeloader_test.go index b62b44b7e6ad..9c7ef2e303e7 100644 --- a/x/upgrade/types/storeloader_test.go +++ b/x/upgrade/types/storeloader_test.go @@ -8,7 +8,7 @@ import ( abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" @@ -127,7 +127,7 @@ func TestSetLoader(t *testing.T) { require.Nil(t, err) for i := int64(2); i <= upgradeHeight-1; i++ { - origapp.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: i}}) + origapp.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: i}}) res := origapp.Commit() require.NotNil(t, res.Data) } @@ -143,7 +143,7 @@ func TestSetLoader(t *testing.T) { require.Nil(t, err) // "execute" one block - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: upgradeHeight}}) + app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: upgradeHeight}}) res := app.Commit() require.NotNil(t, res.Data)