@@ -201,7 +201,7 @@ proc loadCompileTimeNetworkMetadata(
201201 else :
202202 macros.error " config.yaml not found for network '" & path
203203
204- when const_preset == " gnosis " :
204+ when IsGnosisSupported :
205205 when incbinEnabled:
206206 let
207207 gnosisGenesisVar {.importc : " gnosis_mainnet_genesis" .}: ptr UncheckedArray [byte ]
@@ -247,7 +247,7 @@ when const_preset == "gnosis":
247247 doAssert network.cfg.GLOAS_FORK_EPOCH == FAR_FUTURE_EPOCH
248248 doAssert ConsensusFork .high == ConsensusFork .Gloas
249249
250- elif const_preset == " mainnet " :
250+ elif IsMainnetSupported :
251251 when incbinEnabled:
252252 # Nim is very inefficent at loading large constants from binary files so we
253253 # use this trick instead which saves significant amounts of compile time
@@ -360,7 +360,7 @@ proc getMetadataForNetwork*(networkName: string): Eth2NetworkMetadata =
360360 warn " https://blog.ethereum.org/2025/09/01/holesky-shutdown-announcement suggests migrating to Hoodi or Sepolia"
361361
362362 let metadata =
363- when const_preset == " gnosis " :
363+ when IsGnosisSupported :
364364 case toLowerAscii (networkName)
365365 of " gnosis" :
366366 gnosisMetadata
@@ -373,7 +373,7 @@ proc getMetadataForNetwork*(networkName: string): Eth2NetworkMetadata =
373373 else :
374374 loadRuntimeMetadata ()
375375
376- elif const_preset == " mainnet " :
376+ elif IsMainnetSupported :
377377 case toLowerAscii (networkName)
378378 of " mainnet" :
379379 mainnetMetadata
@@ -404,9 +404,9 @@ proc getRuntimeConfig*(eth2Network: Option[string]): RuntimeConfig =
404404 if eth2Network.isSome:
405405 getMetadataForNetwork (eth2Network.get)
406406 else :
407- when const_preset == " mainnet " :
407+ when IsMainnetSupported :
408408 mainnetMetadata
409- elif const_preset == " gnosis " :
409+ elif IsGnosisSupported :
410410 gnosisMetadata
411411 else :
412412 # This is a non-standard build (i.e. minimal), and the function was
@@ -416,7 +416,7 @@ proc getRuntimeConfig*(eth2Network: Option[string]): RuntimeConfig =
416416
417417 metadata.cfg
418418
419- when const_preset in [ " mainnet " , " gnosis " ] :
419+ when IsMainnetSupported or IsGnosisSupported :
420420 template bakedInGenesisStateAsBytes (networkName: untyped ): untyped =
421421 when incbinEnabled:
422422 `networkName Genesis`.toOpenArray (0 , `networkName GenesisSize` - 1 )
@@ -435,22 +435,22 @@ when const_preset in ["mainnet", "gnosis"]:
435435 template bakedBytes * (metadata: GenesisMetadata ): auto =
436436 case metadata.networkName
437437 of " mainnet" :
438- when const_preset == " mainnet " :
438+ when IsMainnetSupported :
439439 bakedInGenesisStateAsBytes mainnet
440440 else :
441441 raiseAssert availableOnlyInMainnetBuild
442442 of " sepolia" :
443- when const_preset == " mainnet " :
443+ when IsMainnetSupported :
444444 bakedInGenesisStateAsBytes sepolia
445445 else :
446446 raiseAssert availableOnlyInMainnetBuild
447447 of " gnosis" :
448- when const_preset == " gnosis " :
448+ when IsGnosisSupported :
449449 bakedInGenesisStateAsBytes gnosis
450450 else :
451451 raiseAssert availableOnlyInGnosisBuild
452452 of " chiado" :
453- when const_preset == " gnosis " :
453+ when IsGnosisSupported :
454454 bakedInGenesisStateAsBytes chiado
455455 else :
456456 raiseAssert availableOnlyInGnosisBuild
0 commit comments