Add a roundtrip test for Orchard merkle frontier serialization from the C++ side.

Co-authored-by: str4d <thestr4d@gmail.com>
This commit is contained in:
Kris Nuttycombe 2022-03-02 14:55:35 -07:00
parent 5990853de3
commit 8b44cc7072
1 changed files with 10 additions and 0 deletions

View File

@ -310,5 +310,15 @@ TEST(orchardMerkleTree, appendBundle) {
uint256 anchor(merkle_roots_orchard[i].anchor);
ASSERT_EQ(newTree.root(), anchor);
// Sanity check roundtrip serialization of the updated tree
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss << newTree;
OrchardMerkleFrontier readBack;
ss >> readBack;
EXPECT_NE(newTree.root(), OrchardMerkleFrontier::empty_root());
EXPECT_EQ(newTree.root(), readBack.root());
}
}