Merge PR #2266: Fix CLI commands JSON output

When running with --json, commands should produce
correctly JSON-encoded output.
This commit is contained in:
Alessio Treglia
2018-09-08 16:33:55 +08:00
committed by Christopher Goes
parent c800bc7a1a
commit f68e5a7542
3 changed files with 14 additions and 3 deletions
+2 -2
View File
@@ -255,11 +255,11 @@ func (ctx CLIContext) ensureBroadcastTx(txBytes []byte) error {
type toJSON struct {
Height int64
TxHash string
Response string
Response abci.ResponseDeliverTx
}
if ctx.Logger != nil {
resJSON := toJSON{res.Height, res.Hash.String(), fmt.Sprintf("%+v", res.DeliverTx)}
resJSON := toJSON{res.Height, res.Hash.String(), res.DeliverTx}
bz, err := ctx.Codec.MarshalJSON(resJSON)
if err != nil {
return err