This commit is contained in:
committed by
Christopher Goes
parent
157047c8a3
commit
ec2fedd36c
@@ -30,12 +30,12 @@ func (ctx CoreContext) BroadcastTx(tx []byte) (*ctypes.ResultBroadcastTxCommit,
|
||||
}
|
||||
|
||||
if res.CheckTx.Code != uint32(0) {
|
||||
return res, errors.Errorf("CheckTx failed: (%d) %s",
|
||||
return res, errors.Errorf("checkTx failed: (%d) %s",
|
||||
res.CheckTx.Code,
|
||||
res.CheckTx.Log)
|
||||
}
|
||||
if res.DeliverTx.Code != uint32(0) {
|
||||
return res, errors.Errorf("DeliverTx failed: (%d) %s",
|
||||
return res, errors.Errorf("deliverTx failed: (%d) %s",
|
||||
res.DeliverTx.Code,
|
||||
res.DeliverTx.Log)
|
||||
}
|
||||
@@ -75,7 +75,7 @@ func (ctx CoreContext) query(key cmn.HexBytes, storeName, endPath string) (res [
|
||||
}
|
||||
resp := result.Response
|
||||
if resp.Code != uint32(0) {
|
||||
return res, errors.Errorf("Query failed: (%d) %s", resp.Code, resp.Log)
|
||||
return res, errors.Errorf("query failed: (%d) %s", resp.Code, resp.Log)
|
||||
}
|
||||
return resp.Value, nil
|
||||
}
|
||||
@@ -95,7 +95,7 @@ func (ctx CoreContext) GetFromAddress() (from sdk.Address, err error) {
|
||||
|
||||
info, err := keybase.Get(name)
|
||||
if err != nil {
|
||||
return nil, errors.Errorf("No key for: %s", name)
|
||||
return nil, errors.Errorf("no key for: %s", name)
|
||||
}
|
||||
|
||||
return info.PubKey.Address(), nil
|
||||
@@ -107,7 +107,7 @@ func (ctx CoreContext) SignAndBuild(name, passphrase string, msg sdk.Msg, cdc *w
|
||||
// build the Sign Messsage from the Standard Message
|
||||
chainID := ctx.ChainID
|
||||
if chainID == "" {
|
||||
return nil, errors.Errorf("Chain ID required but not specified")
|
||||
return nil, errors.Errorf("chain ID required but not specified")
|
||||
}
|
||||
accnum := ctx.AccountNumber
|
||||
sequence := ctx.Sequence
|
||||
@@ -174,7 +174,7 @@ func (ctx CoreContext) EnsureSignBuildBroadcast(name string, msg sdk.Msg, cdc *w
|
||||
// get the next sequence for the account address
|
||||
func (ctx CoreContext) GetAccountNumber(address []byte) (int64, error) {
|
||||
if ctx.Decoder == nil {
|
||||
return 0, errors.New("AccountDecoder required but not provided")
|
||||
return 0, errors.New("accountDecoder required but not provided")
|
||||
}
|
||||
|
||||
res, err := ctx.Query(auth.AddressStoreKey(address), ctx.AccountStore)
|
||||
@@ -198,7 +198,7 @@ func (ctx CoreContext) GetAccountNumber(address []byte) (int64, error) {
|
||||
// get the next sequence for the account address
|
||||
func (ctx CoreContext) NextSequence(address []byte) (int64, error) {
|
||||
if ctx.Decoder == nil {
|
||||
return 0, errors.New("AccountDecoder required but not provided")
|
||||
return 0, errors.New("accountDecoder required but not provided")
|
||||
}
|
||||
|
||||
res, err := ctx.Query(auth.AddressStoreKey(address), ctx.AccountStore)
|
||||
@@ -229,7 +229,7 @@ func (ctx CoreContext) GetPassphraseFromStdin(name string) (pass string, err err
|
||||
// GetNode prepares a simple rpc.Client
|
||||
func (ctx CoreContext) GetNode() (rpcclient.Client, error) {
|
||||
if ctx.Client == nil {
|
||||
return nil, errors.New("Must define node URI")
|
||||
return nil, errors.New("must define node URI")
|
||||
}
|
||||
return ctx.Client, nil
|
||||
}
|
||||
|
||||
+2
-2
@@ -32,7 +32,7 @@ func GetPassword(prompt string, buf *bufio.Reader) (pass string, err error) {
|
||||
return "", err
|
||||
}
|
||||
if len(pass) < MinPassLength {
|
||||
return "", errors.Errorf("Password must be at least %d characters", MinPassLength)
|
||||
return "", errors.Errorf("password must be at least %d characters", MinPassLength)
|
||||
}
|
||||
return pass, nil
|
||||
}
|
||||
@@ -68,7 +68,7 @@ func GetCheckPassword(prompt, prompt2 string, buf *bufio.Reader) (string, error)
|
||||
return "", err
|
||||
}
|
||||
if pass != pass2 {
|
||||
return "", errors.New("Passphrases don't match")
|
||||
return "", errors.New("passphrases don't match")
|
||||
}
|
||||
return pass, nil
|
||||
}
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ func runAddCmd(cmd *cobra.Command, args []string) error {
|
||||
name = "inmemorykey"
|
||||
} else {
|
||||
if len(args) != 1 || len(args[0]) == 0 {
|
||||
return errors.New("You must provide a name for the key")
|
||||
return errors.New("you must provide a name for the key")
|
||||
}
|
||||
name = args[0]
|
||||
kb, err = GetKeyBase()
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ func ServeCommand(cdc *wire.Codec) *cobra.Command {
|
||||
// Wait forever and cleanup
|
||||
cmn.TrapSignal(func() {
|
||||
err := listener.Close()
|
||||
logger.Error("Error closing listener", "err", err)
|
||||
logger.Error("error closing listener", "err", err)
|
||||
})
|
||||
return nil
|
||||
},
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ const (
|
||||
|
||||
// XXX: remove this when not needed
|
||||
func todoNotImplemented(_ *cobra.Command, _ []string) error {
|
||||
return errors.New("TODO: Command not yet implemented")
|
||||
return errors.New("todo: Command not yet implemented")
|
||||
}
|
||||
|
||||
// AddCommands adds a number of rpc-related subcommands
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ func SearchTxCmd(cdc *wire.Codec) *cobra.Command {
|
||||
|
||||
func searchTxs(ctx context.CoreContext, cdc *wire.Codec, tags []string) ([]txInfo, error) {
|
||||
if len(tags) == 0 {
|
||||
return nil, errors.New("Must declare at least one tag to search")
|
||||
return nil, errors.New("must declare at least one tag to search")
|
||||
}
|
||||
// XXX: implement ANY
|
||||
query := strings.Join(tags, " AND ")
|
||||
|
||||
Reference in New Issue
Block a user