chore: downgrade to tendermint v0.34.x (#12958)
This commit is contained in:
@@ -37,7 +37,10 @@ import (
|
||||
// interface assertion
|
||||
var _ crgtypes.Client = (*Client)(nil)
|
||||
|
||||
const defaultNodeTimeout = time.Minute
|
||||
const (
|
||||
defaultNodeTimeout = time.Minute
|
||||
tmWebsocketPath = "/websocket"
|
||||
)
|
||||
|
||||
// Client implements a single network client to interact with cosmos based chains
|
||||
type Client struct {
|
||||
@@ -104,7 +107,7 @@ func (c *Client) Bootstrap() error {
|
||||
return err
|
||||
}
|
||||
|
||||
tmRPC, err := http.New(c.config.TendermintRPC)
|
||||
tmRPC, err := http.New(c.config.TendermintRPC, tmWebsocketPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
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"
|
||||
tmcoretypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
tmtypes "github.com/tendermint/tendermint/types"
|
||||
|
||||
sdkclient "github.com/cosmos/cosmos-sdk/client"
|
||||
@@ -338,8 +338,8 @@ func sdkEventToBalanceOperations(status string, event abci.Event) (operations []
|
||||
default:
|
||||
return nil, false
|
||||
case banktypes.EventTypeCoinSpent:
|
||||
spender := sdk.MustAccAddressFromBech32(event.Attributes[0].Value)
|
||||
coins, err := sdk.ParseCoinsNormalized(event.Attributes[1].Value)
|
||||
spender := sdk.MustAccAddressFromBech32(string(event.Attributes[0].Value))
|
||||
coins, err := sdk.ParseCoinsNormalized(string(event.Attributes[1].Value))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -349,8 +349,8 @@ func sdkEventToBalanceOperations(status string, event abci.Event) (operations []
|
||||
accountIdentifier = spender.String()
|
||||
|
||||
case banktypes.EventTypeCoinReceived:
|
||||
receiver := sdk.MustAccAddressFromBech32(event.Attributes[0].Value)
|
||||
coins, err := sdk.ParseCoinsNormalized(event.Attributes[1].Value)
|
||||
receiver := sdk.MustAccAddressFromBech32(string(event.Attributes[0].Value))
|
||||
coins, err := sdk.ParseCoinsNormalized(string(event.Attributes[1].Value))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -362,7 +362,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(event.Attributes[1].Value)
|
||||
coins, err := sdk.ParseCoinsNormalized(string(event.Attributes[1].Value))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -558,9 +558,9 @@ func (c converter) Peers(peers []tmcoretypes.Peer) []*rosettatypes.Peer {
|
||||
|
||||
for i, peer := range peers {
|
||||
converted[i] = &rosettatypes.Peer{
|
||||
PeerID: string(peer.ID),
|
||||
PeerID: peer.NodeInfo.Moniker,
|
||||
Metadata: map[string]interface{}{
|
||||
"addr": peer.URL,
|
||||
"addr": peer.NodeInfo.ListenAddr,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user