Changeset View
Changeset View
Standalone View
Standalone View
src/test/fuzz/key.cpp
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | const CPubKey pubkey = key.GetPubKey(); | ||||
assert(pubkey.size() == 33); | assert(pubkey.size() == 33); | ||||
assert(key.VerifyPubKey(pubkey)); | assert(key.VerifyPubKey(pubkey)); | ||||
assert(pubkey.GetHash() != random_uint256); | assert(pubkey.GetHash() != random_uint256); | ||||
assert(pubkey.begin() + pubkey.size() == pubkey.end()); | assert(pubkey.begin() + pubkey.size() == pubkey.end()); | ||||
assert(pubkey.data() == pubkey.begin()); | assert(pubkey.data() == pubkey.begin()); | ||||
assert(pubkey.IsCompressed()); | assert(pubkey.IsCompressed()); | ||||
assert(pubkey.IsValid()); | assert(pubkey.IsValid()); | ||||
assert(pubkey.IsFullyValid()); | assert(pubkey.IsFullyValid()); | ||||
assert(HexToPubKey(HexStr(pubkey.begin(), pubkey.end())) == pubkey); | assert(HexToPubKey(HexStr(pubkey)) == pubkey); | ||||
assert(GetAllDestinationsForKey(pubkey).size() == 1); | assert(GetAllDestinationsForKey(pubkey).size() == 1); | ||||
} | } | ||||
{ | { | ||||
CDataStream data_stream{SER_NETWORK, INIT_PROTO_VERSION}; | CDataStream data_stream{SER_NETWORK, INIT_PROTO_VERSION}; | ||||
pubkey.Serialize(data_stream); | pubkey.Serialize(data_stream); | ||||
CPubKey pubkey_deserialized; | CPubKey pubkey_deserialized; | ||||
▲ Show 20 Lines • Show All 222 Lines • Show Last 20 Lines |