Update cli to properly query into app state-space
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user