public void AppendLeafAndDraw(DemoMerkleTree tree, int content)
 {
     Output.WriteLine($"Append {content}");
     tree.AppendLeaf(DemoMerkleNode.Create(content.ToString()).SetText(content.AsAlphaChar()));
     tree.BuildTree();
     DrawNode(tree.RootNode);
     Output.WriteLine("");
 }
        public void TreeTest(int nodeCount)
        {
            var demo = new Demo();
            var tree = new DemoMerkleTree();

            demo.CreateTree(tree, nodeCount);
            DrawNode(tree.RootNode);
            Assert.True(true);
        }
        public void TreeIncrementalPersistTest()
        {
            var tree = new DemoMerkleTree();

            for (int i = 0; i <= 64; i++)
            {
                AppendLeafAndDraw(tree, i);
            }
            Assert.True(true);
        }
        public void CompareCliftonMerkleToDebugEventMerkle_Test(int leafCount)
        {
            var demo        = new Demo();
            var cliftonTree = new DemoMerkleTree();

            demo.CreateTree(cliftonTree, leafCount);

            var appendTree = new EventMerkleTree();

            for (int i = 0; i < leafCount; i++)
            {
                var newLeafNode = EventMerkleNode.Create(i.ToString()).SetText(i.ToString("X"));
                appendTree.AppendLeaf(newLeafNode);
            }

            Assert.Equal(cliftonTree.RootNode.Hash.ToString(), appendTree.RootNode.Hash.ToString());
            if (leafCount > 1)
            {
                Assert.Equal(((DemoMerkleNode)cliftonTree.RootNode).Text, ((EventMerkleNode)appendTree.RootNode).Text);
            }
        }