Add --no-sign flag

This commit is contained in:
Ethan Frey
2017-07-27 15:42:09 -04:00
parent 761fb0d0c6
commit e242f30aeb
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -92,6 +92,11 @@ func SignTx(tx basecoin.Tx) error {
return err
}
// abort early if we don't want to sign
if viper.GetBool(FlagNoSign) {
return nil
}
name := viper.GetString(FlagName)
manager := keycmd.GetKeyManager()
+2 -1
View File
@@ -13,6 +13,7 @@ import (
// nolint
const (
FlagName = "name"
FlagNoSign = "no-sign"
FlagIn = "in"
FlagPrepare = "prepare"
)
@@ -26,7 +27,7 @@ var RootCmd = &cobra.Command{
func init() {
RootCmd.PersistentFlags().String(FlagName, "", "name to sign the tx")
// TODO: prepare needs to override the SignAndPost somehow to SignAndSave
RootCmd.PersistentFlags().Bool(FlagNoSign, false, "don't add a signature")
RootCmd.PersistentFlags().String(FlagPrepare, "", "file to store prepared tx")
RootCmd.Flags().String(FlagIn, "", "file with tx in json format")
}