diff --git a/PENDING.md b/PENDING.md index 164614789df8..9ca861b10e0b 100644 --- a/PENDING.md +++ b/PENDING.md @@ -45,6 +45,7 @@ BUG FIXES * Gaia CLI * Gaia + * [\#3585] Fix setting the tx hash in `NewResponseFormatBroadcastTxCommit`. * SDK diff --git a/types/result.go b/types/result.go index 6d96dd46a9f4..c5dcd163ad85 100644 --- a/types/result.go +++ b/types/result.go @@ -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,