allow custom net parser to skip chain config and only parse genesis data

This commit is contained in:
jangko 2021-02-15 12:32:02 +07:00 committed by andri lim
parent 455756c098
commit 8e4b917fd3
1 changed files with 2 additions and 4 deletions

View File

@ -379,7 +379,7 @@ proc processCustomGenesisConfig(customGenesis: JsonNode): ConfigStatus =
if customGenesis.hasKey("config"):
# Validate all fork blocks for custom genesis
# Validate all fork blocks for custom genesis
let forkDetails = customGenesis["config"]
validateConfigValue(forkDetails, chainId, JInt, ChainId)
checkForFork(forkDetails, homesteadBlock, 0.toBlockNumber)
@ -397,9 +397,7 @@ proc processCustomGenesisConfig(customGenesis: JsonNode): ConfigStatus =
checkForFork(forkDetails, istanbulBlock, petersburgBlock)
checkForFork(forkDetails, muirGlacierBlock, istanbulBlock)
checkForFork(forkDetails, istanbulBlock, berlinBlock)
else:
error "No chain configuration found."
quit(1)
validateConfigValue(customGenesis, nonce, JString, BlockNonce, checkError = false)
validateConfigValue(customGenesis, extraData, JSTring, seq[byte], checkError = false)
validateConfigValue(customGenesis, gasLimit, JString, int64, checkError = false)