aboutsummaryrefslogtreecommitdiff
path: root/src/test/bip32_tests.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <jonas.schnelli@include7.ch>2015-06-01 16:35:19 +0200
committerJonas Schnelli <dev@jonasschnelli.ch>2016-04-14 20:56:33 +0200
commit90604f16af63ec066d6561337f476ccd8acec326 (patch)
tree5cca6f0af2f22330bbf7d7a913b3e10cbcafe868 /src/test/bip32_tests.cpp
parente6a4d48a9bff0bdbcca3a13de59b5e6e683a6aac (diff)
downloadbitcoin-90604f16af63ec066d6561337f476ccd8acec326.tar.xz
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.cpp16
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);
}
}