Skip to content

Commit 33e4f51

Browse files
committed
Merge pull request #2444 from karalabe/gethrpctest-chainconfig-panic
cmd/gethrpctest: add missing chain configuration config field
2 parents 8627680 + aceaaa5 commit 33e4f51

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

cmd/gethrpctest/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ import (
2626

2727
"github.com/ethereum/go-ethereum/accounts"
2828
"github.com/ethereum/go-ethereum/common"
29+
"github.com/ethereum/go-ethereum/core"
2930
"github.com/ethereum/go-ethereum/crypto"
3031
"github.com/ethereum/go-ethereum/eth"
3132
"github.com/ethereum/go-ethereum/ethdb"
3233
"github.com/ethereum/go-ethereum/logger/glog"
3334
"github.com/ethereum/go-ethereum/node"
35+
"github.com/ethereum/go-ethereum/params"
3436
"github.com/ethereum/go-ethereum/tests"
3537
"github.com/ethereum/go-ethereum/whisper"
3638
)
@@ -129,6 +131,7 @@ func MakeSystemNode(keydir string, privkey string, test *tests.BlockTest) (*node
129131
ethConf := &eth.Config{
130132
TestGenesisState: db,
131133
TestGenesisBlock: test.Genesis,
134+
ChainConfig: &core.ChainConfig{HomesteadBlock: params.MainNetHomesteadBlock},
132135
AccountManager: accman,
133136
}
134137
if err := stack.Register(func(ctx *node.ServiceContext) (node.Service, error) { return eth.New(ctx, ethConf) }); err != nil {

eth/backend.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package eth
1919

2020
import (
2121
"bytes"
22+
"errors"
2223
"fmt"
2324
"math/big"
2425
"os"
@@ -243,6 +244,9 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
243244
glog.V(logger.Info).Infoln("WARNING: Wrote default ethereum genesis block")
244245
}
245246

247+
if config.ChainConfig == nil {
248+
return nil, errors.New("missing chain config")
249+
}
246250
eth.chainConfig = config.ChainConfig
247251
eth.chainConfig.VmConfig = vm.Config{
248252
EnableJit: config.EnableJit,

0 commit comments

Comments
 (0)