From e3b34174d5660f6b5ad1590575d0ef13524a089e Mon Sep 17 00:00:00 2001 From: yperbasis Date: Fri, 31 May 2024 17:10:17 +0200 Subject: [PATCH] Slightly rework PR #10512 --- cl/clparams/config.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cl/clparams/config.go b/cl/clparams/config.go index dbd78072041..eb0c1b2f8ea 100644 --- a/cl/clparams/config.go +++ b/cl/clparams/config.go @@ -15,7 +15,6 @@ package clparams import ( "crypto/rand" - "encoding/binary" "fmt" "math" "math/big" @@ -24,9 +23,10 @@ import ( "path" "time" + "gopkg.in/yaml.v2" + "github.com/ledgerwatch/erigon-lib/chain/networkname" libcommon "github.com/ledgerwatch/erigon-lib/common" - "gopkg.in/yaml.v2" "github.com/ledgerwatch/erigon/cl/utils" ) @@ -320,9 +320,7 @@ func (b ConfigByte) MarshalJSON() ([]byte, error) { type ConfigForkVersion uint32 func (v ConfigForkVersion) MarshalJSON() ([]byte, error) { - tmp := make([]byte, 4) - binary.BigEndian.PutUint32(tmp, uint32(v)) - return []byte(fmt.Sprintf("\"0x%x\"", tmp)), nil + return []byte(fmt.Sprintf("\"0x%08x\"", v)), nil } // BeaconChainConfig contains constant configs for node to participate in beacon chain.