diff options
| author | Jim Posen <[email protected]> | 2018-08-27 15:08:31 -0700 |
|---|---|---|
| committer | Jim Posen <[email protected]> | 2018-11-06 09:12:54 -0800 |
| commit | c30620983d2e2c9aee6f52878ed14ba685e8683e (patch) | |
| tree | ef4dc2869290ff9b0f3902c710ba8d94fdeccc64 /src/test | |
| parent | blockfilter: Refactor GCS params into struct. (diff) | |
| download | discoin-c30620983d2e2c9aee6f52878ed14ba685e8683e.tar.xz discoin-c30620983d2e2c9aee6f52878ed14ba685e8683e.zip | |
blockfilter: Additional constructors for BlockFilter.
Diffstat (limited to 'src/test')
| -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 69149fad4..625362f44 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) |