Really renames etc -> eyes... finish the job
This commit is contained in:
parent
3f6071da85
commit
2b1c4dd8b9
|
@ -20,7 +20,7 @@ func BuildApp() basecoin.Handler {
|
|||
).
|
||||
// We do this to demo real usage, also embeds it under it's own namespace
|
||||
Dispatch(
|
||||
stack.WrapHandler(etc.NewHandler()),
|
||||
stack.WrapHandler(eyes.NewHandler()),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import (
|
|||
rpccmd "github.com/tendermint/basecoin/client/commands/rpc"
|
||||
"github.com/tendermint/basecoin/client/commands/seeds"
|
||||
txcmd "github.com/tendermint/basecoin/client/commands/txs"
|
||||
etccmd "github.com/tendermint/basecoin/modules/eyes/commands"
|
||||
eyescmd "github.com/tendermint/basecoin/modules/eyes/commands"
|
||||
)
|
||||
|
||||
// EyesCli - main basecoin client command
|
||||
|
@ -34,7 +34,7 @@ func main() {
|
|||
query.TxQueryCmd,
|
||||
query.KeyQueryCmd,
|
||||
// this is our custom parser
|
||||
etccmd.EtcQueryCmd,
|
||||
eyescmd.EyesQueryCmd,
|
||||
)
|
||||
|
||||
// no middleware wrapers
|
||||
|
@ -43,8 +43,8 @@ func main() {
|
|||
|
||||
// just the etc commands
|
||||
txcmd.RootCmd.AddCommand(
|
||||
etccmd.SetTxCmd,
|
||||
etccmd.RemoveTxCmd,
|
||||
eyescmd.SetTxCmd,
|
||||
eyescmd.RemoveTxCmd,
|
||||
)
|
||||
|
||||
// Set up the various commands to use
|
||||
|
|
|
@ -14,15 +14,15 @@ import (
|
|||
"github.com/tendermint/basecoin/stack"
|
||||
)
|
||||
|
||||
// EtcQueryCmd - command to query raw data
|
||||
var EtcQueryCmd = &cobra.Command{
|
||||
Use: "etc [key]",
|
||||
Short: "Get data stored under key in etc",
|
||||
RunE: commands.RequireInit(etcQueryCmd),
|
||||
// EyesQueryCmd - command to query raw data
|
||||
var EyesQueryCmd = &cobra.Command{
|
||||
Use: "eyes [key]",
|
||||
Short: "Get data stored under key in eyes",
|
||||
RunE: commands.RequireInit(eyesQueryCmd),
|
||||
}
|
||||
|
||||
func etcQueryCmd(cmd *cobra.Command, args []string) error {
|
||||
var res etc.Data
|
||||
func eyesQueryCmd(cmd *cobra.Command, args []string) error {
|
||||
var res eyes.Data
|
||||
|
||||
arg, err := commands.GetOneArg(args, "key")
|
||||
if err != nil {
|
||||
|
@ -33,7 +33,7 @@ func etcQueryCmd(cmd *cobra.Command, args []string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
key = stack.PrefixedKey(etc.Name, key)
|
||||
key = stack.PrefixedKey(eyes.Name, key)
|
||||
prove := !viper.GetBool(commands.FlagTrustNode)
|
||||
height, err := query.GetParsed(key, &res, prove)
|
||||
if err != nil {
|
||||
|
|
|
@ -47,7 +47,7 @@ func setTxCmd(cmd *cobra.Command, args []string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
tx := etc.NewSetTx(key, value)
|
||||
tx := eyes.NewSetTx(key, value)
|
||||
return txs.DoTx(tx)
|
||||
}
|
||||
|
||||
|
@ -58,6 +58,6 @@ func removeTxCmd(cmd *cobra.Command, args []string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
tx := etc.NewRemoveTx(key)
|
||||
tx := eyes.NewRemoveTx(key)
|
||||
return txs.DoTx(tx)
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package etc
|
||||
package eyes
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package etc
|
||||
package eyes
|
||||
|
||||
import (
|
||||
"github.com/tendermint/basecoin"
|
||||
|
@ -9,7 +9,7 @@ import (
|
|||
|
||||
const (
|
||||
// Name of the module for registering it
|
||||
Name = "etc"
|
||||
Name = "eyes"
|
||||
|
||||
// CostSet is the gas needed for the set operation
|
||||
CostSet uint64 = 10
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package etc
|
||||
package eyes
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package etc
|
||||
package eyes
|
||||
|
||||
import "github.com/tendermint/go-wire/data"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package etc
|
||||
package eyes
|
||||
|
||||
import (
|
||||
"github.com/tendermint/basecoin"
|
||||
|
|
|
@ -40,7 +40,7 @@ test00SetGetRemove() {
|
|||
KEY="CAFE6000"
|
||||
VALUE="F00D4200"
|
||||
|
||||
assertFalse "line=${LINENO} data present" "${CLIENT_EXE} query etc ${KEY}"
|
||||
assertFalse "line=${LINENO} data present" "${CLIENT_EXE} query eyes ${KEY}"
|
||||
|
||||
# set data
|
||||
TXRES=$(${CLIENT_EXE} tx set --key=${KEY} --value=${VALUE})
|
||||
|
@ -49,7 +49,7 @@ test00SetGetRemove() {
|
|||
TX_HEIGHT=$(echo $TXRES | jq .height)
|
||||
|
||||
# make sure it is set
|
||||
DATA=$(${CLIENT_EXE} query etc ${KEY})
|
||||
DATA=$(${CLIENT_EXE} query eyes ${KEY})
|
||||
assertTrue "line=${LINENO} data not set" $?
|
||||
assertEquals "line=${LINENO}" "\"${VALUE}\"" $(echo $DATA | jq .data.value)
|
||||
|
||||
|
@ -58,7 +58,7 @@ test00SetGetRemove() {
|
|||
assertTrue "line=${LINENO}, found tx" $?
|
||||
if [ -n "$DEBUG" ]; then echo $TX; echo; fi
|
||||
|
||||
assertEquals "line=${LINENO}, proper type" "\"etc/set\"" $(echo $TX | jq .data.type)
|
||||
assertEquals "line=${LINENO}, proper type" "\"eyes/set\"" $(echo $TX | jq .data.type)
|
||||
assertEquals "line=${LINENO}, proper key" "\"${KEY}\"" $(echo $TX | jq .data.data.key)
|
||||
assertEquals "line=${LINENO}, proper value" "\"${VALUE}\"" $(echo $TX | jq .data.data.value)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue