Fix Gas Flag Usage + CLI Flag APIs (#6685)

* Use new APIs

* fix usage

* fix usage of gas flag

* tests: TestParseGasSetting
This commit is contained in:
Alexander Bezobchuk
2020-07-11 08:13:46 +00:00
committed by GitHub
parent e1476c1f9d
commit e7554bb3b0
44 changed files with 408 additions and 180 deletions
+3 -1
View File
@@ -50,5 +50,7 @@ $ <appcli> tx broadcast ./mytxn.json
},
}
return flags.PostCommands(cmd)[0]
flags.AddTxFlagsToCmd(cmd)
return cmd
}
+3 -1
View File
@@ -42,5 +42,7 @@ func GetDecodeCommand(clientCtx client.Context) *cobra.Command {
}
cmd.Flags().BoolP(flagHex, "x", false, "Treat input as hexadecimal instead of base64")
return flags.PostCommands(cmd)[0]
flags.AddTxFlagsToCmd(cmd)
return cmd
}
+3 -1
View File
@@ -49,5 +49,7 @@ If you supply a dash (-) argument in place of an input filename, the command rea
},
}
return flags.PostCommands(cmd)[0]
flags.AddTxFlagsToCmd(cmd)
return cmd
}
+6 -2
View File
@@ -69,7 +69,9 @@ $ <appcli> query auth params
},
}
return flags.GetCommands(cmd)[0]
flags.AddQueryFlagsToCmd(cmd)
return cmd
}
// GetAccountCmd returns a query account that will display the state of the
@@ -97,7 +99,9 @@ func GetAccountCmd(cdc *codec.Codec) *cobra.Command {
},
}
return flags.GetCommands(cmd)[0]
flags.AddQueryFlagsToCmd(cmd)
return cmd
}
// QueryTxsByEventsCmd returns a command to search through transactions by events.
+2 -1
View File
@@ -51,8 +51,9 @@ recommended to set such parameters manually.
cmd.Flags().Bool(flagSigOnly, false, "Print only the generated signature, then exit")
cmd.Flags().String(flags.FlagOutputDocument, "", "The document will be written to the given file instead of STDOUT")
flags.AddTxFlagsToCmd(cmd)
return flags.PostCommands(cmd)[0]
return cmd
}
func makeMultiSignCmd(clientCtx client.Context) func(cmd *cobra.Command, args []string) error {
+5 -14
View File
@@ -48,14 +48,11 @@ account key. It implies --signature-only.
Args: cobra.ExactArgs(1),
}
cmd.Flags().String(
flagMultisig, "",
"Address of the multisig account on behalf of which the transaction shall be signed",
)
cmd.Flags().String(flagMultisig, "", "Address of the multisig account on behalf of which the transaction shall be signed")
cmd.Flags().String(flags.FlagOutputDocument, "", "The document will be written to the given file instead of STDOUT")
cmd.Flags().Bool(flagSigOnly, true, "Print only the generated signature, then exit")
cmd = flags.PostCommands(cmd)[0]
cmd.MarkFlagRequired(flags.FlagFrom)
flags.AddTxFlagsToCmd(cmd)
return cmd
}
@@ -178,19 +175,13 @@ be generated via the 'multisign' command.
Args: cobra.ExactArgs(1),
}
cmd.Flags().String(
flagMultisig, "",
"Address of the multisig account on behalf of which the transaction shall be signed",
)
cmd.Flags().Bool(
flagAppend, true,
"Append the signature to the existing ones. If disabled, old signatures would be overwritten. Ignored if --multisig is on",
)
cmd.Flags().String(flagMultisig, "", "Address of the multisig account on behalf of which the transaction shall be signed")
cmd.Flags().Bool(flagAppend, true, "Append the signature to the existing ones. If disabled, old signatures would be overwritten. Ignored if --multisig is on")
cmd.Flags().Bool(flagSigOnly, false, "Print only the generated signature, then exit")
cmd.Flags().String(flags.FlagOutputDocument, "", "The document will be written to the given file instead of STDOUT")
cmd.Flags().String(flags.FlagHome, "", "The application home directory")
cmd = flags.PostCommands(cmd)[0]
cmd.MarkFlagRequired(flags.FlagFrom)
flags.AddTxFlagsToCmd(cmd)
return cmd
}
+3 -1
View File
@@ -32,7 +32,9 @@ transaction will be not be performed as that will require RPC communication with
Args: cobra.ExactArgs(1),
}
return flags.PostCommands(cmd)[0]
flags.AddTxFlagsToCmd(cmd)
return cmd
}
func makeValidateSignaturesCmd(clientCtx client.Context) func(cmd *cobra.Command, args []string) error {