diff options
author | Jim Posen <jim.posen@gmail.com> | 2018-08-27 15:08:31 -0700 |
---|---|---|
committer | Jim Posen <jim.posen@gmail.com> | 2018-11-06 09:12:54 -0800 |
commit | c30620983d2e2c9aee6f52878ed14ba685e8683e (patch) | |
tree | ef4dc2869290ff9b0f3902c710ba8d94fdeccc64 /src/test/blockfilter_tests.cpp | |
parent | 20b812993ae584e4a4b12faa5c8751aa04dfde81 (diff) | |
download | bitcoin-c30620983d2e2c9aee6f52878ed14ba685e8683e.tar.xz |
blockfilter: Additional constructors for BlockFilter.
Diffstat (limited to 'src/test/blockfilter_tests.cpp')
-rw-r--r-- | src/test/blockfilter_tests.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/blockfilter_tests.cpp b/src/test/blockfilter_tests.cpp index 69149fad4f..625362f446 100644 --- a/src/test/blockfilter_tests.cpp +++ b/src/test/blockfilter_tests.cpp @@ -101,6 +101,17 @@ BOOST_AUTO_TEST_CASE(blockfilter_basic_test) for (const CScript& script : excluded_scripts) { BOOST_CHECK(!filter.Match(GCSFilter::Element(script.begin(), script.end()))); } + + // Test serialization/unserialization. + BlockFilter block_filter2; + + CDataStream stream(SER_NETWORK, PROTOCOL_VERSION); + stream << block_filter; + stream >> block_filter2; + + BOOST_CHECK_EQUAL(block_filter.GetFilterType(), block_filter2.GetFilterType()); + BOOST_CHECK_EQUAL(block_filter.GetBlockHash(), block_filter2.GetBlockHash()); + BOOST_CHECK(block_filter.GetEncodedFilter() == block_filter2.GetEncodedFilter()); } BOOST_AUTO_TEST_CASE(blockfilters_json_test) |