From ed393f9934c0c78d098b4935814582370a1efd4f Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 17:49:53 -0500 Subject: [PATCH] abci-cli: print OK if code is 0 --- CHANGELOG.md | 1 + cmd/abci-cli/abci-cli.go | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28dd29473..8dba7032b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ BREAKING CHANGES: - [types] switched to using `gogo/protobuf` for code generation - [types] use `customtype` feature of `gogo/protobuf` to replace `[]byte` with `data.Bytes` in all generated types :) - this eliminates the need for additional types like ResultQuery + - [abci-cli] codes are printed as their number instead of a message, except for `code == 0`, which is still printed as `OK` FEATURES: - [types] added Tags field to ResponseDeliverTx diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index 25786b377..ef8b90635 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -516,7 +516,12 @@ func printResponse(cmd *cobra.Command, args []string, rsp response) { } // Always print the status code. - fmt.Printf("-> code: %d\n", rsp.Code) + if rsp.Code == types.CodeTypeOK { + fmt.Printf("-> code: OK\n") + } else { + fmt.Printf("-> code: %d\n", rsp.Code) + + } if len(rsp.Data) != 0 { // Do no print this line when using the commit command