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:
parent
5990853de3
commit
8b44cc7072
|
@ -310,5 +310,15 @@ TEST(orchardMerkleTree, appendBundle) {
|
||||||
uint256 anchor(merkle_roots_orchard[i].anchor);
|
uint256 anchor(merkle_roots_orchard[i].anchor);
|
||||||
|
|
||||||
ASSERT_EQ(newTree.root(), 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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue