chore: downgrade to tendermint v0.34.x (#12958)

This commit is contained in:
Julien Robert
2022-08-20 02:33:07 +02:00
committed by GitHub
parent f6b5822557
commit 1dee068932
94 changed files with 552 additions and 3092 deletions
@@ -225,7 +225,7 @@ func (s *IntegrationTestSuite) TestValidatorSetByHeight_GRPC() {
expErrMsg string
}{
{"nil request", nil, true, "request cannot be nil"},
{"empty request", &tmservice.GetValidatorSetByHeightRequest{}, true, "height must be greater than zero"},
{"empty request", &tmservice.GetValidatorSetByHeightRequest{}, true, "height must be greater than 0"},
{"no pagination", &tmservice.GetValidatorSetByHeightRequest{Height: 1}, false, ""},
{"with pagination", &tmservice.GetValidatorSetByHeightRequest{Height: 1, Pagination: &qtypes.PageRequest{Offset: 0, Limit: 1}}, false, ""},
}
@@ -253,7 +253,7 @@ func (s *IntegrationTestSuite) TestValidatorSetByHeight_GRPCGateway() {
expErr bool
expErrMsg string
}{
{"invalid height", fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/%d", vals[0].APIAddress, -1), true, "height must be greater than zero"},
{"invalid height", fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/%d", vals[0].APIAddress, -1), true, "height must be greater than 0"},
{"no pagination", fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/%d", vals[0].APIAddress, 1), false, ""},
{"pagination invalid fields", fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/%d?pagination.offset=-1&pagination.limit=-2", vals[0].APIAddress, 1), true, "strconv.ParseUint"},
{"with pagination", fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/%d?pagination.offset=0&pagination.limit=2", vals[0].APIAddress, 1), false, ""},
+1 -1
View File
@@ -129,7 +129,7 @@ func setupApp(t *testing.T, tempDir string) (*simapp.SimApp, context.Context, *t
t.Fatalf("error creating config folder: %s", err)
}
logger, _ := log.NewDefaultLogger("plain", "info", false)
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
db := dbm.NewMemDB()
app := simapp.NewSimApp(logger, db, nil, true, simtestutil.NewAppOptionsWithFlagHome(tempDir))
+5
View File
@@ -608,6 +608,7 @@ func (s *IntegrationTestSuite) TestSimMultiSigTx() {
s.Require().NoError(err)
height, err := s.network.LatestHeight()
s.Require().NoError(err)
_, err = s.network.WaitForHeight(height + 1)
s.Require().NoError(err)
@@ -626,8 +627,10 @@ func (s *IntegrationTestSuite) TestSimMultiSigTx() {
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
fmt.Sprintf("--gas=%d", flags.DefaultGasLimit),
)
s.Require().NoError(err)
height, err = s.network.LatestHeight()
s.Require().NoError(err)
_, err = s.network.WaitForHeight(height + 1)
s.Require().NoError(err)
@@ -672,7 +675,9 @@ func (s *IntegrationTestSuite) TestSimMultiSigTx() {
// convert from protoJSON to protoBinary for sim
sdkTx, err := val1.ClientCtx.TxConfig.TxJSONDecoder()(multiSigWith2Signatures.Bytes())
s.Require().NoError(err)
txBytes, err := val1.ClientCtx.TxConfig.TxEncoder()(sdkTx)
s.Require().NoError(err)
// simulate tx
sim := &tx.SimulateRequest{TxBytes: txBytes}
+11 -11
View File
@@ -23,8 +23,8 @@ import (
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
abci "github.com/tendermint/tendermint/abci/types"
tmtime "github.com/tendermint/tendermint/libs/time"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
tmtime "github.com/tendermint/tendermint/types/time"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/simapp"
@@ -602,15 +602,15 @@ func (suite *IntegrationTestSuite) TestMsgSendEvents() {
}
event1.Attributes = append(
event1.Attributes,
abci.EventAttribute{Key: types.AttributeKeyRecipient, Value: addr2.String()},
abci.EventAttribute{Key: []byte(types.AttributeKeyRecipient), Value: []byte(addr2.String())},
)
event1.Attributes = append(
event1.Attributes,
abci.EventAttribute{Key: types.AttributeKeySender, Value: addr.String()},
abci.EventAttribute{Key: []byte(types.AttributeKeySender), Value: []byte(addr.String())},
)
event1.Attributes = append(
event1.Attributes,
abci.EventAttribute{Key: sdk.AttributeKeyAmount, Value: newCoins.String()},
abci.EventAttribute{Key: []byte(sdk.AttributeKeyAmount), Value: []byte(newCoins.String())},
)
event2 := sdk.Event{
@@ -619,7 +619,7 @@ func (suite *IntegrationTestSuite) TestMsgSendEvents() {
}
event2.Attributes = append(
event2.Attributes,
abci.EventAttribute{Key: types.AttributeKeySender, Value: addr.String()},
abci.EventAttribute{Key: []byte(types.AttributeKeySender), Value: []byte(addr.String())},
)
// events are shifted due to the funding account events
@@ -668,7 +668,7 @@ func (suite *IntegrationTestSuite) TestMsgMultiSendEvents() {
suite.Require().NoError(suite.bankKeeper.InputOutputCoins(ctx, input, outputs))
events = ctx.EventManager().ABCIEvents()
suite.Require().Equal(12, len(events)) // 9 events because account funding causes extra minting + coin_spent + coin_recv events
suite.Require().Equal(12, len(events)) // 12 events because account funding causes extra minting + coin_spent + coin_recv events
event1 := sdk.Event{
Type: sdk.EventTypeMessage,
@@ -676,7 +676,7 @@ func (suite *IntegrationTestSuite) TestMsgMultiSendEvents() {
}
event1.Attributes = append(
event1.Attributes,
abci.EventAttribute{Key: types.AttributeKeySender, Value: addr.String()},
abci.EventAttribute{Key: []byte(types.AttributeKeySender), Value: []byte(addr.String())},
)
suite.Require().Equal(abci.Event(event1), events[7])
@@ -698,22 +698,22 @@ func (suite *IntegrationTestSuite) TestMsgMultiSendEvents() {
}
event2.Attributes = append(
event2.Attributes,
abci.EventAttribute{Key: types.AttributeKeyRecipient, Value: addr3.String()},
abci.EventAttribute{Key: []byte(types.AttributeKeyRecipient), Value: []byte(addr3.String())},
)
event2.Attributes = append(
event2.Attributes,
abci.EventAttribute{Key: sdk.AttributeKeyAmount, Value: newCoins.String()})
abci.EventAttribute{Key: []byte(sdk.AttributeKeyAmount), Value: []byte(newCoins.String())})
event3 := sdk.Event{
Type: types.EventTypeTransfer,
Attributes: []abci.EventAttribute{},
}
event3.Attributes = append(
event3.Attributes,
abci.EventAttribute{Key: types.AttributeKeyRecipient, Value: addr4.String()},
abci.EventAttribute{Key: []byte(types.AttributeKeyRecipient), Value: []byte(addr4.String())},
)
event3.Attributes = append(
event3.Attributes,
abci.EventAttribute{Key: sdk.AttributeKeyAmount, Value: newCoins2.String()},
abci.EventAttribute{Key: []byte(sdk.AttributeKeyAmount), Value: []byte(newCoins2.String())},
)
// events are shifted due to the funding account events
suite.Require().Equal(abci.Event(event1), events[25])