Changeset View
Changeset View
Standalone View
Standalone View
src/test/bloom_tests.cpp
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | BOOST_AUTO_TEST_CASE(bloom_create_insert_serialize_with_tweak) { | ||||
BOOST_CHECK_EQUAL_COLLECTIONS(stream.begin(), stream.end(), | BOOST_CHECK_EQUAL_COLLECTIONS(stream.begin(), stream.end(), | ||||
expected.begin(), expected.end()); | expected.begin(), expected.end()); | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(bloom_create_insert_key) { | BOOST_AUTO_TEST_CASE(bloom_create_insert_key) { | ||||
std::string strSecret = | std::string strSecret = | ||||
std::string("5Kg1gnAjaLfKiwhhPpGS3QfRg2m6awQvaj98JCZBZQ5SuS2F15C"); | std::string("5Kg1gnAjaLfKiwhhPpGS3QfRg2m6awQvaj98JCZBZQ5SuS2F15C"); | ||||
CBitcoinSecret vchSecret; | CKey key = DecodeSecret(strSecret); | ||||
BOOST_CHECK(vchSecret.SetString(strSecret)); | |||||
CKey key = vchSecret.GetKey(); | |||||
CPubKey pubkey = key.GetPubKey(); | CPubKey pubkey = key.GetPubKey(); | ||||
std::vector<uint8_t> vchPubKey(pubkey.begin(), pubkey.end()); | std::vector<uint8_t> vchPubKey(pubkey.begin(), pubkey.end()); | ||||
CBloomFilter filter(2, 0.001, 0, BLOOM_UPDATE_ALL); | CBloomFilter filter(2, 0.001, 0, BLOOM_UPDATE_ALL); | ||||
filter.insert(vchPubKey); | filter.insert(vchPubKey); | ||||
uint160 hash = pubkey.GetID(); | uint160 hash = pubkey.GetID(); | ||||
filter.insert(std::vector<uint8_t>(hash.begin(), hash.end())); | filter.insert(std::vector<uint8_t>(hash.begin(), hash.end())); | ||||
▲ Show 20 Lines • Show All 1,155 Lines • Show Last 20 Lines |