fix int bitlength issue in TestChainConfig_LoadForks

This commit is contained in:
Guillaume Ballet 2025-10-24 08:25:51 -04:00 committed by Felix Lange
parent d2acc9fe1b
commit 9dbe84dfcc

View file

@ -108,6 +108,8 @@ func (c *ChainConfig) LoadForks(file []byte) error {
switch version := value.(type) {
case int:
versions[name] = new(big.Int).SetUint64(uint64(version)).FillBytes(make([]byte, 4))
case int64:
versions[name] = new(big.Int).SetUint64(uint64(version)).FillBytes(make([]byte, 4))
case uint64:
versions[name] = new(big.Int).SetUint64(version).FillBytes(make([]byte, 4))
case string:
@ -125,6 +127,8 @@ func (c *ChainConfig) LoadForks(file []byte) error {
switch epoch := value.(type) {
case int:
epochs[name] = uint64(epoch)
case int64:
epochs[name] = uint64(epoch)
case uint64:
epochs[name] = epoch
case string: