@@ -36,42 +36,42 @@ BOOST_AUTO_TEST_CASE(bloom_create_insert_serialize)
3636{
3737 CBloomFilter filter (3 , 0.01 , 0 , BLOOM_UPDATE_ALL);
3838
39- BOOST_CHECK_MESSAGE ( !filter.contains (ParseHex ( " 99108ad8ed9bb6274d3980bab5a85c048f0950c8" ) ), " Bloom filter should be empty!" );
40- filter.insert (ParseHex ( " 99108ad8ed9bb6274d3980bab5a85c048f0950c8" ) );
41- BOOST_CHECK_MESSAGE ( filter.contains (ParseHex ( " 99108ad8ed9bb6274d3980bab5a85c048f0950c8" ) ), " Bloom filter doesn't contain just-inserted object!" );
39+ BOOST_CHECK_MESSAGE ( !filter.contains (" 99108ad8ed9bb6274d3980bab5a85c048f0950c8" _hex_u8 ), " Bloom filter should be empty!" );
40+ filter.insert (" 99108ad8ed9bb6274d3980bab5a85c048f0950c8" _hex_u8 );
41+ BOOST_CHECK_MESSAGE ( filter.contains (" 99108ad8ed9bb6274d3980bab5a85c048f0950c8" _hex_u8 ), " Bloom filter doesn't contain just-inserted object!" );
4242 // One bit different in first byte
43- BOOST_CHECK_MESSAGE (!filter.contains (ParseHex ( " 19108ad8ed9bb6274d3980bab5a85c048f0950c8" ) ), " Bloom filter contains something it shouldn't!" );
43+ BOOST_CHECK_MESSAGE (!filter.contains (" 19108ad8ed9bb6274d3980bab5a85c048f0950c8" _hex_u8 ), " Bloom filter contains something it shouldn't!" );
4444
45- filter.insert (ParseHex ( " b5a2c786d9ef4658287ced5914b37a1b4aa32eee" ) );
46- BOOST_CHECK_MESSAGE (filter.contains (ParseHex ( " b5a2c786d9ef4658287ced5914b37a1b4aa32eee" ) ), " Bloom filter doesn't contain just-inserted object (2)!" );
45+ filter.insert (" b5a2c786d9ef4658287ced5914b37a1b4aa32eee" _hex_u8 );
46+ BOOST_CHECK_MESSAGE (filter.contains (" b5a2c786d9ef4658287ced5914b37a1b4aa32eee" _hex_u8 ), " Bloom filter doesn't contain just-inserted object (2)!" );
4747
48- filter.insert (ParseHex ( " b9300670b4c5366e95b2699e8b18bc75e5f729c5" ) );
49- BOOST_CHECK_MESSAGE (filter.contains (ParseHex ( " b9300670b4c5366e95b2699e8b18bc75e5f729c5" ) ), " Bloom filter doesn't contain just-inserted object (3)!" );
48+ filter.insert (" b9300670b4c5366e95b2699e8b18bc75e5f729c5" _hex_u8 );
49+ BOOST_CHECK_MESSAGE (filter.contains (" b9300670b4c5366e95b2699e8b18bc75e5f729c5" _hex_u8 ), " Bloom filter doesn't contain just-inserted object (3)!" );
5050
5151 DataStream stream{};
5252 stream << filter;
5353
5454 constexpr auto expected{" 03614e9b050000000000000001" _hex};
5555 BOOST_CHECK_EQUAL_COLLECTIONS (stream.begin (), stream.end (), expected.begin (), expected.end ());
5656
57- BOOST_CHECK_MESSAGE ( filter.contains (ParseHex ( " 99108ad8ed9bb6274d3980bab5a85c048f0950c8" ) ), " Bloom filter doesn't contain just-inserted object!" );
57+ BOOST_CHECK_MESSAGE ( filter.contains (" 99108ad8ed9bb6274d3980bab5a85c048f0950c8" _hex_u8 ), " Bloom filter doesn't contain just-inserted object!" );
5858}
5959
6060BOOST_AUTO_TEST_CASE (bloom_create_insert_serialize_with_tweak)
6161{
6262 // Same test as bloom_create_insert_serialize, but we add a nTweak of 100
6363 CBloomFilter filter (3 , 0.01 , 2147483649UL , BLOOM_UPDATE_ALL);
6464
65- filter.insert (ParseHex ( " 99108ad8ed9bb6274d3980bab5a85c048f0950c8" ) );
66- BOOST_CHECK_MESSAGE ( filter.contains (ParseHex ( " 99108ad8ed9bb6274d3980bab5a85c048f0950c8" ) ), " Bloom filter doesn't contain just-inserted object!" );
65+ filter.insert (" 99108ad8ed9bb6274d3980bab5a85c048f0950c8" _hex_u8 );
66+ BOOST_CHECK_MESSAGE ( filter.contains (" 99108ad8ed9bb6274d3980bab5a85c048f0950c8" _hex_u8 ), " Bloom filter doesn't contain just-inserted object!" );
6767 // One bit different in first byte
68- BOOST_CHECK_MESSAGE (!filter.contains (ParseHex ( " 19108ad8ed9bb6274d3980bab5a85c048f0950c8" ) ), " Bloom filter contains something it shouldn't!" );
68+ BOOST_CHECK_MESSAGE (!filter.contains (" 19108ad8ed9bb6274d3980bab5a85c048f0950c8" _hex_u8 ), " Bloom filter contains something it shouldn't!" );
6969
70- filter.insert (ParseHex ( " b5a2c786d9ef4658287ced5914b37a1b4aa32eee" ) );
71- BOOST_CHECK_MESSAGE (filter.contains (ParseHex ( " b5a2c786d9ef4658287ced5914b37a1b4aa32eee" ) ), " Bloom filter doesn't contain just-inserted object (2)!" );
70+ filter.insert (" b5a2c786d9ef4658287ced5914b37a1b4aa32eee" _hex_u8 );
71+ BOOST_CHECK_MESSAGE (filter.contains (" b5a2c786d9ef4658287ced5914b37a1b4aa32eee" _hex_u8 ), " Bloom filter doesn't contain just-inserted object (2)!" );
7272
73- filter.insert (ParseHex ( " b9300670b4c5366e95b2699e8b18bc75e5f729c5" ) );
74- BOOST_CHECK_MESSAGE (filter.contains (ParseHex ( " b9300670b4c5366e95b2699e8b18bc75e5f729c5" ) ), " Bloom filter doesn't contain just-inserted object (3)!" );
73+ filter.insert (" b9300670b4c5366e95b2699e8b18bc75e5f729c5" _hex_u8 );
74+ BOOST_CHECK_MESSAGE (filter.contains (" b9300670b4c5366e95b2699e8b18bc75e5f729c5" _hex_u8 ), " Bloom filter doesn't contain just-inserted object (3)!" );
7575
7676 DataStream stream{};
7777 stream << filter;
@@ -119,24 +119,24 @@ BOOST_AUTO_TEST_CASE(bloom_match)
119119
120120 filter = CBloomFilter (10 , 0.000001 , 0 , BLOOM_UPDATE_ALL);
121121 // byte-reversed tx hash
122- filter.insert (ParseHex ( " 6bff7fcd4f8565ef406dd5d63d4ff94f318fe82027fd4dc451b04474019f74b4" ) );
122+ filter.insert (" 6bff7fcd4f8565ef406dd5d63d4ff94f318fe82027fd4dc451b04474019f74b4" _hex_u8 );
123123 BOOST_CHECK_MESSAGE (filter.IsRelevantAndUpdate (tx), " Simple Bloom filter didn't match manually serialized tx hash" );
124124
125125 filter = CBloomFilter (10 , 0.000001 , 0 , BLOOM_UPDATE_ALL);
126- filter.insert (ParseHex ( " 30450220070aca44506c5cef3a16ed519d7c3c39f8aab192c4e1c90d065f37b8a4af6141022100a8e160b856c2d43d27d8fba71e5aef6405b8643ac4cb7cb3c462aced7f14711a01" ) );
126+ filter.insert (" 30450220070aca44506c5cef3a16ed519d7c3c39f8aab192c4e1c90d065f37b8a4af6141022100a8e160b856c2d43d27d8fba71e5aef6405b8643ac4cb7cb3c462aced7f14711a01" _hex_u8 );
127127 BOOST_CHECK_MESSAGE (filter.IsRelevantAndUpdate (tx), " Simple Bloom filter didn't match input signature" );
128128
129129 filter = CBloomFilter (10 , 0.000001 , 0 , BLOOM_UPDATE_ALL);
130- filter.insert (ParseHex ( " 046d11fee51b0e60666d5049a9101a72741df480b96ee26488a4d3466b95c9a40ac5eeef87e10a5cd336c19a84565f80fa6c547957b7700ff4dfbdefe76036c339" ) );
130+ filter.insert (" 046d11fee51b0e60666d5049a9101a72741df480b96ee26488a4d3466b95c9a40ac5eeef87e10a5cd336c19a84565f80fa6c547957b7700ff4dfbdefe76036c339" _hex_u8 );
131131 BOOST_CHECK_MESSAGE (filter.IsRelevantAndUpdate (tx), " Simple Bloom filter didn't match input pub key" );
132132
133133 filter = CBloomFilter (10 , 0.000001 , 0 , BLOOM_UPDATE_ALL);
134- filter.insert (ParseHex ( " 04943fdd508053c75000106d3bc6e2754dbcff19" ) );
134+ filter.insert (" 04943fdd508053c75000106d3bc6e2754dbcff19" _hex_u8 );
135135 BOOST_CHECK_MESSAGE (filter.IsRelevantAndUpdate (tx), " Simple Bloom filter didn't match output address" );
136136 BOOST_CHECK_MESSAGE (filter.IsRelevantAndUpdate (spendingTx), " Simple Bloom filter didn't add output" );
137137
138138 filter = CBloomFilter (10 , 0.000001 , 0 , BLOOM_UPDATE_ALL);
139- filter.insert (ParseHex ( " a266436d2965547608b9e15d9032a7b9d64fa431" ) );
139+ filter.insert (" a266436d2965547608b9e15d9032a7b9d64fa431" _hex_u8 );
140140 BOOST_CHECK_MESSAGE (filter.IsRelevantAndUpdate (tx), " Simple Bloom filter didn't match output address" );
141141
142142 filter = CBloomFilter (10 , 0.000001 , 0 , BLOOM_UPDATE_ALL);
@@ -158,7 +158,7 @@ BOOST_AUTO_TEST_CASE(bloom_match)
158158 BOOST_CHECK_MESSAGE (!filter.IsRelevantAndUpdate (tx), " Simple Bloom filter matched random tx hash" );
159159
160160 filter = CBloomFilter (10 , 0.000001 , 0 , BLOOM_UPDATE_ALL);
161- filter.insert (ParseHex ( " 0000006d2965547608b9e15d9032a7b9d64fa431" ) );
161+ filter.insert (" 0000006d2965547608b9e15d9032a7b9d64fa431" _hex_u8 );
162162 BOOST_CHECK_MESSAGE (!filter.IsRelevantAndUpdate (tx), " Simple Bloom filter matched random address" );
163163
164164 filter = CBloomFilter (10 , 0.000001 , 0 , BLOOM_UPDATE_ALL);
@@ -244,7 +244,7 @@ BOOST_AUTO_TEST_CASE(merkle_block_2)
244244 // Match an output from the second transaction (the pubkey for address 1DZTzaBHUDM7T3QvUKBz4qXMRpkg8jsfB5)
245245 // This should match the third transaction because it spends the output matched
246246 // It also matches the fourth transaction, which spends to the pubkey again
247- filter.insert (ParseHex ( " 044a656f065871a353f216ca26cef8dde2f03e8c16202d2e8ad769f02032cb86a5eb5e56842e92e19141d60a01928f8dd2c875a390f67c1f6c94cfc617c0ea45af" ) );
247+ filter.insert (" 044a656f065871a353f216ca26cef8dde2f03e8c16202d2e8ad769f02032cb86a5eb5e56842e92e19141d60a01928f8dd2c875a390f67c1f6c94cfc617c0ea45af" _hex_u8 );
248248
249249 merkleBlock = CMerkleBlock (block, filter);
250250 BOOST_CHECK (merkleBlock.header .GetHash () == block.GetHash ());
@@ -301,7 +301,7 @@ BOOST_AUTO_TEST_CASE(merkle_block_2_with_update_none)
301301 // Match an output from the second transaction (the pubkey for address 1DZTzaBHUDM7T3QvUKBz4qXMRpkg8jsfB5)
302302 // This should not match the third transaction though it spends the output matched
303303 // It will match the fourth transaction, which has another pay-to-pubkey output to the same address
304- filter.insert (ParseHex ( " 044a656f065871a353f216ca26cef8dde2f03e8c16202d2e8ad769f02032cb86a5eb5e56842e92e19141d60a01928f8dd2c875a390f67c1f6c94cfc617c0ea45af" ) );
304+ filter.insert (" 044a656f065871a353f216ca26cef8dde2f03e8c16202d2e8ad769f02032cb86a5eb5e56842e92e19141d60a01928f8dd2c875a390f67c1f6c94cfc617c0ea45af" _hex_u8 );
305305
306306 merkleBlock = CMerkleBlock (block, filter);
307307 BOOST_CHECK (merkleBlock.header .GetHash () == block.GetHash ());
@@ -418,9 +418,9 @@ BOOST_AUTO_TEST_CASE(merkle_block_4_test_p2pubkey_only)
418418
419419 CBloomFilter filter (10 , 0.000001 , 0 , BLOOM_UPDATE_P2PUBKEY_ONLY);
420420 // Match the generation pubkey
421- filter.insert (ParseHex ( " 04eaafc2314def4ca98ac970241bcab022b9c1e1f4ea423a20f134c876f2c01ec0f0dd5b2e86e7168cefe0d81113c3807420ce13ad1357231a2252247d97a46a91" ) );
421+ filter.insert (" 04eaafc2314def4ca98ac970241bcab022b9c1e1f4ea423a20f134c876f2c01ec0f0dd5b2e86e7168cefe0d81113c3807420ce13ad1357231a2252247d97a46a91" _hex_u8 );
422422 // ...and the output address of the 4th transaction
423- filter.insert (ParseHex ( " b6efd80d99179f4f4ff6f4dd0a007d018c385d21" ) );
423+ filter.insert (" b6efd80d99179f4f4ff6f4dd0a007d018c385d21" _hex_u8 );
424424
425425 CMerkleBlock merkleBlock (block, filter);
426426 BOOST_CHECK (merkleBlock.header .GetHash () == block.GetHash ());
@@ -443,9 +443,9 @@ BOOST_AUTO_TEST_CASE(merkle_block_4_test_update_none)
443443
444444 CBloomFilter filter (10 , 0.000001 , 0 , BLOOM_UPDATE_NONE);
445445 // Match the generation pubkey
446- filter.insert (ParseHex ( " 04eaafc2314def4ca98ac970241bcab022b9c1e1f4ea423a20f134c876f2c01ec0f0dd5b2e86e7168cefe0d81113c3807420ce13ad1357231a2252247d97a46a91" ) );
446+ filter.insert (" 04eaafc2314def4ca98ac970241bcab022b9c1e1f4ea423a20f134c876f2c01ec0f0dd5b2e86e7168cefe0d81113c3807420ce13ad1357231a2252247d97a46a91" _hex_u8 );
447447 // ...and the output address of the 4th transaction
448- filter.insert (ParseHex ( " b6efd80d99179f4f4ff6f4dd0a007d018c385d21" ) );
448+ filter.insert (" b6efd80d99179f4f4ff6f4dd0a007d018c385d21" _hex_u8 );
449449
450450 CMerkleBlock merkleBlock (block, filter);
451451 BOOST_CHECK (merkleBlock.header .GetHash () == block.GetHash ());
0 commit comments