@@ -334,12 +334,12 @@ impl ChainSpec {
334334    } 
335335
336336    pub  fn  inactivity_penalty_quotient_for_fork ( & self ,  fork_name :  ForkName )  -> u64  { 
337-         match  fork_name { 
338-             ForkName :: Base  =>  self . inactivity_penalty_quotient , 
339-              ForkName :: Altair  =>  self . inactivity_penalty_quotient_altair , 
340-             ForkName :: Merge  =>  self . inactivity_penalty_quotient_bellatrix , 
341-              ForkName :: Capella  =>  self . inactivity_penalty_quotient_bellatrix , 
342-             ForkName :: Deneb  |  ForkName :: Electra  =>  self . inactivity_penalty_quotient_bellatrix , 
337+         if  fork_name >=  ForkName :: Merge  { 
338+             self . inactivity_penalty_quotient_bellatrix 
339+         }   else   if  fork_name >=  ForkName :: Altair  { 
340+             self . inactivity_penalty_quotient_altair 
341+         }   else   { 
342+             self . inactivity_penalty_quotient 
343343        } 
344344    } 
345345
@@ -348,13 +348,13 @@ impl ChainSpec {
348348        & self , 
349349        state :  & BeaconState < E > , 
350350    )  -> u64  { 
351-         match  state  { 
352-              BeaconState :: Base ( _ )  =>  self . proportional_slashing_multiplier , 
353-             BeaconState :: Altair ( _ )  =>  self . proportional_slashing_multiplier_altair , 
354-              BeaconState :: Merge ( _ )  =>  self . proportional_slashing_multiplier_bellatrix , 
355-             BeaconState :: Capella ( _ )  =>  self . proportional_slashing_multiplier_bellatrix , 
356-              BeaconState :: Deneb ( _ )  =>  self . proportional_slashing_multiplier_bellatrix , 
357-             BeaconState :: Electra ( _ )  =>  self . proportional_slashing_multiplier_bellatrix , 
351+         let  fork_name = state . fork_name_unchecked ( ) ; 
352+         if  fork_name >=  ForkName :: Merge   { 
353+             self . proportional_slashing_multiplier_bellatrix 
354+         }   else   if  fork_name >=  ForkName :: Altair   { 
355+             self . proportional_slashing_multiplier_altair 
356+         }   else   { 
357+             self . proportional_slashing_multiplier 
358358        } 
359359    } 
360360
@@ -363,13 +363,13 @@ impl ChainSpec {
363363        & self , 
364364        state :  & BeaconState < E > , 
365365    )  -> u64  { 
366-         match  state  { 
367-              BeaconState :: Base ( _ )  =>  self . min_slashing_penalty_quotient , 
368-             BeaconState :: Altair ( _ )  =>  self . min_slashing_penalty_quotient_altair , 
369-              BeaconState :: Merge ( _ )  =>  self . min_slashing_penalty_quotient_bellatrix , 
370-             BeaconState :: Capella ( _ )  =>  self . min_slashing_penalty_quotient_bellatrix , 
371-              BeaconState :: Deneb ( _ )  =>  self . min_slashing_penalty_quotient_bellatrix , 
372-             BeaconState :: Electra ( _ )  =>  self . min_slashing_penalty_quotient_bellatrix , 
366+         let  fork_name = state . fork_name_unchecked ( ) ; 
367+         if  fork_name >=  ForkName :: Merge   { 
368+             self . min_slashing_penalty_quotient_bellatrix 
369+         }   else   if  fork_name >=  ForkName :: Altair   { 
370+             self . min_slashing_penalty_quotient_altair 
371+         }   else   { 
372+             self . min_slashing_penalty_quotient 
373373        } 
374374    } 
375375
@@ -531,22 +531,19 @@ impl ChainSpec {
531531    } 
532532
533533    pub  fn  max_blocks_by_root_request ( & self ,  fork_name :  ForkName )  -> usize  { 
534-         match  fork_name { 
535-             ForkName :: Base  | ForkName :: Altair  | ForkName :: Merge  | ForkName :: Capella  => { 
536-                 self . max_blocks_by_root_request 
537-             } 
538-             ForkName :: Deneb  | ForkName :: Electra  => self . max_blocks_by_root_request_deneb , 
534+         if  fork_name >= ForkName :: Deneb  { 
535+             self . max_blocks_by_root_request_deneb  as  usize 
536+         }  else  { 
537+             self . max_blocks_by_root_request  as  usize 
539538        } 
540539    } 
541540
542541    pub  fn  max_request_blocks ( & self ,  fork_name :  ForkName )  -> usize  { 
543-         let  max_request_blocks = match  fork_name { 
544-             ForkName :: Base  | ForkName :: Altair  | ForkName :: Merge  | ForkName :: Capella  => { 
545-                 self . max_request_blocks 
546-             } 
547-             ForkName :: Deneb  | ForkName :: Electra  => self . max_request_blocks_deneb , 
548-         } ; 
549-         max_request_blocks as  usize 
542+         if  fork_name >= ForkName :: Deneb  { 
543+             self . max_request_blocks_deneb  as  usize 
544+         }  else  { 
545+             self . max_request_blocks  as  usize 
546+         } 
550547    } 
551548
552549    /// Returns a `ChainSpec` compatible with the Ethereum Foundation specification. 
0 commit comments