File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -77,10 +77,14 @@ impl ExitConfig {
77
77
fn from_cli ( matches : & ArgMatches ) -> Result < Self , String > {
78
78
let validators_to_exit_str = clap_utils:: parse_required :: < String > ( matches, VALIDATOR_FLAG ) ?;
79
79
80
- let validators_to_exit = validators_to_exit_str
81
- . split ( ',' )
82
- . map ( |s| s. trim ( ) . parse ( ) )
83
- . collect :: < Result < Vec < PublicKeyBytes > , _ > > ( ) ?;
80
+ let validators_to_exit = if validators_to_exit_str. trim ( ) == "all" {
81
+ Vec :: new ( )
82
+ } else {
83
+ validators_to_exit_str
84
+ . split ( ',' )
85
+ . map ( |s| s. trim ( ) . parse ( ) )
86
+ . collect :: < Result < Vec < PublicKeyBytes > , _ > > ( ) ?
87
+ } ;
84
88
85
89
Ok ( Self {
86
90
vc_url : clap_utils:: parse_required ( matches, VC_URL_FLAG ) ?,
@@ -106,13 +110,16 @@ async fn run(config: ExitConfig) -> Result<(), String> {
106
110
let ExitConfig {
107
111
vc_url,
108
112
vc_token_path,
109
- validators_to_exit,
113
+ mut validators_to_exit,
110
114
beacon_url,
111
115
exit_epoch,
112
116
} = config;
113
117
114
118
let ( http_client, validators) = vc_http_client ( vc_url. clone ( ) , & vc_token_path) . await ?;
115
119
120
+ if validators_to_exit. is_empty ( ) {
121
+ validators_to_exit = validators. iter ( ) . map ( |v| v. validating_pubkey ) . collect ( ) ;
122
+ }
116
123
// Check that the validators_to_exit is in the validator client
117
124
for validator_to_exit in & validators_to_exit {
118
125
if !validators
You can’t perform that action at this time.
0 commit comments