One step for module eyes commands compiling
This commit is contained in:
parent
4bff480440
commit
5efbbc3237
|
@ -11,7 +11,7 @@ import (
|
|||
"github.com/cosmos/cosmos-sdk/client/commands"
|
||||
"github.com/cosmos/cosmos-sdk/client/commands/query"
|
||||
"github.com/cosmos/cosmos-sdk/modules/eyes"
|
||||
"github.com/cosmos/cosmos-sdk/stack"
|
||||
"github.com/cosmos/cosmos-sdk/util"
|
||||
)
|
||||
|
||||
// EyesQueryCmd - command to query raw data
|
||||
|
@ -33,7 +33,7 @@ func eyesQueryCmd(cmd *cobra.Command, args []string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
key = stack.PrefixedKey(eyes.Name, key)
|
||||
key = util.PrefixedKey(eyes.Name, key)
|
||||
prove := !viper.GetBool(commands.FlagTrustNode)
|
||||
height, err := query.GetParsed(key, &res, query.GetHeight(), prove)
|
||||
if err != nil {
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
package util
|
||||
|
||||
// PrefixedKey returns the absolute path to a given key in a particular
|
||||
// app's state-space
|
||||
//
|
||||
// This is useful for to set up queries for this particular app data
|
||||
func PrefixedKey(app string, key []byte) []byte {
|
||||
prefix := append([]byte(app), byte(0))
|
||||
return append(prefix, key...)
|
||||
}
|
Loading…
Reference in New Issue