MCPcopy Create free account
hub / github.com/ElementsProject/elements / PollutePubKey

Function PollutePubKey

src/wallet/test/wallet_tests.cpp:468–475  ·  view source on GitHub ↗

Cryptographically invalidate a PubKey whilst keeping length and first byte

Source from the content-addressed store, hash-verified

466
467// Cryptographically invalidate a PubKey whilst keeping length and first byte
468static void PollutePubKey(CPubKey& pubkey)
469{
470 std::vector<unsigned char> pubkey_raw(pubkey.begin(), pubkey.end());
471 std::fill(pubkey_raw.begin()+1, pubkey_raw.end(), 0);
472 pubkey = CPubKey(pubkey_raw);
473 assert(!pubkey.IsFullyValid());
474 assert(pubkey.IsValid());
475}
476
477// Test watch-only logic for PubKeys
478BOOST_AUTO_TEST_CASE(WatchOnlyPubKeys)

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 5

IsFullyValidMethod · 0.80
CPubKeyClass · 0.50
beginMethod · 0.45
endMethod · 0.45
IsValidMethod · 0.45

Tested by

no test coverage detected