chore: bump TM to v0.35.0 release candidate (#10210)

Integrate Tendermint v0.35.0, including changes to build and test
plumbing necessary to make everything build. This change does not
update any SDK APIs to make use of new features.

Co-authored-by: marbar3778 <marbar3778@yahoo.com>
Co-authored-by: tycho garen <garen@tychoish.com>
Co-authored-by: M. J. Fromberger <michael.j.fromberger@gmail.com>
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
Co-authored-by: Callum Waters <cmwaters19@gmail.com>
This commit is contained in:
Aleksandr Bezobchuk
2021-11-16 11:24:38 -08:00
committed by GitHub
co-authored by marbar3778 tycho garen M. J. Fromberger Amaury Callum Waters
parent 3f368577ed
commit af8ad3d20d
83 changed files with 1465 additions and 623 deletions
+4 -4
View File
@@ -36,7 +36,7 @@ type Context struct {
checkTx bool
recheckTx bool // if recheckTx == true, then checkTx must also be true
minGasPrice DecCoins
consParams *abci.ConsensusParams
consParams *tmproto.ConsensusParams
eventManager *EventManager
}
@@ -72,8 +72,8 @@ func (c Context) HeaderHash() tmbytes.HexBytes {
return hash
}
func (c Context) ConsensusParams() *abci.ConsensusParams {
return proto.Clone(c.consParams).(*abci.ConsensusParams)
func (c Context) ConsensusParams() *tmproto.ConsensusParams {
return proto.Clone(c.consParams).(*tmproto.ConsensusParams)
}
// create a new context
@@ -203,7 +203,7 @@ func (c Context) WithMinGasPrices(gasPrices DecCoins) Context {
}
// WithConsensusParams returns a Context with an updated consensus params
func (c Context) WithConsensusParams(params *abci.ConsensusParams) Context {
func (c Context) WithConsensusParams(params *tmproto.ConsensusParams) Context {
c.consParams = params
return c
}
+1 -1
View File
@@ -127,7 +127,7 @@ func (s *contextTestSuite) TestContextWithCustom() {
// test consensus param
s.Require().Nil(ctx.ConsensusParams())
cp := &abci.ConsensusParams{}
cp := &tmproto.ConsensusParams{}
s.Require().Equal(cp, ctx.WithConsensusParams(cp).ConsensusParams())
// test inner context
+5 -16
View File
@@ -90,8 +90,8 @@ func TypedEventToEvent(tev proto.Message) (Event, error) {
attrs := make([]abci.EventAttribute, 0, len(attrMap))
for k, v := range attrMap {
attrs = append(attrs, abci.EventAttribute{
Key: []byte(k),
Value: v,
Key: k,
Value: string(v),
})
}
@@ -122,7 +122,7 @@ func ParseTypedEvent(event abci.Event) (proto.Message, error) {
attrMap := make(map[string]json.RawMessage)
for _, attr := range event.Attributes {
attrMap[string(attr.Key)] = attr.Value
attrMap[attr.Key] = json.RawMessage(attr.Value)
}
attrBytes, err := json.Marshal(attrMap)
@@ -178,7 +178,7 @@ func (a Attribute) String() string {
// ToKVPair converts an Attribute object into a Tendermint key/value pair.
func (a Attribute) ToKVPair() abci.EventAttribute {
return abci.EventAttribute{Key: toBytes(a.Key), Value: toBytes(a.Value)}
return abci.EventAttribute{Key: a.Key, Value: a.Value}
}
// AppendAttributes adds one or more attributes to an Event.
@@ -210,17 +210,6 @@ func (e Events) ToABCIEvents() []abci.Event {
return res
}
func toBytes(i interface{}) []byte {
switch x := i.(type) {
case []uint8:
return x
case string:
return []byte(x)
default:
panic(i)
}
}
// Common event types and attribute keys
var (
EventTypeTx = "tx"
@@ -286,7 +275,7 @@ func StringifyEvent(e abci.Event) StringEvent {
for _, attr := range e.Attributes {
res.Attributes = append(
res.Attributes,
Attribute{string(attr.Key), string(attr.Value)},
Attribute{Key: attr.Key, Value: attr.Value},
)
}
+16 -16
View File
@@ -124,15 +124,15 @@ func (s *eventsTestSuite) TestMarkEventsToIndex() {
{
Type: "message",
Attributes: []abci.EventAttribute{
{Key: []byte("sender"), Value: []byte("foo")},
{Key: []byte("recipient"), Value: []byte("bar")},
{Key: "sender", Value: "foo"},
{Key: "recipient", Value: "bar"},
},
},
{
Type: "staking",
Attributes: []abci.EventAttribute{
{Key: []byte("deposit"), Value: []byte("5")},
{Key: []byte("unbond"), Value: []byte("10")},
{Key: "deposit", Value: "5"},
{Key: "unbond", Value: "10"},
},
},
}
@@ -148,15 +148,15 @@ func (s *eventsTestSuite) TestMarkEventsToIndex() {
{
Type: "message",
Attributes: []abci.EventAttribute{
{Key: []byte("sender"), Value: []byte("foo"), Index: true},
{Key: []byte("recipient"), Value: []byte("bar"), Index: true},
{Key: "sender", Value: "foo", Index: true},
{Key: "recipient", Value: "bar", Index: true},
},
},
{
Type: "staking",
Attributes: []abci.EventAttribute{
{Key: []byte("deposit"), Value: []byte("5"), Index: true},
{Key: []byte("unbond"), Value: []byte("10"), Index: true},
{Key: "deposit", Value: "5", Index: true},
{Key: "unbond", Value: "10", Index: true},
},
},
},
@@ -168,15 +168,15 @@ func (s *eventsTestSuite) TestMarkEventsToIndex() {
{
Type: "message",
Attributes: []abci.EventAttribute{
{Key: []byte("sender"), Value: []byte("foo"), Index: true},
{Key: []byte("recipient"), Value: []byte("bar")},
{Key: "sender", Value: "foo", Index: true},
{Key: "recipient", Value: "bar"},
},
},
{
Type: "staking",
Attributes: []abci.EventAttribute{
{Key: []byte("deposit"), Value: []byte("5"), Index: true},
{Key: []byte("unbond"), Value: []byte("10")},
{Key: "deposit", Value: "5", Index: true},
{Key: "unbond", Value: "10"},
},
},
},
@@ -191,15 +191,15 @@ func (s *eventsTestSuite) TestMarkEventsToIndex() {
{
Type: "message",
Attributes: []abci.EventAttribute{
{Key: []byte("sender"), Value: []byte("foo"), Index: true},
{Key: []byte("recipient"), Value: []byte("bar"), Index: true},
{Key: "sender", Value: "foo", Index: true},
{Key: "recipient", Value: "bar", Index: true},
},
},
{
Type: "staking",
Attributes: []abci.EventAttribute{
{Key: []byte("deposit"), Value: []byte("5"), Index: true},
{Key: []byte("unbond"), Value: []byte("10"), Index: true},
{Key: "deposit", Value: "5", Index: true},
{Key: "unbond", Value: "10", Index: true},
},
},
},
+6 -6
View File
@@ -12,7 +12,7 @@ import (
"sigs.k8s.io/yaml"
abci "github.com/tendermint/tendermint/abci/types"
ctypes "github.com/tendermint/tendermint/rpc/core/types"
"github.com/tendermint/tendermint/rpc/coretypes"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
@@ -63,7 +63,7 @@ func (logs ABCIMessageLogs) String() (str string) {
}
// NewResponseResultTx returns a TxResponse given a ResultTx from tendermint
func NewResponseResultTx(res *ctypes.ResultTx, anyTx *codectypes.Any, timestamp string) *TxResponse {
func NewResponseResultTx(res *coretypes.ResultTx, anyTx *codectypes.Any, timestamp string) *TxResponse {
if res == nil {
return nil
}
@@ -88,7 +88,7 @@ func NewResponseResultTx(res *ctypes.ResultTx, anyTx *codectypes.Any, timestamp
// NewResponseFormatBroadcastTxCommit returns a TxResponse given a
// ResultBroadcastTxCommit from tendermint.
func NewResponseFormatBroadcastTxCommit(res *ctypes.ResultBroadcastTxCommit) *TxResponse {
func NewResponseFormatBroadcastTxCommit(res *coretypes.ResultBroadcastTxCommit) *TxResponse {
if res == nil {
return nil
}
@@ -100,7 +100,7 @@ func NewResponseFormatBroadcastTxCommit(res *ctypes.ResultBroadcastTxCommit) *Tx
return newTxResponseDeliverTx(res)
}
func newTxResponseCheckTx(res *ctypes.ResultBroadcastTxCommit) *TxResponse {
func newTxResponseCheckTx(res *coretypes.ResultBroadcastTxCommit) *TxResponse {
if res == nil {
return nil
}
@@ -126,7 +126,7 @@ func newTxResponseCheckTx(res *ctypes.ResultBroadcastTxCommit) *TxResponse {
}
}
func newTxResponseDeliverTx(res *ctypes.ResultBroadcastTxCommit) *TxResponse {
func newTxResponseDeliverTx(res *coretypes.ResultBroadcastTxCommit) *TxResponse {
if res == nil {
return nil
}
@@ -153,7 +153,7 @@ func newTxResponseDeliverTx(res *ctypes.ResultBroadcastTxCommit) *TxResponse {
}
// NewResponseFormatBroadcastTx returns a TxResponse given a ResultBroadcastTx from tendermint
func NewResponseFormatBroadcastTx(res *ctypes.ResultBroadcastTx) *TxResponse {
func NewResponseFormatBroadcastTx(res *coretypes.ResultBroadcastTx) *TxResponse {
if res == nil {
return nil
}
+5 -5
View File
@@ -13,7 +13,7 @@ import (
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/bytes"
ctypes "github.com/tendermint/tendermint/rpc/core/types"
"github.com/tendermint/tendermint/rpc/coretypes"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
@@ -75,7 +75,7 @@ func (s *resultTestSuite) TestResponseResultTx() {
GasWanted: 100,
GasUsed: 90,
}
resultTx := &ctypes.ResultTx{
resultTx := &coretypes.ResultTx{
Hash: bytes.HexBytes([]byte("test")),
Height: 10,
TxResult: deliverTxResult,
@@ -116,7 +116,7 @@ func (s *resultTestSuite) TestResponseResultTx() {
s.Require().True(sdk.TxResponse{}.Empty())
s.Require().False(want.Empty())
resultBroadcastTx := &ctypes.ResultBroadcastTx{
resultBroadcastTx := &coretypes.ResultBroadcastTx{
Code: 1,
Codespace: "codespace",
Data: []byte("data"),
@@ -143,7 +143,7 @@ func (s *resultTestSuite) TestResponseFormatBroadcastTxCommit() {
s.Require().NoError(err)
// test checkTx
checkTxResult := &ctypes.ResultBroadcastTxCommit{
checkTxResult := &coretypes.ResultBroadcastTxCommit{
Height: 10,
Hash: bytes.HexBytes([]byte("test")),
CheckTx: abci.ResponseCheckTx{
@@ -156,7 +156,7 @@ func (s *resultTestSuite) TestResponseFormatBroadcastTxCommit() {
Codespace: "codespace",
},
}
deliverTxResult := &ctypes.ResultBroadcastTxCommit{
deliverTxResult := &coretypes.ResultBroadcastTxCommit{
Height: 10,
Hash: bytes.HexBytes([]byte("test")),
DeliverTx: abci.ResponseDeliverTx{