Optimise serialization of MerklePath, avoiding ambiguity of std::vector<bool>

The serialization enforces a maximum supported Merkle tree depth of 64.

Closes #2831.
This commit is contained in:
Jack Grigg
2017-12-22 20:44:35 +00:00
parent 7346f09026
commit d58ed91af0
4 changed files with 146 additions and 134 deletions

View File

@@ -40,16 +40,6 @@ void expect_deser_same(const ZCTestingIncrementalWitness& expected)
// canonical serialized representation.
}
template<>
void expect_deser_same(const libzcash::MerklePath& expected)
{
// This deserialization check is pointless for MerklePath,
// since we only serialize it to check it against test
// vectors. See `expect_test_vector` for that. Also,
// it doesn't seem that vector<bool> can be properly
// deserialized by Bitcoin's serialization code.
}
template<typename A, typename B, typename C>
void expect_ser_test_vector(B& b, const C& c, const A& tree) {
expect_test_vector<B, C>(b, c);