From 8f12d76a4723ba011d033533871a0e06e1243d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Tue, 4 Jul 2017 12:28:58 +0300 Subject: params: remove redundant consts, disable metro on AllProtocolChanges --- core/genesis.go | 6 +++--- core/genesis_test.go | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'core') diff --git a/core/genesis.go b/core/genesis.go index 5815d5901..d587011f0 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -143,7 +143,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.MainnetGenesisHash { return storedcfg, stored, nil } @@ -164,9 +164,9 @@ func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig { switch { case g != nil: return g.Config - case ghash == params.MainNetGenesisHash: + case ghash == params.MainnetGenesisHash: return params.MainnetChainConfig - case ghash == params.TestNetGenesisHash: + case ghash == params.TestnetGenesisHash: return params.TestnetChainConfig default: return params.AllProtocolChanges diff --git a/core/genesis_test.go b/core/genesis_test.go index 4312a80b8..bc82fe54e 100644 --- a/core/genesis_test.go +++ b/core/genesis_test.go @@ -32,12 +32,12 @@ import ( func TestDefaultGenesisBlock(t *testing.T) { block, _ := DefaultGenesisBlock().ToBlock() - if block.Hash() != params.MainNetGenesisHash { - t.Errorf("wrong mainnet genesis hash, got %v, want %v", block.Hash(), params.MainNetGenesisHash) + if block.Hash() != params.MainnetGenesisHash { + t.Errorf("wrong mainnet genesis hash, got %v, want %v", block.Hash(), params.MainnetGenesisHash) } block, _ = DefaultTestnetGenesisBlock().ToBlock() - if block.Hash() != params.TestNetGenesisHash { - t.Errorf("wrong testnet genesis hash, got %v, want %v", block.Hash(), params.TestNetGenesisHash) + if block.Hash() != params.TestnetGenesisHash { + t.Errorf("wrong testnet genesis hash, got %v, want %v", block.Hash(), params.TestnetGenesisHash) } } @@ -73,7 +73,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.MainnetGenesisHash, wantConfig: params.MainnetChainConfig, }, { @@ -82,7 +82,7 @@ func TestSetupGenesis(t *testing.T) { DefaultGenesisBlock().MustCommit(db) return SetupGenesisBlock(db, nil) }, - wantHash: params.MainNetGenesisHash, + wantHash: params.MainnetGenesisHash, wantConfig: params.MainnetChainConfig, }, { @@ -100,8 +100,8 @@ func TestSetupGenesis(t *testing.T) { customg.MustCommit(db) return SetupGenesisBlock(db, DefaultTestnetGenesisBlock()) }, - wantErr: &GenesisMismatchError{Stored: customghash, New: params.TestNetGenesisHash}, - wantHash: params.TestNetGenesisHash, + wantErr: &GenesisMismatchError{Stored: customghash, New: params.TestnetGenesisHash}, + wantHash: params.TestnetGenesisHash, wantConfig: params.TestnetChainConfig, }, { -- cgit v1.2.3