refactor: SpanReader without nVersion

The field is unused, so remove it.

This is also required for future commits.
This commit is contained in:
MarcoFalke
2023-11-17 16:32:29 +01:00
parent c252a0fc0f
commit fac39b56b7
9 changed files with 25 additions and 34 deletions

View File

@@ -125,7 +125,7 @@ BOOST_AUTO_TEST_CASE(streams_vector_reader)
{
std::vector<unsigned char> vch = {1, 255, 3, 4, 5, 6};
SpanReader reader{INIT_PROTO_VERSION, vch};
SpanReader reader{vch};
BOOST_CHECK_EQUAL(reader.size(), 6U);
BOOST_CHECK(!reader.empty());
@@ -155,7 +155,7 @@ BOOST_AUTO_TEST_CASE(streams_vector_reader)
BOOST_CHECK_THROW(reader >> d, std::ios_base::failure);
// Read a 4 bytes as a signed int from the beginning of the buffer.
SpanReader new_reader{INIT_PROTO_VERSION, vch};
SpanReader new_reader{vch};
new_reader >> d;
BOOST_CHECK_EQUAL(d, 67370753); // 1,255,3,4 in little-endian base-256
BOOST_CHECK_EQUAL(new_reader.size(), 2U);
@@ -169,7 +169,7 @@ BOOST_AUTO_TEST_CASE(streams_vector_reader)
BOOST_AUTO_TEST_CASE(streams_vector_reader_rvalue)
{
std::vector<uint8_t> data{0x82, 0xa7, 0x31};
SpanReader reader{INIT_PROTO_VERSION, data};
SpanReader reader{data};
uint32_t varint = 0;
// Deserialize into r-value
reader >> VARINT(varint);