Get rid of nType and nVersion
Remove the nType and nVersion as parameters to all serialization methods and functions. There is only one place where it's read and has an impact (in CAddress), and even there it does not impact any of the recursively invoked serializers. Instead, the few places that need nType or nVersion are changed to read it directly from the stream object, through GetType() and GetVersion() methods which are added to all stream classes.
This commit is contained in:
committed by
Jack Grigg
parent
a8e5ae92ba
commit
242f1421db
@@ -41,7 +41,7 @@ BOOST_AUTO_TEST_CASE(bloom_create_insert_serialize)
|
||||
BOOST_CHECK_MESSAGE(filter.contains(ParseHex("b9300670b4c5366e95b2699e8b18bc75e5f729c5")), "BloomFilter doesn't contain just-inserted object (3)!");
|
||||
|
||||
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
|
||||
filter.Serialize(stream, SER_NETWORK, PROTOCOL_VERSION);
|
||||
stream << filter;
|
||||
|
||||
vector<unsigned char> vch = ParseHex("03614e9b050000000000000001");
|
||||
vector<char> expected(vch.size());
|
||||
@@ -73,7 +73,7 @@ BOOST_AUTO_TEST_CASE(bloom_create_insert_serialize_with_tweak)
|
||||
BOOST_CHECK_MESSAGE(filter.contains(ParseHex("b9300670b4c5366e95b2699e8b18bc75e5f729c5")), "BloomFilter doesn't contain just-inserted object (3)!");
|
||||
|
||||
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
|
||||
filter.Serialize(stream, SER_NETWORK, PROTOCOL_VERSION);
|
||||
stream << filter;
|
||||
|
||||
vector<unsigned char> vch = ParseHex("03ce4299050000000100008001");
|
||||
vector<char> expected(vch.size());
|
||||
@@ -100,7 +100,7 @@ BOOST_AUTO_TEST_CASE(bloom_create_insert_key)
|
||||
filter.insert(vector<unsigned char>(hash.begin(), hash.end()));
|
||||
|
||||
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
|
||||
filter.Serialize(stream, SER_NETWORK, PROTOCOL_VERSION);
|
||||
stream << filter;
|
||||
|
||||
vector<unsigned char> vch = ParseHex("038fc16b080000000000000001");
|
||||
vector<char> expected(vch.size());
|
||||
|
||||
Reference in New Issue
Block a user