Query: LastHeight -> Height :)

This commit is contained in:
Ethan Buchman
2017-02-14 16:53:21 -05:00
parent 2a3f638495
commit 31bdda27ad
6 changed files with 161 additions and 166 deletions

View File

@ -17,13 +17,13 @@ import (
// Structure for data passed to print response.
type response struct {
Data []byte
Code types.CodeType
Key []byte
Value []byte
Log string
LastHeight string
Proof []byte
Data []byte
Code types.CodeType
Key []byte
Value []byte
Log string
Height string
Proof []byte
}
// client is a global variable so it can be reused by the console
@ -299,20 +299,20 @@ func cmdQuery(c *cli.Context) error {
return err
}
resQuery, err := client.QuerySync(types.RequestQuery{
Data: queryBytes,
Path: "/store", // TOOD expose
LastHeight: 0, // TODO expose
Data: queryBytes,
Path: "/store", // TOOD expose
Height: 0, // TODO expose
//Prove: true, // TODO expose
})
if err != nil {
return err
}
printResponse(c, response{
Code: resQuery.Code,
Key: resQuery.Key,
Value: resQuery.Value,
Log: resQuery.Log,
LastHeight: fmt.Sprintf("%v", resQuery.LastHeight),
Code: resQuery.Code,
Key: resQuery.Key,
Value: resQuery.Value,
Log: resQuery.Log,
Height: fmt.Sprintf("%v", resQuery.Height),
//Proof: resQuery.Proof,
})
return nil
@ -346,8 +346,8 @@ func printResponse(c *cli.Context, rsp response) {
if rsp.Log != "" {
fmt.Printf("-> log: %s\n", rsp.Log)
}
if rsp.LastHeight != "" {
fmt.Printf("-> height: %s\n", rsp.LastHeight)
if rsp.Height != "" {
fmt.Printf("-> height: %s\n", rsp.Height)
}
if rsp.Proof != nil {
fmt.Printf("-> proof: %X\n", rsp.Proof)