diff options
author | Sonic <sonic@dexon.org> | 2019-02-12 16:16:13 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-03-12 12:19:09 +0800 |
commit | 75b752809c56b4d4e4d1448e6bb5b0c54c4418f0 (patch) | |
tree | e82b9eb37f5d4babf94a0c884cee956dcc5bd85e /dex/handler_test.go | |
parent | 16ae42bce121e4be57309d5953c08b546a903702 (diff) | |
download | dexon-75b752809c56b4d4e4d1448e6bb5b0c54c4418f0.tar dexon-75b752809c56b4d4e4d1448e6bb5b0c54c4418f0.tar.gz dexon-75b752809c56b4d4e4d1448e6bb5b0c54c4418f0.tar.bz2 dexon-75b752809c56b4d4e4d1448e6bb5b0c54c4418f0.tar.lz dexon-75b752809c56b4d4e4d1448e6bb5b0c54c4418f0.tar.xz dexon-75b752809c56b4d4e4d1448e6bb5b0c54c4418f0.tar.zst dexon-75b752809c56b4d4e4d1448e6bb5b0c54c4418f0.zip |
dex: Add a flag to GetBlockHeadersMsg and GetBlockBodiesMsg (#188)
* dex: Add a flag to GetBlockHeadersMsg and GetBlockBodiesMsg
So that we can dispatch the response msg to fetcher or downloader
easily.
* fixup! dex: Add a flag to GetBlockHeadersMsg and GetBlockBodiesMsg
Diffstat (limited to 'dex/handler_test.go')
-rw-r--r-- | dex/handler_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/dex/handler_test.go b/dex/handler_test.go index d8398bd2d..75a57c125 100644 --- a/dex/handler_test.go +++ b/dex/handler_test.go @@ -205,7 +205,7 @@ func testGetBlockHeaders(t *testing.T, protocol int) { } // Send the hash request and verify the response p2p.Send(peer.app, 0x03, tt.query) - if err := p2p.ExpectMsg(peer.app, 0x04, headers); err != nil { + if err := p2p.ExpectMsg(peer.app, 0x04, headersData{Headers: headers}); err != nil { t.Errorf("test %d: headers mismatch: %v", i, err) } // If the test used number origins, repeat with hashes as the too @@ -214,7 +214,7 @@ func testGetBlockHeaders(t *testing.T, protocol int) { tt.query.Origin.Hash, tt.query.Origin.Number = origin.Hash(), 0 p2p.Send(peer.app, 0x03, tt.query) - if err := p2p.ExpectMsg(peer.app, 0x04, headers); err != nil { + if err := p2p.ExpectMsg(peer.app, 0x04, headersData{Headers: headers}); err != nil { t.Errorf("test %d: headers mismatch: %v", i, err) } } @@ -287,8 +287,8 @@ func testGetBlockBodies(t *testing.T, protocol int) { } } // Send the hash request and verify the response - p2p.Send(peer.app, 0x05, hashes) - if err := p2p.ExpectMsg(peer.app, 0x06, bodies); err != nil { + p2p.Send(peer.app, 0x05, []interface{}{downloaderReq, hashes}) + if err := p2p.ExpectMsg(peer.app, 0x06, blockBodiesData{Flag: downloaderReq, Bodies: bodies}); err != nil { t.Errorf("test %d: bodies mismatch: %v", i, err) } } |