Add validator-info for net/ managed nodes (#5538)
This commit is contained in:
@@ -235,7 +235,14 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
||||
.help(&format!(
|
||||
"Validator description, max characters: {}",
|
||||
MAX_LONG_FIELD_LENGTH
|
||||
)),
|
||||
))
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("force")
|
||||
.long("force")
|
||||
.takes_value(false)
|
||||
.hidden(true) // Don't document this argument to discourage its use
|
||||
.help("Override keybase username validity check"),
|
||||
),
|
||||
)
|
||||
.subcommand(
|
||||
@@ -311,7 +318,14 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
||||
let keys = vec![(id(), false), (validator_keypair.pubkey(), true)];
|
||||
let validator_info = parse_args(&matches);
|
||||
if let Some(string) = validator_info.get("keybaseUsername") {
|
||||
verify_keybase(&validator_keypair.pubkey(), &string)?;
|
||||
let result = verify_keybase(&validator_keypair.pubkey(), &string);
|
||||
if result.is_err() {
|
||||
if matches.is_present("force") {
|
||||
println!("--force supplied, ignoring: {:?}", result);
|
||||
} else {
|
||||
result?;
|
||||
}
|
||||
}
|
||||
}
|
||||
let validator_string = serde_json::to_string(&validator_info)?;
|
||||
let validator_info = ValidatorInfo {
|
||||
|
Reference in New Issue
Block a user