mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
add bip32 pubkey serialization
CExtPubKey should be serializable like CPubKey
This commit is contained in:
committed by
Jonas Schnelli
parent
e6a4d48a9b
commit
90604f16af
@@ -117,6 +117,22 @@ void RunTest(const TestVector &test) {
|
||||
}
|
||||
key = keyNew;
|
||||
pubkey = pubkeyNew;
|
||||
|
||||
CDataStream ssPub(SER_DISK, CLIENT_VERSION);
|
||||
ssPub << pubkeyNew;
|
||||
BOOST_CHECK(ssPub.size() == 75);
|
||||
|
||||
CDataStream ssPriv(SER_DISK, CLIENT_VERSION);
|
||||
ssPriv << keyNew;
|
||||
BOOST_CHECK(ssPriv.size() == 75);
|
||||
|
||||
CExtPubKey pubCheck;
|
||||
CExtKey privCheck;
|
||||
ssPub >> pubCheck;
|
||||
ssPriv >> privCheck;
|
||||
|
||||
BOOST_CHECK(pubCheck == pubkeyNew);
|
||||
BOOST_CHECK(privCheck == keyNew);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user