mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Use DataStream where possible
This commit is contained in:
@@ -310,7 +310,7 @@ BOOST_AUTO_TEST_CASE(TransactionsRequestSerializationTest) {
|
||||
req1.indexes[2] = 3;
|
||||
req1.indexes[3] = 4;
|
||||
|
||||
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
|
||||
DataStream stream{};
|
||||
stream << req1;
|
||||
|
||||
BlockTransactionsRequest req2;
|
||||
@@ -330,7 +330,7 @@ BOOST_AUTO_TEST_CASE(TransactionsRequestDeserializationMaxTest) {
|
||||
req0.blockhash = InsecureRand256();
|
||||
req0.indexes.resize(1);
|
||||
req0.indexes[0] = 0xffff;
|
||||
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
|
||||
DataStream stream{};
|
||||
stream << req0;
|
||||
|
||||
BlockTransactionsRequest req1;
|
||||
@@ -350,7 +350,7 @@ BOOST_AUTO_TEST_CASE(TransactionsRequestDeserializationOverflowTest) {
|
||||
req0.indexes[0] = 0x7000;
|
||||
req0.indexes[1] = 0x10000 - 0x7000 - 2;
|
||||
req0.indexes[2] = 0;
|
||||
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
|
||||
DataStream stream{};
|
||||
stream << req0.blockhash;
|
||||
WriteCompactSize(stream, req0.indexes.size());
|
||||
WriteCompactSize(stream, req0.indexes[0]);
|
||||
|
||||
Reference in New Issue
Block a user