Validate --name

This commit is contained in:
Alessio Treglia 2018-10-22 17:51:46 -07:00
parent e65c02dd42
commit 31c062689d
No known key found for this signature in database
GPG Key ID: E8A48AE5311D765A
1 changed files with 4 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package cli
import (
"fmt"
"github.com/pkg/errors"
"github.com/spf13/viper"
"io/ioutil"
@ -62,6 +63,9 @@ func makeSignCmd(cdc *amino.Codec, decoder auth.AccountDecoder) func(cmd *cobra.
}
name := viper.GetString(client.FlagName)
if name == "" {
return errors.New("required flag \"name\" has not been set")
}
cliCtx := context.NewCLIContext().WithCodec(cdc).WithAccountDecoder(decoder)
txBldr := authtxb.NewTxBuilderFromCLI()