Commit graph

8 commits

Author SHA1 Message Date
Dave Collins
3a1009529f goimports -w . 2014-07-02 19:43:33 -05:00
Dave Collins
ee46a0b108 Use bytes.NewReader for deserialize when possible.
Rather than using bytes.NewBuffer, which is a read/write entity
(io.ReadWriter), use bytes.NewReader which is only a read entitiy
(io.Reader) in all cases where it is possible.  Benchmarking shows it's
slightly faster and it's also technically more accurate since it ensures
the data is read-only.

There are a few cases where bytes.NewBuffer must still be used since a
buffer with a known length is required for those instances.
2014-06-04 23:39:03 -05:00
Dave Collins
dfdd223223 Move genesis blocks to btcnet package.
The genesis blocks are not really part of the wire protocol rather they
are part of a network parameters.  Thus, this commit moves the all of the
gensis blocks and tests to the btcnet package.

Also, create variables in the test package for the mainnet genesis hash,
merkle root, and coinbase transaction for use throughout the tests since
they the exported values are no longer available.
2014-05-28 09:14:38 -05:00
Dave Collins
6c7f45fdb7 Add 2014 to copyright dates. 2014-01-08 23:44:08 -06:00
Dave Collins
7385f6ff24 Correct several test error messages. 2013-05-11 12:55:50 -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
e026f50486 Improve MsgGetBlocks tests.
This commit corrects the MsgGetBlocks tests so that the protocol version
in the multiLocators data matches the wire encoded test data.  This will
help future proof the tests against protocol changes.  Also, while here
modify the casing of the local vars to be consistent.
2013-05-10 00:44:55 -05:00
Dave Collins
69b27dd5d3 Initial implementation. 2013-05-08 18:58:29 -05:00