File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -468,6 +468,12 @@ impl ChainSpec {
468
468
. is_some_and ( |fulu_fork_epoch| fulu_fork_epoch != self . far_future_epoch )
469
469
}
470
470
471
+ /// Returns true if `GLOAS_FORK_EPOCH` is set and is not set to `FAR_FUTURE_EPOCH`.
472
+ pub fn is_gloas_scheduled ( & self ) -> bool {
473
+ self . gloas_fork_epoch
474
+ . is_some_and ( |gloas_fork_epoch| gloas_fork_epoch != self . far_future_epoch )
475
+ }
476
+
471
477
/// Returns a full `Fork` struct for a given epoch.
472
478
pub fn fork_at_epoch ( & self , epoch : Epoch ) -> Fork {
473
479
let current_fork_name = self . fork_name_at_epoch ( epoch) ;
Original file line number Diff line number Diff line change @@ -159,8 +159,8 @@ mod test {
159
159
. open ( tmp_file. as_ref ( ) )
160
160
. expect ( "error opening file" ) ;
161
161
let mut mainnet_spec = ChainSpec :: mainnet ( ) ;
162
- // setting fulu_fork_epoch because we are roundtripping a fulu config
163
- mainnet_spec. fulu_fork_epoch = Some ( Epoch :: new ( 42 ) ) ;
162
+ // setting gloas_fork_epoch because we are roundtripping a gloas config
163
+ mainnet_spec. gloas_fork_epoch = Some ( Epoch :: new ( 42 ) ) ;
164
164
let mut yamlconfig = ConfigAndPreset :: from_chain_spec :: < MainnetEthSpec > ( & mainnet_spec) ;
165
165
let ( k1, v1) = ( "SAMPLE_HARDFORK_KEY1" , "123456789" ) ;
166
166
let ( k2, v2) = ( "SAMPLE_HARDFORK_KEY2" , "987654321" ) ;
Original file line number Diff line number Diff line change @@ -967,6 +967,7 @@ mod test {
967
967
chain_spec. deneb_fork_epoch = Some ( Epoch :: new ( 4 ) ) ;
968
968
chain_spec. electra_fork_epoch = Some ( Epoch :: new ( 5 ) ) ;
969
969
chain_spec. fulu_fork_epoch = Some ( Epoch :: new ( 6 ) ) ;
970
+ chain_spec. gloas_fork_epoch = Some ( Epoch :: new ( 7 ) ) ;
970
971
971
972
// check that we have all forks covered
972
973
assert ! ( chain_spec. fork_epoch( ForkName :: latest( ) ) . is_some( ) ) ;
You can’t perform that action at this time.
0 commit comments