mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-28 12:11:44 +00:00
get_hash -> commit; printResponse improvement
This commit is contained in:
@ -80,8 +80,8 @@ func main() {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "get_hash",
|
Name: "commit",
|
||||||
Usage: "Get application Merkle root hash",
|
Usage: "Commit the application state and return the Merkle root hash",
|
||||||
Action: func(c *cli.Context) {
|
Action: func(c *cli.Context) {
|
||||||
cmdCommit(c)
|
cmdCommit(c)
|
||||||
},
|
},
|
||||||
@ -283,20 +283,20 @@ func cmdQuery(c *cli.Context) {
|
|||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
|
|
||||||
func printResponse(res *types.Response, s string) {
|
func printResponse(res *types.Response, s string) {
|
||||||
fmt.Printf("-> ")
|
switch res.Type {
|
||||||
if res.Error != "" {
|
case types.MessageType_AppendTx, types.MessageType_CheckTx, types.MessageType_Query:
|
||||||
fmt.Printf("error: %s\t", res.Error)
|
fmt.Printf("-> code: %s\n", res.Code.String())
|
||||||
}
|
}
|
||||||
if res.Code != types.CodeType_OK {
|
if res.Error != "" {
|
||||||
fmt.Printf("code: %s", res.Code.String())
|
fmt.Printf("-> error: %s\n", res.Error)
|
||||||
}
|
}
|
||||||
if s != "" {
|
if s != "" {
|
||||||
fmt.Printf("data: {%s}", s)
|
fmt.Printf("-> data: {%s}\n", s)
|
||||||
}
|
}
|
||||||
if res.Log != "" {
|
if res.Log != "" {
|
||||||
fmt.Printf("log: %s", res.Log)
|
fmt.Printf("-> log: %s\n", res.Log)
|
||||||
}
|
}
|
||||||
fmt.Printf("\n")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func responseString(res *types.Response) string {
|
func responseString(res *types.Response) string {
|
||||||
|
Reference in New Issue
Block a user