Skip to content

Commit

Permalink
fix: add TrimSpace when read system contracts code
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonberg1997 committed Jun 25, 2024
1 parent ea5f3ce commit 326cddb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/systemcontracts/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/ethereum/go-ethereum/core/systemcontracts/ramanujan"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
"strings"
)

type UpgradeConfig struct {
Expand Down Expand Up @@ -821,7 +822,7 @@ func applySystemContractUpgrade(upgrade *Upgrade, blockNumber *big.Int, statedb
}
}

newContractCode, err := hex.DecodeString(cfg.Code)
newContractCode, err := hex.DecodeString(strings.TrimSpace(cfg.Code))
if err != nil {
panic(fmt.Errorf("failed to decode new contract code: %s", err.Error()))
}
Expand Down
1 change: 1 addition & 0 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ var (
FeynmanFixTime: newUint64(0),
CancunTime: newUint64(0),
HaberTime: newUint64(0),
HaberFixTime: newUint64(0),
BohrTime: newUint64(0),

Parlia: &ParliaConfig{
Expand Down

0 comments on commit 326cddb

Please sign in to comment.