@@ -431,14 +431,14 @@ impl ValidatorDefinitions {
431431 . iter ( )
432432 . filter_map ( |def| def. check_fee_recipient ( global_fee_recipient) )
433433 . collect ( ) ;
434-
434+
435435 if !missing. is_empty ( ) {
436436 let pubkeys = missing
437437 . iter ( )
438438 . map ( |pk| pk. to_string ( ) )
439439 . collect :: < Vec < _ > > ( )
440440 . join ( ", " ) ;
441-
441+
442442 return Err ( format ! (
443443 "The following validators are missing a `suggested_fee_recipient`: {}. \
444444 Fix this by adding a `suggested_fee_recipient` in your \
@@ -447,7 +447,7 @@ impl ValidatorDefinitions {
447447 pubkeys
448448 ) ) ;
449449 }
450-
450+
451451 // Friendly reminder for users using the fallback flag
452452 if global_fee_recipient. is_some ( ) {
453453 let count = self
@@ -463,7 +463,7 @@ impl ValidatorDefinitions {
463463 ) ;
464464 }
465465 }
466-
466+
467467 Ok ( ( ) )
468468 }
469469}
@@ -541,8 +541,8 @@ pub fn is_voting_keystore(file_name: &str) -> bool {
541541#[ cfg( test) ]
542542mod tests {
543543 use super :: * ;
544- use std:: str:: FromStr ;
545544 use bls:: Keypair ;
545+ use std:: str:: FromStr ;
546546
547547 #[ test]
548548 fn voting_keystore_filename_lighthouse ( ) {
@@ -787,7 +787,8 @@ mod tests {
787787 } ;
788788
789789 // Should return None since global fee recipient is set
790- let global_fee = Some ( Address :: from_str ( "0xa2e334e71511686bcfe38bb3ee1ad8f6babcc03d" ) . unwrap ( ) ) ;
790+ let global_fee =
791+ Some ( Address :: from_str ( "0xa2e334e71511686bcfe38bb3ee1ad8f6babcc03d" ) . unwrap ( ) ) ;
791792 let check_result = def. check_fee_recipient ( global_fee) ;
792793 assert ! ( check_result. is_none( ) ) ;
793794 }
@@ -884,7 +885,7 @@ mod tests {
884885 } ;
885886
886887 let defs = ValidatorDefinitions :: from ( vec ! [ def1, def2] ) ;
887-
888+
888889 // Should fail because both defs have no fee recipient and no global fee recipient is set
889890 let result = defs. check_all_fee_recipients ( None ) ;
890891 assert ! ( result. is_err( ) ) ;
@@ -907,7 +908,9 @@ mod tests {
907908 voting_public_key : keypair. pk . clone ( ) ,
908909 description : String :: new ( ) ,
909910 graffiti : None ,
910- suggested_fee_recipient : Some ( Address :: from_str ( "0xa2e334e71511686bcfe38bb3ee1ad8f6babcc03d" ) . unwrap ( ) ) ,
911+ suggested_fee_recipient : Some (
912+ Address :: from_str ( "0xa2e334e71511686bcfe38bb3ee1ad8f6babcc03d" ) . unwrap ( ) ,
913+ ) ,
911914 gas_limit : None ,
912915 builder_proposals : None ,
913916 builder_boost_factor : None ,
@@ -924,7 +927,9 @@ mod tests {
924927 voting_public_key : keypair. pk . clone ( ) ,
925928 description : String :: new ( ) ,
926929 graffiti : None ,
927- suggested_fee_recipient : Some ( Address :: from_str ( "0xb2e334e71511686bcfe38bb3ee1ad8f6babcc03d" ) . unwrap ( ) ) ,
930+ suggested_fee_recipient : Some (
931+ Address :: from_str ( "0xb2e334e71511686bcfe38bb3ee1ad8f6babcc03d" ) . unwrap ( ) ,
932+ ) ,
928933 gas_limit : None ,
929934 builder_proposals : None ,
930935 builder_boost_factor : None ,
@@ -937,7 +942,7 @@ mod tests {
937942 } ;
938943
939944 let defs = ValidatorDefinitions :: from ( vec ! [ def1, def2] ) ;
940-
945+
941946 // Should pass - all validators have fee recipients
942947 assert ! ( defs. check_all_fee_recipients( None ) . is_ok( ) ) ;
943948 }
@@ -982,7 +987,8 @@ mod tests {
982987 let defs = ValidatorDefinitions :: from ( vec ! [ def1, def2] ) ;
983988
984989 // Should pass - global fee recipient is set
985- let global_fee = Some ( Address :: from_str ( "0xa2e334e71511686bcfe38bb3ee1ad8f6babcc03d" ) . unwrap ( ) ) ;
990+ let global_fee =
991+ Some ( Address :: from_str ( "0xa2e334e71511686bcfe38bb3ee1ad8f6babcc03d" ) . unwrap ( ) ) ;
986992 assert ! ( defs. check_all_fee_recipients( global_fee) . is_ok( ) ) ;
987993 }
988994}
0 commit comments