aboutsummaryrefslogtreecommitdiffstats
path: root/dex/protocol_test.go
diff options
context:
space:
mode:
authorSonic <sonic@dexon.org>2018-12-04 16:13:41 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:54 +0800
commitdbdeb63000ae5626806432137799d560e19d33d0 (patch)
tree8c6d7614b4fd018cd9d9804786c729e0df85a8f8 /dex/protocol_test.go
parent6de8d29263b2c184ddd0506d05a18d33554d9788 (diff)
downloaddexon-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/protocol_test.go')
-rw-r--r--dex/protocol_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/dex/protocol_test.go b/dex/protocol_test.go
index 1b380cac7..686ba372f 100644
--- a/dex/protocol_test.go
+++ b/dex/protocol_test.go
@@ -54,7 +54,7 @@ func testStatusMsgErrors(t *testing.T, protocol int) {
var (
genesis = pm.blockchain.Genesis()
head = pm.blockchain.CurrentHeader()
- td = pm.blockchain.GetTd(head.Hash(), head.Number.Uint64())
+ number = head.Number.Uint64()
)
defer pm.Stop()
@@ -68,15 +68,15 @@ func testStatusMsgErrors(t *testing.T, protocol int) {
wantError: errResp(ErrNoStatusMsg, "first msg has code 2 (!= 0)"),
},
{
- code: StatusMsg, data: statusData{10, DefaultConfig.NetworkId, td, head.Hash(), genesis.Hash()},
+ code: StatusMsg, data: statusData{10, DefaultConfig.NetworkId, number, head.Hash(), genesis.Hash()},
wantError: errResp(ErrProtocolVersionMismatch, "10 (!= %d)", protocol),
},
{
- code: StatusMsg, data: statusData{uint32(protocol), 999, td, head.Hash(), genesis.Hash()},
+ code: StatusMsg, data: statusData{uint32(protocol), 999, number, head.Hash(), genesis.Hash()},
wantError: errResp(ErrNetworkIdMismatch, "999 (!= 237)"),
},
{
- code: StatusMsg, data: statusData{uint32(protocol), DefaultConfig.NetworkId, td, head.Hash(), common.Hash{3}},
+ code: StatusMsg, data: statusData{uint32(protocol), DefaultConfig.NetworkId, number, head.Hash(), common.Hash{3}},
wantError: errResp(ErrGenesisBlockMismatch, "0300000000000000 (!= %x)", genesis.Hash().Bytes()[:8]),
},
}