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:
co-authored by
marbar3778
tycho garen
M. J. Fromberger
Amaury
Callum Waters
parent
3f368577ed
commit
af8ad3d20d
@@ -11,32 +11,26 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/version"
|
||||
|
||||
abcitypes "github.com/tendermint/tendermint/abci/types"
|
||||
|
||||
rosettatypes "github.com/coinbase/rosetta-sdk-go/types"
|
||||
"google.golang.org/grpc/metadata"
|
||||
|
||||
abcitypes "github.com/tendermint/tendermint/abci/types"
|
||||
tmrpc "github.com/tendermint/tendermint/rpc/client"
|
||||
"github.com/tendermint/tendermint/rpc/client/http"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/metadata"
|
||||
|
||||
crgerrs "github.com/cosmos/cosmos-sdk/server/rosetta/lib/errors"
|
||||
crgtypes "github.com/cosmos/cosmos-sdk/server/rosetta/lib/types"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
grpctypes "github.com/cosmos/cosmos-sdk/types/grpc"
|
||||
"github.com/cosmos/cosmos-sdk/version"
|
||||
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
|
||||
auth "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
bank "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
|
||||
tmrpc "github.com/tendermint/tendermint/rpc/client"
|
||||
)
|
||||
|
||||
// interface assertion
|
||||
var _ crgtypes.Client = (*Client)(nil)
|
||||
|
||||
const tmWebsocketPath = "/websocket"
|
||||
const defaultNodeTimeout = 15 * time.Second
|
||||
|
||||
// Client implements a single network client to interact with cosmos based chains
|
||||
@@ -104,7 +98,7 @@ func (c *Client) Bootstrap() error {
|
||||
return err
|
||||
}
|
||||
|
||||
tmRPC, err := http.New(c.config.TendermintRPC, tmWebsocketPath)
|
||||
tmRPC, err := http.New(c.config.TendermintRPC)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -501,18 +495,15 @@ func (c *Client) getHeight(ctx context.Context, height *int64) (realHeight *int6
|
||||
return
|
||||
}
|
||||
|
||||
var initialHeightRE = regexp.MustCompile(`"initial_height":"(\d+)"`)
|
||||
|
||||
func extractInitialHeightFromGenesisChunk(genesisChunk string) (int64, error) {
|
||||
firstChunk, err := base64.StdEncoding.DecodeString(genesisChunk)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
re, err := regexp.Compile("\"initial_height\":\"(\\d+)\"") //nolint:gocritic
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
matches := re.FindStringSubmatch(string(firstChunk))
|
||||
matches := initialHeightRE.FindStringSubmatch(string(firstChunk))
|
||||
if len(matches) != 2 {
|
||||
return 0, errors.New("failed to fetch initial_height")
|
||||
}
|
||||
|
||||
+14
-20
@@ -6,30 +6,24 @@ import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
auth "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec"
|
||||
tmcoretypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
|
||||
crgtypes "github.com/cosmos/cosmos-sdk/server/rosetta/lib/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
|
||||
"github.com/cosmos/cosmos-sdk/types/tx/signing"
|
||||
|
||||
rosettatypes "github.com/coinbase/rosetta-sdk-go/types"
|
||||
abci "github.com/tendermint/tendermint/abci/types"
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
tmcoretypes "github.com/tendermint/tendermint/rpc/coretypes"
|
||||
tmtypes "github.com/tendermint/tendermint/types"
|
||||
|
||||
crgerrs "github.com/cosmos/cosmos-sdk/server/rosetta/lib/errors"
|
||||
|
||||
sdkclient "github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
|
||||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
crgerrs "github.com/cosmos/cosmos-sdk/server/rosetta/lib/errors"
|
||||
crgtypes "github.com/cosmos/cosmos-sdk/server/rosetta/lib/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/tx/signing"
|
||||
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
|
||||
auth "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
)
|
||||
|
||||
@@ -345,11 +339,11 @@ func sdkEventToBalanceOperations(status string, event abci.Event) (operations []
|
||||
default:
|
||||
return nil, false
|
||||
case banktypes.EventTypeCoinSpent:
|
||||
spender, err := sdk.AccAddressFromBech32((string)(event.Attributes[0].Value))
|
||||
spender, err := sdk.AccAddressFromBech32(event.Attributes[0].Value)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
coins, err := sdk.ParseCoinsNormalized((string)(event.Attributes[1].Value))
|
||||
coins, err := sdk.ParseCoinsNormalized(event.Attributes[1].Value)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -359,11 +353,11 @@ func sdkEventToBalanceOperations(status string, event abci.Event) (operations []
|
||||
accountIdentifier = spender.String()
|
||||
|
||||
case banktypes.EventTypeCoinReceived:
|
||||
receiver, err := sdk.AccAddressFromBech32((string)(event.Attributes[0].Value))
|
||||
receiver, err := sdk.AccAddressFromBech32(event.Attributes[0].Value)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
coins, err := sdk.ParseCoinsNormalized((string)(event.Attributes[1].Value))
|
||||
coins, err := sdk.ParseCoinsNormalized(event.Attributes[1].Value)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -375,7 +369,7 @@ func sdkEventToBalanceOperations(status string, event abci.Event) (operations []
|
||||
// rosetta does not have the concept of burning coins, so we need to mock
|
||||
// the burn as a send to an address that cannot be resolved to anything
|
||||
case banktypes.EventTypeCoinBurn:
|
||||
coins, err := sdk.ParseCoinsNormalized((string)(event.Attributes[1].Value))
|
||||
coins, err := sdk.ParseCoinsNormalized(event.Attributes[1].Value)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -571,9 +565,9 @@ func (c converter) Peers(peers []tmcoretypes.Peer) []*rosettatypes.Peer {
|
||||
|
||||
for i, peer := range peers {
|
||||
converted[i] = &rosettatypes.Peer{
|
||||
PeerID: peer.NodeInfo.Moniker,
|
||||
PeerID: string(peer.ID),
|
||||
Metadata: map[string]interface{}{
|
||||
"addr": peer.NodeInfo.ListenAddr,
|
||||
"addr": peer.URL,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user