Add move tests, "builder-proposals" takes bool

This commit is contained in:
Paul Hauner
2022-08-25 11:29:31 +10:00
parent 0c786c0ee2
commit 7f89f1efa7
4 changed files with 122 additions and 14 deletions

View File

@@ -158,7 +158,9 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
"When provided, all created validators will attempt to create \
blocks via builder rather than the local EL.",
)
.required(false),
.required(false)
.possible_values(&["true", "false"])
.takes_value(true),
)
.arg(
Arg::with_name(BEACON_NODE_FLAG)
@@ -188,7 +190,7 @@ pub struct CreateConfig {
pub disable_deposits: bool,
pub specify_voting_keystore_password: bool,
pub eth1_withdrawal_address: Option<Address>,
pub builder_proposals: bool,
pub builder_proposals: Option<bool>,
pub fee_recipient: Option<Address>,
pub gas_limit: Option<u64>,
pub bn_url: Option<SensitiveUrl>,
@@ -211,7 +213,7 @@ impl CreateConfig {
matches,
ETH1_WITHDRAWAL_ADDRESS_FLAG,
)?,
builder_proposals: matches.is_present(BUILDER_PROPOSALS_FLAG),
builder_proposals: clap_utils::parse_optional(matches, BUILDER_PROPOSALS_FLAG)?,
fee_recipient: clap_utils::parse_optional(matches, FEE_RECIPIENT_FLAG)?,
gas_limit: clap_utils::parse_optional(matches, GAS_LIMIT_FLAG)?,
bn_url: clap_utils::parse_optional(matches, BEACON_NODE_FLAG)?,
@@ -433,8 +435,11 @@ impl ValidatorsAndDeposits {
slashing_protection: None,
fee_recipient,
gas_limit,
builder_proposals: Some(builder_proposals),
enabled: Some(true),
builder_proposals,
// Allow the VC to choose a default "enabled" state. Since "enabled" is not part of
// the standard API, leaving this as `None` means we are not forced to use the
// non-standard API.
enabled: None,
};
eprintln!(