flags fix

This commit is contained in:
0xmuralik 2022-10-12 14:32:09 +05:30
parent 8d29064d08
commit 4202addde4
2 changed files with 8 additions and 6 deletions

View File

@ -5,6 +5,7 @@ import (
"github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/crypto/keyring"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/viper" "github.com/spf13/viper"
tmcli "github.com/tendermint/tendermint/libs/cli"
) )
// Tendermint/cosmos-sdk full-node start flags // 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().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().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().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" // --gas can accept integers and "simulate"
// cmd.PersistentFlags().Var(&flags.GasFlagVar, "gas", fmt.Sprintf( // cmd.PersistentFlags().Var(&flags.GasFlagVar, "gas", fmt.Sprintf(

View File

@ -1,9 +1,9 @@
package cli package cli
import ( import (
"github.com/cerc-io/laconicd/server/flags"
"github.com/cerc-io/laconicd/x/bond/types" "github.com/cerc-io/laconicd/x/bond/types"
"github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/client/tx"
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/spf13/cobra" "github.com/spf13/cobra"
@ -50,7 +50,7 @@ func NewCreateBondCmd() *cobra.Command {
}, },
} }
flags.AddTxFlagsToCmd(cmd) flags.AddTxFlags(cmd)
return cmd return cmd
} }
@ -75,7 +75,7 @@ func RefillBondCmd() *cobra.Command {
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg)
}, },
} }
flags.AddTxFlagsToCmd(cmd) flags.AddTxFlags(cmd)
return cmd return cmd
} }
@ -101,7 +101,7 @@ func WithdrawBondCmd() *cobra.Command {
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg)
}, },
} }
flags.AddTxFlagsToCmd(cmd) flags.AddTxFlags(cmd)
return cmd return cmd
} }
@ -122,7 +122,6 @@ func CancelBondCmd() *cobra.Command {
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg)
}, },
} }
flags.AddTxFlagsToCmd(cmd) flags.AddTxFlags(cmd)
return cmd return cmd
} }