From 4202addde4fb1fa6eaf6175bfa8d89b79ee1bd2f Mon Sep 17 00:00:00 2001 From: 0xmuralik Date: Wed, 12 Oct 2022 14:32:09 +0530 Subject: [PATCH] flags fix --- server/flags/flags.go | 3 +++ x/bond/client/cli/tx.go | 11 +++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/server/flags/flags.go b/server/flags/flags.go index 240dd624..68148c9c 100644 --- a/server/flags/flags.go +++ b/server/flags/flags.go @@ -5,6 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/spf13/cobra" "github.com/spf13/viper" + tmcli "github.com/tendermint/tendermint/libs/cli" ) // Tendermint/cosmos-sdk full-node start flags @@ -73,6 +74,8 @@ func AddTxFlags(cmd *cobra.Command) (*cobra.Command, error) { cmd.PersistentFlags().Float64(flags.FlagGasAdjustment, flags.DefaultGasAdjustment, "adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored ") //nolint:lll cmd.PersistentFlags().StringP(flags.FlagBroadcastMode, "b", flags.BroadcastSync, "Transaction broadcasting mode (sync|async|block)") cmd.PersistentFlags().String(flags.FlagKeyringBackend, keyring.BackendOS, "Select keyring's backend") + cmd.PersistentFlags().BoolP(flags.FlagSkipConfirmation, "y", false, "Skip tx broadcasting prompt confirmation") + cmd.Flags().StringP(tmcli.OutputFlag, "o", "text", "Output format (text|json)") // --gas can accept integers and "simulate" // cmd.PersistentFlags().Var(&flags.GasFlagVar, "gas", fmt.Sprintf( diff --git a/x/bond/client/cli/tx.go b/x/bond/client/cli/tx.go index 516c5aba..de122f4a 100644 --- a/x/bond/client/cli/tx.go +++ b/x/bond/client/cli/tx.go @@ -1,9 +1,9 @@ package cli import ( + "github.com/cerc-io/laconicd/server/flags" "github.com/cerc-io/laconicd/x/bond/types" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/cobra" @@ -50,7 +50,7 @@ func NewCreateBondCmd() *cobra.Command { }, } - flags.AddTxFlagsToCmd(cmd) + flags.AddTxFlags(cmd) return cmd } @@ -75,7 +75,7 @@ func RefillBondCmd() *cobra.Command { return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) }, } - flags.AddTxFlagsToCmd(cmd) + flags.AddTxFlags(cmd) return cmd } @@ -101,7 +101,7 @@ func WithdrawBondCmd() *cobra.Command { return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) }, } - flags.AddTxFlagsToCmd(cmd) + flags.AddTxFlags(cmd) return cmd } @@ -122,7 +122,6 @@ func CancelBondCmd() *cobra.Command { return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) }, } - flags.AddTxFlagsToCmd(cmd) - + flags.AddTxFlags(cmd) return cmd }