Renamed client/commands/proofs to client/commands/query
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
lc "github.com/tendermint/light-client"
|
||||
|
||||
"github.com/tendermint/basecoin/client/commands"
|
||||
proofcmd "github.com/tendermint/basecoin/client/commands/proofs"
|
||||
"github.com/tendermint/basecoin/client/commands/query"
|
||||
"github.com/tendermint/basecoin/modules/coin"
|
||||
"github.com/tendermint/basecoin/stack"
|
||||
)
|
||||
@@ -34,12 +34,12 @@ func accountQueryCmd(cmd *cobra.Command, args []string) error {
|
||||
|
||||
acc := coin.Account{}
|
||||
prove := !viper.GetBool(commands.FlagTrustNode)
|
||||
height, err := proofcmd.GetParsed(key, &acc, prove)
|
||||
height, err := query.GetParsed(key, &acc, prove)
|
||||
if lc.IsNoDataErr(err) {
|
||||
return errors.Errorf("Account bytes are empty for address %s ", addr)
|
||||
} else if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return proofcmd.OutputProof(acc, height)
|
||||
return query.OutputProof(acc, height)
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
"github.com/tendermint/basecoin"
|
||||
"github.com/tendermint/basecoin/client/commands"
|
||||
"github.com/tendermint/basecoin/client/commands/proofs"
|
||||
"github.com/tendermint/basecoin/client/commands/query"
|
||||
"github.com/tendermint/basecoin/modules/auth"
|
||||
"github.com/tendermint/basecoin/modules/base"
|
||||
"github.com/tendermint/basecoin/modules/coin"
|
||||
@@ -38,8 +38,8 @@ type SendInput struct {
|
||||
// doQueryAccount is the HTTP handlerfunc to query an account
|
||||
// It expects a query string with
|
||||
func doQueryAccount(w http.ResponseWriter, r *http.Request) {
|
||||
query := mux.Vars(r)
|
||||
signature := query["signature"]
|
||||
args := mux.Vars(r)
|
||||
signature := args["signature"]
|
||||
actor, err := commands.ParseActor(signature)
|
||||
if err != nil {
|
||||
common.WriteError(w, err)
|
||||
@@ -49,7 +49,7 @@ func doQueryAccount(w http.ResponseWriter, r *http.Request) {
|
||||
key := stack.PrefixedKey(coin.NameCoin, actor.Bytes())
|
||||
account := new(coin.Account)
|
||||
prove := !viper.GetBool(commands.FlagTrustNode)
|
||||
height, err := proofs.GetParsed(key, account, prove)
|
||||
height, err := query.GetParsed(key, account, prove)
|
||||
if lightclient.IsNoDataErr(err) {
|
||||
err := fmt.Errorf("account bytes are empty for address: %q", signature)
|
||||
common.WriteError(w, err)
|
||||
@@ -59,7 +59,7 @@ func doQueryAccount(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if err := proofs.FoutputProof(w, account, height); err != nil {
|
||||
if err := query.FoutputProof(w, account, height); err != nil {
|
||||
common.WriteError(w, err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"github.com/tendermint/basecoin/client/commands"
|
||||
proofcmd "github.com/tendermint/basecoin/client/commands/proofs"
|
||||
"github.com/tendermint/basecoin/client/commands/query"
|
||||
"github.com/tendermint/basecoin/modules/ibc"
|
||||
"github.com/tendermint/basecoin/stack"
|
||||
wire "github.com/tendermint/go-wire"
|
||||
@@ -86,18 +86,18 @@ func ibcQueryCmd(cmd *cobra.Command, args []string) error {
|
||||
var res ibc.HandlerInfo
|
||||
key := stack.PrefixedKey(ibc.NameIBC, ibc.HandlerKey())
|
||||
prove := !viper.GetBool(commands.FlagTrustNode)
|
||||
h, err := proofcmd.GetParsed(key, &res, prove)
|
||||
h, err := query.GetParsed(key, &res, prove)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return proofcmd.OutputProof(res, h)
|
||||
return query.OutputProof(res, h)
|
||||
}
|
||||
|
||||
func chainsQueryCmd(cmd *cobra.Command, args []string) error {
|
||||
list := [][]byte{}
|
||||
key := stack.PrefixedKey(ibc.NameIBC, ibc.ChainsKey())
|
||||
prove := !viper.GetBool(commands.FlagTrustNode)
|
||||
h, err := proofcmd.GetParsed(key, &list, prove)
|
||||
h, err := query.GetParsed(key, &list, prove)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -108,7 +108,7 @@ func chainsQueryCmd(cmd *cobra.Command, args []string) error {
|
||||
res[i] = string(list[i])
|
||||
}
|
||||
|
||||
return proofcmd.OutputProof(res, h)
|
||||
return query.OutputProof(res, h)
|
||||
}
|
||||
|
||||
func chainQueryCmd(cmd *cobra.Command, args []string) error {
|
||||
@@ -120,12 +120,12 @@ func chainQueryCmd(cmd *cobra.Command, args []string) error {
|
||||
var res ibc.ChainInfo
|
||||
key := stack.PrefixedKey(ibc.NameIBC, ibc.ChainKey(arg))
|
||||
prove := !viper.GetBool(commands.FlagTrustNode)
|
||||
h, err := proofcmd.GetParsed(key, &res, prove)
|
||||
h, err := query.GetParsed(key, &res, prove)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return proofcmd.OutputProof(res, h)
|
||||
return query.OutputProof(res, h)
|
||||
}
|
||||
|
||||
func assertOne(from, to string) error {
|
||||
@@ -157,12 +157,12 @@ func packetsQueryCmd(cmd *cobra.Command, args []string) error {
|
||||
|
||||
var res uint64
|
||||
prove := !viper.GetBool(commands.FlagTrustNode)
|
||||
h, err := proofcmd.GetParsed(key, &res, prove)
|
||||
h, err := query.GetParsed(key, &res, prove)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return proofcmd.OutputProof(res, h)
|
||||
return query.OutputProof(res, h)
|
||||
}
|
||||
|
||||
func packetQueryCmd(cmd *cobra.Command, args []string) error {
|
||||
@@ -189,15 +189,15 @@ func packetQueryCmd(cmd *cobra.Command, args []string) error {
|
||||
// Input queue just display the results
|
||||
var packet ibc.Packet
|
||||
if from != "" {
|
||||
h, err := proofcmd.GetParsed(key, &packet, prove)
|
||||
h, err := query.GetParsed(key, &packet, prove)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return proofcmd.OutputProof(packet, h)
|
||||
return query.OutputProof(packet, h)
|
||||
}
|
||||
|
||||
// output queue, create a post packet
|
||||
bs, height, proof, err := proofcmd.GetWithProof(key)
|
||||
bs, height, proof, err := query.GetWithProof(key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
"github.com/tendermint/basecoin"
|
||||
"github.com/tendermint/basecoin/client/commands"
|
||||
proofcmd "github.com/tendermint/basecoin/client/commands/proofs"
|
||||
"github.com/tendermint/basecoin/client/commands/query"
|
||||
"github.com/tendermint/basecoin/modules/nonce"
|
||||
"github.com/tendermint/basecoin/stack"
|
||||
)
|
||||
@@ -39,13 +39,13 @@ func nonceQueryCmd(cmd *cobra.Command, args []string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
return proofcmd.OutputProof(seq, height)
|
||||
return query.OutputProof(seq, height)
|
||||
}
|
||||
|
||||
func doNonceQuery(signers []basecoin.Actor) (sequence uint32, height uint64, err error) {
|
||||
key := stack.PrefixedKey(nonce.NameNonce, nonce.GetSeqKey(signers))
|
||||
prove := !viper.GetBool(commands.FlagTrustNode)
|
||||
height, err = proofcmd.GetParsed(key, &sequence, prove)
|
||||
height, err = query.GetParsed(key, &sequence, prove)
|
||||
if lc.IsNoDataErr(err) {
|
||||
// no data, return sequence 0
|
||||
return 0, 0, nil
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"github.com/tendermint/basecoin/client/commands"
|
||||
proofcmd "github.com/tendermint/basecoin/client/commands/proofs"
|
||||
"github.com/tendermint/basecoin/client/commands/query"
|
||||
"github.com/tendermint/basecoin/modules/roles"
|
||||
"github.com/tendermint/basecoin/stack"
|
||||
)
|
||||
@@ -30,10 +30,10 @@ func roleQueryCmd(cmd *cobra.Command, args []string) error {
|
||||
var res roles.Role
|
||||
key := stack.PrefixedKey(roles.NameRole, role)
|
||||
prove := !viper.GetBool(commands.FlagTrustNode)
|
||||
height, err := proofcmd.GetParsed(key, &res, prove)
|
||||
height, err := query.GetParsed(key, &res, prove)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return proofcmd.OutputProof(res, height)
|
||||
return query.OutputProof(res, height)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user