diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-04-15 07:56:22 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-04-15 07:59:38 +0200 |
commit | 48c5adfbcea2006dc55011a3d7f27e30fbe4a6b3 (patch) | |
tree | aa97931757b0d32416152502e9cf83060c7ece2c /src/test | |
parent | 53adc8310da32484e7b5be2070c2120acb17fddd (diff) | |
parent | 90604f16af63ec066d6561337f476ccd8acec326 (diff) |
Merge #6215: add bip32 pub key serialization
90604f1 add bip32 pubkey serialization (Jonas Schnelli)
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); } } |