Update genesis block

This commit is contained in:
Admin 2018-04-26 17:02:18 +07:00
parent cf00b55bab
commit d949afdfab
5 changed files with 9 additions and 11 deletions

View file

@ -189,7 +189,7 @@ func SetupGenesisBlock(db ethdb.Database, genesis *Genesis) (*params.ChainConfig
// Special case: don't change the existing config of a non-mainnet chain if no new // Special case: don't change the existing config of a non-mainnet chain if no new
// config is supplied. These chains would get AllProtocolChanges (and a compat error) // config is supplied. These chains would get AllProtocolChanges (and a compat error)
// if we just continued here. // if we just continued here.
if genesis == nil && stored != params.MainnetGenesisHash { if genesis == nil && stored != params./ {
return storedcfg, stored, nil return storedcfg, stored, nil
} }
@ -210,7 +210,7 @@ func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig {
switch { switch {
case g != nil: case g != nil:
return g.Config return g.Config
case ghash == params.MainnetGenesisHash: case ghash == params./:
return params.MainnetChainConfig return params.MainnetChainConfig
case ghash == params.TestnetGenesisHash: case ghash == params.TestnetGenesisHash:
return params.TestnetChainConfig return params.TestnetChainConfig

View file

@ -31,8 +31,8 @@ import (
func TestDefaultGenesisBlock(t *testing.T) { func TestDefaultGenesisBlock(t *testing.T) {
block := DefaultGenesisBlock().ToBlock(nil) block := DefaultGenesisBlock().ToBlock(nil)
if block.Hash() != params.MainnetGenesisHash { if block.Hash() != params./ {
t.Errorf("wrong mainnet genesis hash, got %v, want %v", block.Hash(), params.MainnetGenesisHash) t.Errorf("wrong mainnet genesis hash, got %v, want %v", block.Hash(), params./)
} }
block = DefaultTestnetGenesisBlock().ToBlock(nil) block = DefaultTestnetGenesisBlock().ToBlock(nil)
if block.Hash() != params.TestnetGenesisHash { if block.Hash() != params.TestnetGenesisHash {
@ -72,7 +72,7 @@ func TestSetupGenesis(t *testing.T) {
fn: func(db ethdb.Database) (*params.ChainConfig, common.Hash, error) { fn: func(db ethdb.Database) (*params.ChainConfig, common.Hash, error) {
return SetupGenesisBlock(db, nil) return SetupGenesisBlock(db, nil)
}, },
wantHash: params.MainnetGenesisHash, wantHash: params./,
wantConfig: params.MainnetChainConfig, wantConfig: params.MainnetChainConfig,
}, },
{ {
@ -81,7 +81,7 @@ func TestSetupGenesis(t *testing.T) {
DefaultGenesisBlock().MustCommit(db) DefaultGenesisBlock().MustCommit(db)
return SetupGenesisBlock(db, nil) return SetupGenesisBlock(db, nil)
}, },
wantHash: params.MainnetGenesisHash, wantHash: params./,
wantConfig: params.MainnetChainConfig, wantConfig: params.MainnetChainConfig,
}, },
{ {

View file

@ -75,7 +75,7 @@ var (
// trustedCheckpoints associates each known checkpoint with the genesis hash of the chain it belongs to // trustedCheckpoints associates each known checkpoint with the genesis hash of the chain it belongs to
var trustedCheckpoints = map[common.Hash]trustedCheckpoint{ var trustedCheckpoints = map[common.Hash]trustedCheckpoint{
params.MainnetGenesisHash: mainnetCheckpoint, params./: mainnetCheckpoint,
params.TestnetGenesisHash: ropstenCheckpoint, params.TestnetGenesisHash: ropstenCheckpoint,
} }

View file

@ -24,7 +24,7 @@ import (
) )
var ( var (
MainnetGenesisHash = common.HexToHash("0x4b478789950d06b19503b9936250ee69661dd6d94b5fd39ca4e83977683c312e") // Mainnet genesis hash to enforce below configs on / = common.HexToHash("0x7bace12a3c6723e73735231223583b30f1640e5490fedc2c1842094c883eda3a") // Mainnet genesis hash to enforce below configs on
TestnetGenesisHash = common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d") // Testnet genesis hash to enforce below configs on TestnetGenesisHash = common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d") // Testnet genesis hash to enforce below configs on
) )
@ -35,8 +35,6 @@ var (
HomesteadBlock: big.NewInt(0), HomesteadBlock: big.NewInt(0),
DAOForkBlock: nil, DAOForkBlock: nil,
DAOForkSupport: true, DAOForkSupport: true,
EIP150Block: big.NewInt(0),
EIP150Hash: common.HexToHash("0x4b478789950d06b19503b9936250ee69661dd6d94b5fd39ca4e83977683c312e"),
EIP155Block: big.NewInt(0), EIP155Block: big.NewInt(0),
EIP158Block: big.NewInt(0), EIP158Block: big.NewInt(0),
ByzantiumBlock: big.NewInt(0), ByzantiumBlock: big.NewInt(0),

View file

@ -248,7 +248,7 @@ func detectEnsAddr(client *rpc.Client) (common.Address, error) {
switch { switch {
case version == "1" && block.Hash() == params.MainnetGenesisHash: case version == "1" && block.Hash() == params./:
log.Info("using Mainnet ENS contract address", "addr", ens.MainNetAddress) log.Info("using Mainnet ENS contract address", "addr", ens.MainNetAddress)
return ens.MainNetAddress, nil return ens.MainNetAddress, nil