Skip to content

Commit

Permalink
Merge PR #3591: Fix setting tx hash when nil
Browse files Browse the repository at this point in the history
* fix setting the tx hash when nil
* add a pending log entry
  • Loading branch information
alexanderbez authored and cwgoes committed Feb 11, 2019
1 parent ed2b427 commit 1d4bb1a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ BUG FIXES
* Gaia CLI

* Gaia
* [\#3585] Fix setting the tx hash in `NewResponseFormatBroadcastTxCommit`.

* SDK

Expand Down
7 changes: 6 additions & 1 deletion types/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,14 @@ func NewResponseResultTx(res *ctypes.ResultTx, tx Tx) TxResponse {
}

func NewResponseFormatBroadcastTxCommit(res *ctypes.ResultBroadcastTxCommit) TxResponse {
var txHash string
if res.Hash != nil {
txHash = res.Hash.String()
}

return TxResponse{
Height: res.Height,
TxHash: res.Hash.String(),
TxHash: txHash,
Code: res.DeliverTx.Code,
Data: res.DeliverTx.Data,
Log: res.DeliverTx.Log,
Expand Down

0 comments on commit 1d4bb1a

Please sign in to comment.