Skip to content
This repository was archived by the owner on Apr 4, 2024. It is now read-only.

ENG 256 fix gosec issues #779

Merged
merged 10 commits into from
Nov 25, 2021
Prev Previous commit
Next Next commit
Improvement(Ethermint): Fix flags test by using PersistentFlags() ins…
…tead of Flags()
  • Loading branch information
danburck committed Nov 24, 2021
commit eb41d33d0330b44e5cb8406e4c78232d5acdd8ec
1 change: 1 addition & 0 deletions cmd/ethermintd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
txCommand(),
ethermintclient.KeyCommands(app.DefaultNodeHome),
)

rootCmd, err := srvflags.AddTxFlags(rootCmd)
if err != nil {
panic(err)
Expand Down
6 changes: 3 additions & 3 deletions server/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ func AddTxFlags(cmd *cobra.Command) (*cobra.Command, error) {

// viper.BindPFlag(flags.FlagTrustNode, cmd.Flags().Lookup(flags.FlagTrustNode))

if err := viper.BindPFlag(flags.FlagNode, cmd.Flags().Lookup(flags.FlagNode)); err != nil {
if err := viper.BindPFlag(flags.FlagNode, cmd.PersistentFlags().Lookup(flags.FlagNode)); err != nil {
return nil, err
}
if err := viper.BindPFlag(flags.FlagKeyringBackend, cmd.Flags().Lookup(flags.FlagKeyringBackend)); err != nil {
if err := viper.BindPFlag(flags.FlagKeyringBackend, cmd.PersistentFlags().Lookup(flags.FlagKeyringBackend)); err != nil {
return nil, err
}
if err := cmd.MarkFlagRequired(flags.FlagChainID); err != nil {
if err := cmd.MarkPersistentFlagRequired(flags.FlagChainID); err != nil {
return nil, err
}
return cmd, nil
Expand Down