diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-03-17 10:43:10 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:58 +0800 |
commit | 64f26af59d24881bcdd49bbdd291c1a21a12b82d (patch) | |
tree | 4968dc2006c6cabd118fc200b85bd05dc180efd0 /core/genesis_test.go | |
parent | 2818ad97f5b302f76e3296195bf8daae1868c435 (diff) | |
download | dexon-64f26af59d24881bcdd49bbdd291c1a21a12b82d.tar dexon-64f26af59d24881bcdd49bbdd291c1a21a12b82d.tar.gz dexon-64f26af59d24881bcdd49bbdd291c1a21a12b82d.tar.bz2 dexon-64f26af59d24881bcdd49bbdd291c1a21a12b82d.tar.lz dexon-64f26af59d24881bcdd49bbdd291c1a21a12b82d.tar.xz dexon-64f26af59d24881bcdd49bbdd291c1a21a12b82d.tar.zst dexon-64f26af59d24881bcdd49bbdd291c1a21a12b82d.zip |
core: fill in genesis timstamp and remove dMoment from protocol handshake (#263)
Fill in dmoment as genesis block timestamp. This allow us to remove
dMoment check from protocol handshake since genesis block hash itself
will protect us against different dMoment.
Diffstat (limited to 'core/genesis_test.go')
-rw-r--r-- | core/genesis_test.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/genesis_test.go b/core/genesis_test.go index de843e05a..16958eac3 100644 --- a/core/genesis_test.go +++ b/core/genesis_test.go @@ -105,6 +105,16 @@ func TestSetupGenesis(t *testing.T) { wantConfig: params.TestnetChainConfig, }, { + name: "custom block in DB, genesis == taipei", + fn: func(db ethdb.Database) (*params.ChainConfig, common.Hash, error) { + customg.MustCommit(db) + return SetupGenesisBlock(db, DefaultTaipeiGenesisBlock()) + }, + wantErr: &GenesisMismatchError{Stored: customghash, New: params.TaipeiGenesisHash}, + wantHash: params.TaipeiGenesisHash, + wantConfig: params.TaipeiChainConfig, + }, + { name: "custom block in DB, genesis == yilan", fn: func(db ethdb.Database) (*params.ChainConfig, common.Hash, error) { customg.MustCommit(db) |