Skip to content

Commit

Permalink
test: fixed - get simulation error from sync mode
Browse files Browse the repository at this point in the history
  • Loading branch information
psy2848048 committed Mar 20, 2023
1 parent 06fa314 commit 1a8f522
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion integration_test/wallet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package integrationtest
import (
"context"
"encoding/json"
"fmt"
"os"
"sync"

Expand Down Expand Up @@ -152,7 +153,7 @@ func (w *WalletInfo) SendTx(fee types.Coin, gasLimit int64, msg ...types.Msg) (s
return "", err
}

txHash, err := BroadcastTx(desc.ServiceConn, w.ChainId, txBytes, txtype.BroadcastMode_BROADCAST_MODE_ASYNC)
txHash, err := BroadcastTx(desc.ServiceConn, w.ChainId, txBytes, txtype.BroadcastMode_BROADCAST_MODE_SYNC)
if err != nil {
err = errors.Wrap(err, "SendTx, tx broadcast")
return "", err
Expand Down Expand Up @@ -249,6 +250,11 @@ func BroadcastTx(conn *grpc.ClientConn, chainId string, txBytes []byte, mode txt
return "", err
}

// if the tx works well in the sync mode, it returns as "[]"
if res.TxResponse.RawLog != "[]" {
return "", fmt.Errorf(res.TxResponse.RawLog)
}

return res.TxResponse.TxHash, nil
}

Expand Down

0 comments on commit 1a8f522

Please sign in to comment.