params: move some code around

This commit is contained in:
Felix Lange 2025-07-18 13:17:25 +02:00
parent b25e44a841
commit 73710ff3c5

View file

@ -10,13 +10,24 @@ import (
// ChainID // ChainID
var ChainID = Define(T[*big.Int]{ var ChainID = Define(T[*big.Int]{
Name: "chainId", Name: "chainId",
Validate: func(v *big.Int, cfg *Config2) error { Optional: false,
if v.Sign() <= 0 { Validate: validateChainID,
return fmt.Errorf("invalid chainID value %v", v) })
}
return nil func validateChainID(v *big.Int, cfg *Config2) error {
}, if v.Sign() <= 0 {
return fmt.Errorf("invalid chainID value %v", v)
}
return nil
}
// DAOForkSupport is the chain parameter that configures the DAO fork.
// true=supports or false=opposes the fork.
// The default value is true.
var DAOForkSupport = Define(T[bool]{
Optional: true,
Default: true,
}) })
// TerminalTotalDifficulty (TTD) is the total difficulty value where // TerminalTotalDifficulty (TTD) is the total difficulty value where
@ -56,11 +67,3 @@ func validateBlobSchedule(schedule map[forks.Fork]BlobConfig, cfg *Config2) erro
} }
return nil return nil
} }
// DAOForkSupport is the chain parameter that configures the DAO fork.
// true=supports or false=opposes the fork.
// The default value is true.
var DAOForkSupport = Define(T[bool]{
Optional: true,
Default: true,
})