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 /dex/protocol_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 'dex/protocol_test.go')
-rw-r--r-- | dex/protocol_test.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/dex/protocol_test.go b/dex/protocol_test.go index 422824559..23b2c4248 100644 --- a/dex/protocol_test.go +++ b/dex/protocol_test.go @@ -69,19 +69,15 @@ func testStatusMsgErrors(t *testing.T, protocol int) { wantError: errResp(ErrNoStatusMsg, "first msg has code 2 (!= 0)"), }, { - code: StatusMsg, data: statusData{10, DefaultConfig.NetworkId, dMoment, number, 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, dMoment, number, 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, 123450, number, head.Hash(), genesis.Hash()}, - wantError: errResp(ErrDMomentMismatch, "123450 (!= %d)", dMoment), - }, - { - code: StatusMsg, data: statusData{uint32(protocol), DefaultConfig.NetworkId, dMoment, number, 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]), }, } |