1- from typing import Any , Dict , Optional
1+ from typing import Any , Dict
22
33from multiversx_sdk_cli .localnet .config_root import ConfigRoot
44from multiversx_sdk_cli .localnet .constants import (
@@ -24,7 +24,7 @@ def patch_config(data: ConfigDict, config: ConfigRoot, enable_epochs_config: Con
2424 data ["StoragePruning" ]["ObserverCleanOldEpochsData" ] = False
2525 data ["StoragePruning" ]["AccountsTrieCleanOldEpochsData" ] = False
2626
27- # Some time after the release of Supernova, we should drop this custom (and somehow cumbersome) logic.
27+ # Some time after the release of Supernova, we should drop this custom (and somewhat cumbersome) logic.
2828 if supernova_activation_epoch is None :
2929 # Before Supernova (as software version, not as "era after activation"),
3030 # we alter epoch duration by adjusting "RoundsPerEpoch" and "MinRoundsBetweenEpochs" in section "EpochStartConfig".
@@ -49,7 +49,7 @@ def patch_config(data: ConfigDict, config: ConfigRoot, enable_epochs_config: Con
4949 for item in chain_parameters_by_epoch :
5050 enable_epoch = item ["EnableEpoch" ]
5151
52- is_supernova_enabled = supernova_activation_epoch and enable_epoch >= supernova_activation_epoch
52+ is_supernova_enabled = supernova_activation_epoch is not None and enable_epoch >= supernova_activation_epoch
5353 if is_supernova_enabled :
5454 item ["RoundDuration" ] = config .general .round_duration_milliseconds_in_supernova
5555 item ["RoundsPerEpoch" ] = config .general .rounds_per_epoch_in_supernova
@@ -116,7 +116,7 @@ def patch_enable_rounds(data: ConfigDict, config: ConfigRoot, enable_epochs_conf
116116 activations = data ["RoundActivations" ]
117117 supernova_entry = activations .get ("SupernovaEnableRound" )
118118
119- if supernova_entry :
119+ if supernova_entry and supernova_activation_epoch is not None :
120120 supernova_computed_activation_round = _compute_supernova_activation_round (config , supernova_activation_epoch )
121121 supernova_entry ["Round" ] = str (supernova_computed_activation_round )
122122
0 commit comments