Remove generic transaction options

This commit is contained in:
Jim McDonald
2020-06-08 09:10:12 +01:00
parent 51e289b72b
commit 1032789706
3 changed files with 1 additions and 22 deletions

View File

@@ -101,20 +101,6 @@ func persistentPreRun(cmd *cobra.Command, args []string) {
rootWalletPassphrase = viper.GetString("walletpassphrase")
rootAccountPassphrase = viper.GetString("passphrase")
// ...lots of commands have transaction-related flags (e.g.) 'wait'
// as options but we want to bind them to this particular command and
// this is the first chance we get
if cmd.Flags().Lookup("wait") != nil {
err := viper.BindPFlag("wait", cmd.Flags().Lookup("wait"))
errCheck(err, "Failed to set wait option")
}
wait = viper.GetBool("wait")
if cmd.Flags().Lookup("generate") != nil {
err := viper.BindPFlag("generate", cmd.Flags().Lookup("generate"))
errCheck(err, "Failed to set generate option")
}
generate = viper.GetBool("generate")
if quiet && verbose {
die("Cannot supply both quiet and verbose flags")
}
@@ -415,12 +401,6 @@ func sign(account wtypes.Account, data []byte) (e2types.Signature, error) {
return account.Sign(data)
}
// addTransactionFlags adds flags used in all transactions.
func addTransactionFlags(cmd *cobra.Command) {
cmd.Flags().Bool("generate", false, "Do not send the transaction; generate and output as a hex string only")
cmd.Flags().Bool("wait", false, "wait for the transaction to be mined before returning")
}
// connect connects to an Ethereum 2 endpoint.
func connect() error {
connection := ""

View File

@@ -176,7 +176,6 @@ func init() {
validatorExitCmd.Flags().StringVar(&validatorExitKey, "key", "", "Private key if account not known by ethdo")
validatorExitCmd.Flags().BoolVar(&validatorExitJSONOutput, "json-output", false, "Print JSON transaction; do not broadcast to network")
validatorExitCmd.Flags().StringVar(&validatorExitJSON, "json", "", "Use JSON as created by --json-output to exit")
addTransactionFlags(validatorExitCmd)
}
type validatorExitData struct {

View File

@@ -30,7 +30,7 @@ var versionCmd = &cobra.Command{
ethdo version.`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("1.4.15")
fmt.Println("1.4.16")
if viper.GetBool("verbose") {
buildInfo, ok := dbg.ReadBuildInfo()
if ok {