diff options
| author | Jonas Schnelli <[email protected]> | 2015-06-01 16:35:19 +0200 |
|---|---|---|
| committer | Jonas Schnelli <[email protected]> | 2016-04-14 20:56:33 +0200 |
| commit | 90604f16af63ec066d6561337f476ccd8acec326 (patch) | |
| tree | 5cca6f0af2f22330bbf7d7a913b3e10cbcafe868 /src/test/bip32_tests.cpp | |
| parent | Merge #7874: Improve AlreadyHave (diff) | |
| download | discoin-90604f16af63ec066d6561337f476ccd8acec326.tar.xz discoin-90604f16af63ec066d6561337f476ccd8acec326.zip | |
add bip32 pubkey serialization
CExtPubKey should be serializable like CPubKey
Diffstat (limited to 'src/test/bip32_tests.cpp')
| -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 ce29e692d..7f1c2a32d 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); } } |