refactor! : bump comet to v1 (#19726)
Co-authored-by: yihuang <yi.codeplayer@gmail.com>
This commit is contained in:
@@ -73,7 +73,7 @@ func (s *CLITestSuite) SetupSuite() {
|
||||
|
||||
ctxGen := func() client.Context {
|
||||
bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{})
|
||||
c := clitestutil.NewMockCometRPC(abci.ResponseQuery{
|
||||
c := clitestutil.NewMockCometRPC(abci.QueryResponse{
|
||||
Value: bz,
|
||||
})
|
||||
return s.baseCtx.WithClient(c)
|
||||
|
||||
@@ -132,7 +132,7 @@ func TestSendNotEnoughBalance(t *testing.T) {
|
||||
ctx := baseApp.NewContext(false)
|
||||
|
||||
require.NoError(t, testutil.FundAccount(ctx, s.BankKeeper, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 67))))
|
||||
_, err := baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: baseApp.LastBlockHeight() + 1})
|
||||
_, err := baseApp.FinalizeBlock(&abci.FinalizeBlockRequest{Height: baseApp.LastBlockHeight() + 1})
|
||||
require.NoError(t, err)
|
||||
_, err = baseApp.Commit()
|
||||
require.NoError(t, err)
|
||||
@@ -183,7 +183,7 @@ func TestMsgMultiSendWithAccounts(t *testing.T) {
|
||||
ctx := baseApp.NewContext(false)
|
||||
|
||||
require.NoError(t, testutil.FundAccount(ctx, s.BankKeeper, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 67))))
|
||||
_, err = baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: baseApp.LastBlockHeight() + 1})
|
||||
_, err = baseApp.FinalizeBlock(&abci.FinalizeBlockRequest{Height: baseApp.LastBlockHeight() + 1})
|
||||
require.NoError(t, err)
|
||||
_, err = baseApp.Commit()
|
||||
require.NoError(t, err)
|
||||
@@ -289,7 +289,7 @@ func TestMsgMultiSendMultipleOut(t *testing.T) {
|
||||
|
||||
require.NoError(t, testutil.FundAccount(ctx, s.BankKeeper, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 42))))
|
||||
require.NoError(t, testutil.FundAccount(ctx, s.BankKeeper, addr2, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 42))))
|
||||
_, err = baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: baseApp.LastBlockHeight() + 1})
|
||||
_, err = baseApp.FinalizeBlock(&abci.FinalizeBlockRequest{Height: baseApp.LastBlockHeight() + 1})
|
||||
require.NoError(t, err)
|
||||
_, err = baseApp.Commit()
|
||||
require.NoError(t, err)
|
||||
@@ -346,7 +346,7 @@ func TestMsgMultiSendDependent(t *testing.T) {
|
||||
ctx := baseApp.NewContext(false)
|
||||
|
||||
require.NoError(t, testutil.FundAccount(ctx, s.BankKeeper, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 42))))
|
||||
_, err = baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: baseApp.LastBlockHeight() + 1})
|
||||
_, err = baseApp.FinalizeBlock(&abci.FinalizeBlockRequest{Height: baseApp.LastBlockHeight() + 1})
|
||||
require.NoError(t, err)
|
||||
_, err = baseApp.Commit()
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -76,7 +76,7 @@ func BenchmarkOneBankSendTxPerBlock(b *testing.B) {
|
||||
baseApp := s.App.BaseApp
|
||||
ctx := baseApp.NewContext(false)
|
||||
|
||||
_, err := baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1})
|
||||
_, err := baseApp.FinalizeBlock(&abci.FinalizeBlockRequest{Height: 1})
|
||||
require.NoError(b, err)
|
||||
|
||||
require.NoError(b, testutil.FundAccount(ctx, s.BankKeeper, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 100000000000))))
|
||||
@@ -106,7 +106,7 @@ func BenchmarkOneBankSendTxPerBlock(b *testing.B) {
|
||||
require.NoError(b, err)
|
||||
|
||||
_, err = baseApp.FinalizeBlock(
|
||||
&abci.RequestFinalizeBlock{
|
||||
&abci.FinalizeBlockRequest{
|
||||
Height: height,
|
||||
Txs: [][]byte{bz},
|
||||
},
|
||||
@@ -139,7 +139,7 @@ func BenchmarkOneBankMultiSendTxPerBlock(b *testing.B) {
|
||||
baseApp := s.App.BaseApp
|
||||
ctx := baseApp.NewContext(false)
|
||||
|
||||
_, err = baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1})
|
||||
_, err = baseApp.FinalizeBlock(&abci.FinalizeBlockRequest{Height: 1})
|
||||
require.NoError(b, err)
|
||||
|
||||
require.NoError(b, testutil.FundAccount(ctx, s.BankKeeper, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 100000000000))))
|
||||
@@ -174,7 +174,7 @@ func BenchmarkOneBankMultiSendTxPerBlock(b *testing.B) {
|
||||
require.NoError(b, err)
|
||||
|
||||
_, err = baseApp.FinalizeBlock(
|
||||
&abci.RequestFinalizeBlock{
|
||||
&abci.FinalizeBlockRequest{
|
||||
Height: height,
|
||||
Txs: [][]byte{bz},
|
||||
},
|
||||
|
||||
@@ -55,7 +55,7 @@ func (s *CLITestSuite) SetupSuite() {
|
||||
|
||||
ctxGen := func() client.Context {
|
||||
bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{})
|
||||
c := clitestutil.NewMockCometRPC(abci.ResponseQuery{
|
||||
c := clitestutil.NewMockCometRPC(abci.QueryResponse{
|
||||
Value: bz,
|
||||
})
|
||||
return s.baseCtx.WithClient(c)
|
||||
|
||||
@@ -318,7 +318,7 @@ func TestHandleDoubleSign_TooOld(t *testing.T) {
|
||||
|
||||
nci := comet.Info{Evidence: []comet.Evidence{{
|
||||
Validator: comet.Validator{Address: valpubkey.Address(), Power: power},
|
||||
Type: comet.MisbehaviorType(abci.MisbehaviorType_DUPLICATE_VOTE),
|
||||
Type: comet.MisbehaviorType(abci.MISBEHAVIOR_TYPE_DUPLICATE_VOTE),
|
||||
Time: ctx.HeaderInfo().Time,
|
||||
Height: 0,
|
||||
}}}
|
||||
@@ -399,7 +399,7 @@ func TestHandleDoubleSignAfterRotation(t *testing.T) {
|
||||
nci := comet.Info{
|
||||
Evidence: []comet.Evidence{{
|
||||
Validator: comet.Validator{Address: valpubkey.Address(), Power: power},
|
||||
Type: comet.MisbehaviorType(abci.MisbehaviorType_DUPLICATE_VOTE),
|
||||
Type: comet.MisbehaviorType(abci.MISBEHAVIOR_TYPE_DUPLICATE_VOTE),
|
||||
Time: time.Unix(0, 0),
|
||||
Height: 0,
|
||||
}},
|
||||
|
||||
@@ -74,7 +74,7 @@ func TestImportExportQueues(t *testing.T) {
|
||||
ctx := s1.app.BaseApp.NewContext(false)
|
||||
addrs := simtestutil.AddTestAddrs(s1.BankKeeper, s1.StakingKeeper, ctx, 1, valTokens)
|
||||
|
||||
_, err = s1.app.FinalizeBlock(&abci.RequestFinalizeBlock{
|
||||
_, err = s1.app.FinalizeBlock(&abci.FinalizeBlockRequest{
|
||||
Height: s1.app.LastBlockHeight() + 1,
|
||||
})
|
||||
assert.NilError(t, err)
|
||||
@@ -140,7 +140,7 @@ func TestImportExportQueues(t *testing.T) {
|
||||
assert.NilError(t, err)
|
||||
|
||||
_, err = s2.app.InitChain(
|
||||
&abci.RequestInitChain{
|
||||
&abci.InitChainRequest{
|
||||
Validators: []abci.ValidatorUpdate{},
|
||||
ConsensusParams: simtestutil.DefaultConsensusParams,
|
||||
AppStateBytes: stateBytes,
|
||||
@@ -148,12 +148,12 @@ func TestImportExportQueues(t *testing.T) {
|
||||
)
|
||||
assert.NilError(t, err)
|
||||
|
||||
_, err = s2.app.FinalizeBlock(&abci.RequestFinalizeBlock{
|
||||
_, err = s2.app.FinalizeBlock(&abci.FinalizeBlockRequest{
|
||||
Height: s2.app.LastBlockHeight() + 1,
|
||||
})
|
||||
assert.NilError(t, err)
|
||||
|
||||
_, err = s2.app.FinalizeBlock(&abci.RequestFinalizeBlock{
|
||||
_, err = s2.app.FinalizeBlock(&abci.FinalizeBlockRequest{
|
||||
Height: s2.app.LastBlockHeight() + 1,
|
||||
})
|
||||
assert.NilError(t, err)
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1"
|
||||
"gotest.tools/v3/assert"
|
||||
|
||||
"cosmossdk.io/collections"
|
||||
|
||||
@@ -6,9 +6,10 @@ import (
|
||||
"testing"
|
||||
|
||||
abci "github.com/cometbft/cometbft/abci/types"
|
||||
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1"
|
||||
protoio "github.com/cosmos/gogoproto/io"
|
||||
"github.com/cosmos/gogoproto/proto"
|
||||
gogotypes "github.com/cosmos/gogoproto/types"
|
||||
"gotest.tools/v3/assert"
|
||||
|
||||
"cosmossdk.io/core/comet"
|
||||
@@ -35,7 +36,7 @@ func TestValidateVoteExtensions(t *testing.T) {
|
||||
|
||||
// enable vote extensions
|
||||
cp := simtestutil.DefaultConsensusParams
|
||||
cp.Abci = &cmtproto.ABCIParams{VoteExtensionsEnableHeight: 1}
|
||||
cp.Feature = &cmtproto.FeatureParams{VoteExtensionsEnableHeight: &gogotypes.Int64Value{Value: 1}}
|
||||
f.sdkCtx = f.sdkCtx.WithConsensusParams(*cp).WithHeaderInfo(header.Info{Height: 2, ChainID: chainID})
|
||||
|
||||
// setup the validators
|
||||
|
||||
@@ -167,7 +167,7 @@ func (s *SimTestSuite) TestWeightedOperations() {
|
||||
// Abonormal scenarios, where the message are created by an errors are not tested here.
|
||||
func (s *SimTestSuite) TestSimulateMsgCreateValidator() {
|
||||
require := s.Require()
|
||||
_, err := s.app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash})
|
||||
_, err := s.app.FinalizeBlock(&abci.FinalizeBlockRequest{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash})
|
||||
require.NoError(err)
|
||||
// execute operation
|
||||
op := simulation.SimulateMsgCreateValidator(s.txConfig, s.accountKeeper, s.bankKeeper, s.stakingKeeper)
|
||||
@@ -213,7 +213,7 @@ func (s *SimTestSuite) TestSimulateMsgCancelUnbondingDelegation() {
|
||||
require.NoError(s.stakingKeeper.SetUnbondingDelegation(ctx, udb))
|
||||
s.setupValidatorRewards(ctx, val0bz)
|
||||
|
||||
_, err = s.app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash, Time: blockTime})
|
||||
_, err = s.app.FinalizeBlock(&abci.FinalizeBlockRequest{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash, Time: blockTime})
|
||||
require.NoError(err)
|
||||
// execute operation
|
||||
op := simulation.SimulateMsgCancelUnbondingDelegate(s.txConfig, s.accountKeeper, s.bankKeeper, s.stakingKeeper)
|
||||
@@ -241,7 +241,7 @@ func (s *SimTestSuite) TestSimulateMsgEditValidator() {
|
||||
// setup accounts[0] as validator
|
||||
_ = s.getTestingValidator0(ctx)
|
||||
|
||||
_, err := s.app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash, Time: blockTime})
|
||||
_, err := s.app.FinalizeBlock(&abci.FinalizeBlockRequest{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash, Time: blockTime})
|
||||
require.NoError(err)
|
||||
// execute operation
|
||||
op := simulation.SimulateMsgEditValidator(s.txConfig, s.accountKeeper, s.bankKeeper, s.stakingKeeper)
|
||||
@@ -302,7 +302,7 @@ func (s *SimTestSuite) TestSimulateMsgUndelegate() {
|
||||
|
||||
s.setupValidatorRewards(ctx, val0bz)
|
||||
|
||||
_, err = s.app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash, Time: blockTime})
|
||||
_, err = s.app.FinalizeBlock(&abci.FinalizeBlockRequest{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash, Time: blockTime})
|
||||
require.NoError(err)
|
||||
// execute operation
|
||||
op := simulation.SimulateMsgUndelegate(s.txConfig, s.accountKeeper, s.bankKeeper, s.stakingKeeper)
|
||||
@@ -348,7 +348,7 @@ func (s *SimTestSuite) TestSimulateMsgBeginRedelegate() {
|
||||
s.setupValidatorRewards(ctx, val0bz)
|
||||
s.setupValidatorRewards(ctx, val1bz)
|
||||
|
||||
_, err = s.app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash, Time: blockTime})
|
||||
_, err = s.app.FinalizeBlock(&abci.FinalizeBlockRequest{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash, Time: blockTime})
|
||||
require.NoError(err)
|
||||
|
||||
// execute operation
|
||||
@@ -377,7 +377,7 @@ func (s *SimTestSuite) TestSimulateRotateConsPubKey() {
|
||||
_ = s.getTestingValidator2(ctx)
|
||||
|
||||
// begin a new block
|
||||
_, err := s.app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash, Time: blockTime})
|
||||
_, err := s.app.FinalizeBlock(&abci.FinalizeBlockRequest{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash, Time: blockTime})
|
||||
require.NoError(err)
|
||||
|
||||
// execute operation
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"testing"
|
||||
|
||||
abci "github.com/cometbft/cometbft/abci/types"
|
||||
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1"
|
||||
dbm "github.com/cosmos/cosmos-db"
|
||||
"gotest.tools/v3/assert"
|
||||
|
||||
@@ -31,14 +31,14 @@ func TestRollback(t *testing.T) {
|
||||
AppHash: app.LastCommitID().Hash,
|
||||
}
|
||||
|
||||
_, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{
|
||||
_, err := app.FinalizeBlock(&abci.FinalizeBlockRequest{
|
||||
Height: header.Height,
|
||||
})
|
||||
assert.NilError(t, err)
|
||||
ctx := app.NewContextLegacy(false, header)
|
||||
store := ctx.KVStore(app.GetKey("bank"))
|
||||
store.Set([]byte("key"), []byte(fmt.Sprintf("value%d", i)))
|
||||
_, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{
|
||||
_, err = app.FinalizeBlock(&abci.FinalizeBlockRequest{
|
||||
Height: header.Height,
|
||||
})
|
||||
assert.NilError(t, err)
|
||||
@@ -66,12 +66,12 @@ func TestRollback(t *testing.T) {
|
||||
Height: ver0 + i,
|
||||
AppHash: app.LastCommitID().Hash,
|
||||
}
|
||||
_, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: header.Height})
|
||||
_, err := app.FinalizeBlock(&abci.FinalizeBlockRequest{Height: header.Height})
|
||||
assert.NilError(t, err)
|
||||
ctx := app.NewContextLegacy(false, header)
|
||||
store := ctx.KVStore(app.GetKey("bank"))
|
||||
store.Set([]byte("key"), []byte(fmt.Sprintf("VALUE%d", i)))
|
||||
_, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{
|
||||
_, err = app.FinalizeBlock(&abci.FinalizeBlockRequest{
|
||||
Height: header.Height,
|
||||
})
|
||||
assert.NilError(t, err)
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
"cosmossdk.io/depinject"
|
||||
|
||||
Reference in New Issue
Block a user