mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
Update genesis block
This commit is contained in:
parent
cf00b55bab
commit
d949afdfab
5 changed files with 9 additions and 11 deletions
|
|
@ -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
|
||||
// config is supplied. These chains would get AllProtocolChanges (and a compat error)
|
||||
// if we just continued here.
|
||||
if genesis == nil && stored != params.MainnetGenesisHash {
|
||||
if genesis == nil && stored != params./ {
|
||||
return storedcfg, stored, nil
|
||||
}
|
||||
|
||||
|
|
@ -210,7 +210,7 @@ func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig {
|
|||
switch {
|
||||
case g != nil:
|
||||
return g.Config
|
||||
case ghash == params.MainnetGenesisHash:
|
||||
case ghash == params./:
|
||||
return params.MainnetChainConfig
|
||||
case ghash == params.TestnetGenesisHash:
|
||||
return params.TestnetChainConfig
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ import (
|
|||
|
||||
func TestDefaultGenesisBlock(t *testing.T) {
|
||||
block := DefaultGenesisBlock().ToBlock(nil)
|
||||
if block.Hash() != params.MainnetGenesisHash {
|
||||
t.Errorf("wrong mainnet genesis hash, got %v, want %v", block.Hash(), params.MainnetGenesisHash)
|
||||
if block.Hash() != params./ {
|
||||
t.Errorf("wrong mainnet genesis hash, got %v, want %v", block.Hash(), params./)
|
||||
}
|
||||
block = DefaultTestnetGenesisBlock().ToBlock(nil)
|
||||
if block.Hash() != params.TestnetGenesisHash {
|
||||
|
|
@ -72,7 +72,7 @@ func TestSetupGenesis(t *testing.T) {
|
|||
fn: func(db ethdb.Database) (*params.ChainConfig, common.Hash, error) {
|
||||
return SetupGenesisBlock(db, nil)
|
||||
},
|
||||
wantHash: params.MainnetGenesisHash,
|
||||
wantHash: params./,
|
||||
wantConfig: params.MainnetChainConfig,
|
||||
},
|
||||
{
|
||||
|
|
@ -81,7 +81,7 @@ func TestSetupGenesis(t *testing.T) {
|
|||
DefaultGenesisBlock().MustCommit(db)
|
||||
return SetupGenesisBlock(db, nil)
|
||||
},
|
||||
wantHash: params.MainnetGenesisHash,
|
||||
wantHash: params./,
|
||||
wantConfig: params.MainnetChainConfig,
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ var (
|
|||
|
||||
// trustedCheckpoints associates each known checkpoint with the genesis hash of the chain it belongs to
|
||||
var trustedCheckpoints = map[common.Hash]trustedCheckpoint{
|
||||
params.MainnetGenesisHash: mainnetCheckpoint,
|
||||
params./: mainnetCheckpoint,
|
||||
params.TestnetGenesisHash: ropstenCheckpoint,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import (
|
|||
)
|
||||
|
||||
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
|
||||
)
|
||||
|
||||
|
|
@ -35,8 +35,6 @@ var (
|
|||
HomesteadBlock: big.NewInt(0),
|
||||
DAOForkBlock: nil,
|
||||
DAOForkSupport: true,
|
||||
EIP150Block: big.NewInt(0),
|
||||
EIP150Hash: common.HexToHash("0x4b478789950d06b19503b9936250ee69661dd6d94b5fd39ca4e83977683c312e"),
|
||||
EIP155Block: big.NewInt(0),
|
||||
EIP158Block: big.NewInt(0),
|
||||
ByzantiumBlock: big.NewInt(0),
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ func detectEnsAddr(client *rpc.Client) (common.Address, error) {
|
|||
|
||||
switch {
|
||||
|
||||
case version == "1" && block.Hash() == params.MainnetGenesisHash:
|
||||
case version == "1" && block.Hash() == params./:
|
||||
log.Info("using Mainnet ENS contract address", "addr", ens.MainNetAddress)
|
||||
return ens.MainNetAddress, nil
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue