Skip to content

Commit

Permalink
Merge branch 'master' into hulatown/adr-043-nft
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Jun 7, 2021
2 parents 0849698 + 069514e commit ccb2807
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"strings"

"github.com/tendermint/tendermint/crypto/tmhash"
"github.com/tendermint/tendermint/mempool"
tmtypes "github.com/tendermint/tendermint/types"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

Expand Down Expand Up @@ -46,13 +46,13 @@ func (ctx Context) BroadcastTx(txBytes []byte) (res *sdk.TxResponse, err error)
// TODO: Avoid brittle string matching in favor of error matching. This requires
// a change to Tendermint's RPCError type to allow retrieval or matching against
// a concrete error type.
func CheckTendermintError(err error, txBytes []byte) *sdk.TxResponse {
func CheckTendermintError(err error, tx tmtypes.Tx) *sdk.TxResponse {
if err == nil {
return nil
}

errStr := strings.ToLower(err.Error())
txHash := fmt.Sprintf("%X", tmhash.Sum(txBytes))
txHash := fmt.Sprintf("%X", tx.Hash())

switch {
case strings.Contains(errStr, strings.ToLower(mempool.ErrTxInCache.Error())):
Expand Down

0 comments on commit ccb2807

Please sign in to comment.