Commit graph

24 commits

Author SHA1 Message Date
Dave Collins
29eb4d4250 Add tests for new Serialize/Deserialize functions. 2013-08-05 18:08:26 -05:00
Dave Collins
14a1da417f Enforce max block payload size of 1MB.
This commit changes MsgBlock to enforce a 1MB max payload per the spec.
Previously it was only limited to the max overall message size.  While
here, also enforce max payloads per message type (instead of only the max
overall message payload) when writing messages.
2013-05-16 09:07:04 -05:00
Dave Collins
5b78dee7e1 Add negative tests for MsgTx.
This commit adds tests for the error paths when encoding and decoding
MsgTx.  This commit also achieves 100% test coverage.
2013-05-13 02:09:55 -05:00
Dave Collins
f9b6375d5b Add negative tests for MsgVersion.
This commit adds tests for the error paths when encoding and decoding
MsgVersion.
2013-05-12 21:47:36 -05:00
Dave Collins
1bab947596 Remove a few dead error checks.
The functions for generating transaction and block hashes contained a few
error checks for conditions which could never fail without run-time
panics.  This commit removes those superfluous checks and adds explanatory
comments.
2013-05-12 14:01:50 -05:00
Dave Collins
1ca8015ea0 Add negative tests for MsgBlock tx location decode.
This commit adds tests for the error paths when decoding MsgBlock via the
transaction location decode variant.
2013-05-12 12:48:52 -05:00
Dave Collins
4e16030fe8 Add tests for MsgBlock transaction location decode. 2013-05-12 11:52:35 -05:00
Dave Collins
c9d2dfea3d Add negative tests for WriteMessage.
This commit adds tests for the error paths when writing a message
to the wire.
2013-05-11 23:34:10 -05:00
Dave Collins
93070ef960 Add negative tests for MsgAlert.
This commit adds tests for the error paths when encoding and decoding
MsgAlert.
2013-05-11 12:49:22 -05:00
Dave Collins
3d303feefb Add negative test for NewShaHash.
This commit adds a test to ensure NewShaHash fails as expected when the
passed buffer has too many bytes to be a valid sha hash.
2013-05-11 11:19:46 -05:00
Dave Collins
61b86b1bb5 Add negative tests for MsgGetBlocks.
This commit adds tests for the error paths when encoded and decoding
MsgGetBlocks.
2013-05-11 11:06:52 -05:00
Dave Collins
95aa4a7da8 Add negative tests for MsgHeaders.
This commit adds tests for the error paths when encoded and decoding
MsgHeaders.
2013-05-10 23:12:55 -05:00
Dave Collins
88e1d7634f Add negative tests for MsgPong.
This commit adds tests for the error paths when encoded and decoding
MsgPong.
2013-05-10 21:46:41 -05:00
Dave Collins
1220e72f35 Add negative tests for MsgAddr.
This commit adds tests for the error paths when encoded and decoding
MsgAddr.
2013-05-10 18:09:10 -05:00
Dave Collins
2665b4358e Add negative tests for MsgGetData.
This commit adds tests for the error paths when encoded and decoding
MsgGetData.
2013-05-10 13:14:19 -05:00
Dave Collins
0c65e7da89 Add negative tests for MsgNotFound.
This commit adds tests for the error paths when encoded and decoding
MsgNotFound.
2013-05-10 12:51:45 -05:00
Dave Collins
72fa9f4b7b Update test coverage report. 2013-05-10 10:18:34 -05:00
Dave Collins
953a236e2a Add negative tests for MsgBlock.
This commit adds tests for the error paths when encoded and decoding
MsgBlock.
2013-05-10 09:12:46 -05:00
Dave Collins
4aea957b19 Add negative tests for NetAddress.
This commit adds tests for the error paths when encoding and
decoding NetAddress with and without the timestamp field.
2013-05-09 23:01:09 -05:00
Dave Collins
2aee754448 Add test for discarding invalid large messages. 2013-05-09 22:25:21 -05:00
Dave Collins
aa4086a1b1 Update test coverage report. 2013-05-09 21:13:37 -05:00
Dave Collins
6286a39378 Combine readMessage with ReadMessage.
These functions used to be split into multiple files, but since the code
was reorganized there is no longer any reason to split them.
2013-05-09 20:16:46 -05:00
Dave Collins
5e416389b1 Add negative tests for MsgPing.
This commit add tests the error paths when encoding and decoding MsgPing.
2013-05-09 10:42:52 -05:00
Dave Collins
69b27dd5d3 Initial implementation. 2013-05-08 18:58:29 -05:00