Update cli to properly query into app state-space

This commit is contained in:
Ethan Frey
2017-07-11 15:35:43 +02:00
parent 66d1f86098
commit bb61b9fca3
5 changed files with 27 additions and 24 deletions
@@ -6,6 +6,7 @@ import (
proofcmd "github.com/tendermint/light-client/commands/proofs"
"github.com/tendermint/basecoin/docs/guide/counter/plugins/counter"
"github.com/tendermint/basecoin/stack"
)
//CounterQueryCmd - CLI command to query the counter state
@@ -16,7 +17,7 @@ var CounterQueryCmd = &cobra.Command{
}
func counterQueryCmd(cmd *cobra.Command, args []string) error {
key := counter.StateKey()
key := stack.PrefixedKey(counter.NameCounter, counter.StateKey())
var cp counter.State
proof, err := proofcmd.GetAndParseAppProof(key, &cp)
@@ -195,7 +195,7 @@ type State struct {
// StateKey - store key for the counter state
func StateKey() []byte {
return []byte(NameCounter + "/state")
return []byte("state")
}
// LoadState - retrieve the counter state from the store