mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-06 16:17:11 +00:00
Begin adding proof calls
This commit is contained in:
@@ -131,6 +131,13 @@ func main() {
|
||||
return cmdQuery(c)
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "proof",
|
||||
Usage: "Get proof for a key",
|
||||
Action: func(c *cli.Context) error {
|
||||
return cmdProof(c)
|
||||
},
|
||||
},
|
||||
}
|
||||
app.Before = before
|
||||
err := app.Run(os.Args)
|
||||
@@ -305,6 +312,18 @@ func cmdQuery(c *cli.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Prove application state
|
||||
func cmdProof(c *cli.Context) error {
|
||||
args := c.Args()
|
||||
if len(args) != 1 {
|
||||
return errors.New("Command proof takes 1 argument")
|
||||
}
|
||||
keyBytes := stringOrHexToBytes(c.Args()[0])
|
||||
res := client.ProofSync(keyBytes)
|
||||
printResponse(c, res, string(res.Data), true)
|
||||
return nil
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
|
||||
func printResponse(c *cli.Context, rsp *response) {
|
||||
|
||||
Reference in New Issue
Block a user