diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-03-17 10:43:10 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:23 +0800 |
commit | 5f64e1d10d620a8a299ff3a40695f26107f157c5 (patch) | |
tree | e28e2bf073ac7da8417e5b0789d2d0713e240ae7 /dex/helper_test.go | |
parent | 9493109f2be4507605e6b17e406bf8fd147ab3c8 (diff) | |
download | go-tangerine-5f64e1d10d620a8a299ff3a40695f26107f157c5.tar go-tangerine-5f64e1d10d620a8a299ff3a40695f26107f157c5.tar.gz go-tangerine-5f64e1d10d620a8a299ff3a40695f26107f157c5.tar.bz2 go-tangerine-5f64e1d10d620a8a299ff3a40695f26107f157c5.tar.lz go-tangerine-5f64e1d10d620a8a299ff3a40695f26107f157c5.tar.xz go-tangerine-5f64e1d10d620a8a299ff3a40695f26107f157c5.tar.zst go-tangerine-5f64e1d10d620a8a299ff3a40695f26107f157c5.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 'dex/helper_test.go')
-rw-r--r-- | dex/helper_test.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/dex/helper_test.go b/dex/helper_test.go index c8bf62a6b..4f5541052 100644 --- a/dex/helper_test.go +++ b/dex/helper_test.go @@ -46,8 +46,6 @@ var ( testBank = crypto.PubkeyToAddress(testBankKey.PublicKey) ) -const dMoment = 123456 - // testP2PServer is a fake, helper p2p server for testing purposes. type testP2PServer struct { mu sync.Mutex @@ -135,7 +133,7 @@ func newTestProtocolManager(mode downloader.SyncMode, blocks int, generator func notarySetFunc: func(uint64) (map[string]struct{}, error) { return nil, nil }, } - pm, err := NewProtocolManager(gspec.Config, mode, DefaultConfig.NetworkId, dMoment, evmux, &testTxPool{added: newtx}, engine, blockchain, db, true, tgov, &testApp{}) + pm, err := NewProtocolManager(gspec.Config, mode, DefaultConfig.NetworkId, evmux, &testTxPool{added: newtx}, engine, blockchain, db, true, tgov, &testApp{}) if err != nil { return nil, nil, err } @@ -275,18 +273,17 @@ func newTestPeer(name string, version int, pm *ProtocolManager, shake bool) (*te head = pm.blockchain.CurrentHeader() number = head.Number.Uint64() ) - tp.handshake(nil, dMoment, number, head.Hash(), genesis.Hash()) + tp.handshake(nil, number, head.Hash(), genesis.Hash()) } return tp, errc } // handshake simulates a trivial handshake that expects the same state from the // remote side as we are simulating locally. -func (p *testPeer) handshake(t *testing.T, dMoment uint64, number uint64, head common.Hash, genesis common.Hash) { +func (p *testPeer) handshake(t *testing.T, number uint64, head common.Hash, genesis common.Hash) { msg := &statusData{ ProtocolVersion: uint32(p.version), NetworkId: DefaultConfig.NetworkId, - DMoment: uint64(dMoment), Number: number, CurrentBlock: head, GenesisBlock: genesis, |