diff options
author | Sonic <sonic@dexon.org> | 2018-12-04 16:13:41 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:54 +0800 |
commit | dbdeb63000ae5626806432137799d560e19d33d0 (patch) | |
tree | 8c6d7614b4fd018cd9d9804786c729e0df85a8f8 /dex/helper_test.go | |
parent | 6de8d29263b2c184ddd0506d05a18d33554d9788 (diff) | |
download | dexon-dbdeb63000ae5626806432137799d560e19d33d0.tar dexon-dbdeb63000ae5626806432137799d560e19d33d0.tar.gz dexon-dbdeb63000ae5626806432137799d560e19d33d0.tar.bz2 dexon-dbdeb63000ae5626806432137799d560e19d33d0.tar.lz dexon-dbdeb63000ae5626806432137799d560e19d33d0.tar.xz dexon-dbdeb63000ae5626806432137799d560e19d33d0.tar.zst dexon-dbdeb63000ae5626806432137799d560e19d33d0.zip |
dex: replace total difficulty with block number (#73)
In dexon, we don't "mine" and the blockchain won't and shouldn't fork, so
there is no difficulty concept, just replace it with block number.
Note: this commit only replace total difficulty related logic and code
in dex, dex/downloader package.
Diffstat (limited to 'dex/helper_test.go')
-rw-r--r-- | dex/helper_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/dex/helper_test.go b/dex/helper_test.go index abe0f6b89..62dd6c5f4 100644 --- a/dex/helper_test.go +++ b/dex/helper_test.go @@ -264,20 +264,20 @@ func newTestPeer(name string, version int, pm *ProtocolManager, shake bool) (*te var ( genesis = pm.blockchain.Genesis() head = pm.blockchain.CurrentHeader() - td = pm.blockchain.GetTd(head.Hash(), head.Number.Uint64()) + number = head.Number.Uint64() ) - tp.handshake(nil, td, 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, td *big.Int, 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, - TD: td, + Number: number, CurrentBlock: head, GenesisBlock: genesis, } |