diff options
author | Jonas Schnelli <jonas.schnelli@include7.ch> | 2015-06-01 16:35:19 +0200 |
---|---|---|
committer | Jonas Schnelli <dev@jonasschnelli.ch> | 2016-04-14 20:56:33 +0200 |
commit | 90604f16af63ec066d6561337f476ccd8acec326 (patch) | |
tree | 5cca6f0af2f22330bbf7d7a913b3e10cbcafe868 /src/test | |
parent | e6a4d48a9bff0bdbcca3a13de59b5e6e683a6aac (diff) |
add bip32 pubkey serialization
CExtPubKey should be serializable like CPubKey
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/bip32_tests.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/bip32_tests.cpp b/src/test/bip32_tests.cpp index ce29e692db..7f1c2a32dd 100644 --- a/src/test/bip32_tests.cpp +++ b/src/test/bip32_tests.cpp @@ -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); } } |