From 1d4bb1a86387b1722d8b744149c126cfad236eb5 Mon Sep 17 00:00:00 2001 From: Alexander Bezobchuk Date: Mon, 11 Feb 2019 02:28:23 -0800 Subject: [PATCH] Merge PR #3591: Fix setting tx hash when nil * fix setting the tx hash when nil * add a pending log entry --- PENDING.md | 1 + types/result.go | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) 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,