Fix config file flags in subcommands (#7475)

This commit is contained in:
bidlocode
2020-10-11 21:26:59 +06:00
committed by GitHub
parent b5a913d862
commit 0214553415
11 changed files with 115 additions and 40 deletions

View File

@@ -21,7 +21,7 @@ var AccountCommands = &cli.Command{
Description: `creates a new validator account for eth2. If no wallet exists at the given wallet path, creates a new wallet for a user based on
specified input, capable of creating a direct, derived, or remote wallet.
this command outputs a deposit data string which is required to become a validator in eth2.`,
Flags: []cli.Flag{
Flags: cmd.WrapFlags([]cli.Flag{
flags.WalletDirFlag,
flags.WalletPasswordFileFlag,
flags.AccountPasswordFileFlag,
@@ -32,6 +32,9 @@ this command outputs a deposit data string which is required to become a validat
featureconfig.MedallaTestnet,
featureconfig.SpadinaTestnet,
featureconfig.ZinkenTestnet,
}),
Before: func(cliCtx *cli.Context) error {
return cmd.LoadFlagsFromConfig(cliCtx, cliCtx.Command.Flags)
},
Action: func(cliCtx *cli.Context) error {
featureconfig.ConfigureValidator(cliCtx)
@@ -44,7 +47,7 @@ this command outputs a deposit data string which is required to become a validat
{
Name: "delete",
Description: `deletes the selected accounts from a users wallet.`,
Flags: []cli.Flag{
Flags: cmd.WrapFlags([]cli.Flag{
flags.WalletDirFlag,
flags.WalletPasswordFileFlag,
flags.AccountPasswordFileFlag,
@@ -54,6 +57,9 @@ this command outputs a deposit data string which is required to become a validat
featureconfig.MedallaTestnet,
featureconfig.SpadinaTestnet,
featureconfig.ZinkenTestnet,
}),
Before: func(cliCtx *cli.Context) error {
return cmd.LoadFlagsFromConfig(cliCtx, cliCtx.Command.Flags)
},
Action: func(cliCtx *cli.Context) error {
featureconfig.ConfigureValidator(cliCtx)
@@ -66,7 +72,7 @@ this command outputs a deposit data string which is required to become a validat
{
Name: "list",
Description: "Lists all validator accounts in a user's wallet directory",
Flags: []cli.Flag{
Flags: cmd.WrapFlags([]cli.Flag{
flags.WalletDirFlag,
flags.WalletPasswordFileFlag,
flags.ShowDepositDataFlag,
@@ -76,6 +82,9 @@ this command outputs a deposit data string which is required to become a validat
featureconfig.SpadinaTestnet,
featureconfig.ZinkenTestnet,
flags.DeprecatedPasswordsDirFlag,
}),
Before: func(cliCtx *cli.Context) error {
return cmd.LoadFlagsFromConfig(cliCtx, cliCtx.Command.Flags)
},
Action: func(cliCtx *cli.Context) error {
featureconfig.ConfigureValidator(cliCtx)
@@ -91,7 +100,7 @@ this command outputs a deposit data string which is required to become a validat
"at a desired output directory. Accounts to backup can also " +
"be specified programmatically via a --backup-for-public-keys flag which specifies a comma-separated " +
"list of hex string public keys",
Flags: []cli.Flag{
Flags: cmd.WrapFlags([]cli.Flag{
flags.WalletDirFlag,
flags.WalletPasswordFileFlag,
flags.BackupDirFlag,
@@ -102,6 +111,9 @@ this command outputs a deposit data string which is required to become a validat
featureconfig.MedallaTestnet,
featureconfig.SpadinaTestnet,
featureconfig.ZinkenTestnet,
}),
Before: func(cliCtx *cli.Context) error {
return cmd.LoadFlagsFromConfig(cliCtx, cliCtx.Command.Flags)
},
Action: func(cliCtx *cli.Context) error {
featureconfig.ConfigureValidator(cliCtx)
@@ -114,7 +126,7 @@ this command outputs a deposit data string which is required to become a validat
{
Name: "import",
Description: `imports eth2 validator accounts stored in EIP-2335 keystore.json files from an external directory`,
Flags: []cli.Flag{
Flags: cmd.WrapFlags([]cli.Flag{
flags.WalletDirFlag,
flags.KeysDirFlag,
flags.WalletPasswordFileFlag,
@@ -126,6 +138,9 @@ this command outputs a deposit data string which is required to become a validat
featureconfig.SpadinaTestnet,
featureconfig.ZinkenTestnet,
flags.DeprecatedPasswordsDirFlag,
}),
Before: func(cliCtx *cli.Context) error {
return cmd.LoadFlagsFromConfig(cliCtx, cliCtx.Command.Flags)
},
Action: func(cliCtx *cli.Context) error {
featureconfig.ConfigureValidator(cliCtx)
@@ -138,7 +153,7 @@ this command outputs a deposit data string which is required to become a validat
{
Name: "voluntary-exit",
Description: "Performs a voluntary exit on selected accounts",
Flags: []cli.Flag{
Flags: cmd.WrapFlags([]cli.Flag{
flags.WalletDirFlag,
flags.WalletPasswordFileFlag,
flags.AccountPasswordFileFlag,
@@ -154,6 +169,9 @@ this command outputs a deposit data string which is required to become a validat
featureconfig.MedallaTestnet,
featureconfig.SpadinaTestnet,
featureconfig.ZinkenTestnet,
}),
Before: func(cliCtx *cli.Context) error {
return cmd.LoadFlagsFromConfig(cliCtx, cliCtx.Command.Flags)
},
Action: func(cliCtx *cli.Context) error {
featureconfig.ConfigureValidator(cliCtx)