Пример #1
0
        public void LeftHashVerificationTest()
        {
            MerkleNode parentNode = new MerkleNode();
            MerkleNode leftNode   = new MerkleNode();

            leftNode.ComputeHash(Encoding.UTF8.GetBytes("abc"));
            parentNode.SetLeftNode(leftNode);
            parentNode.VerifyHash().Should().BeTrue();
        }
Пример #2
0
        public void VerifyTwoLevelTree()
        {
            MerkleNode parentNode1 = CreateParentNode("abc", "def");
            MerkleNode parentNode2 = CreateParentNode("123", "456");
            MerkleNode rootNode    = new MerkleNode();

            rootNode.SetLeftNode(parentNode1);
            rootNode.SetRightNode(parentNode2);
            rootNode.VerifyHash().Should().BeTrue();
        }
Пример #3
0
        public void VerifyLeftHash()
        {
            MerkleNode left = new MerkleNode();

            left.Hash = new MerkleHash("aelf");

            MerkleNode parent = new MerkleNode();

            parent.SetLeftNode(left);

            Assert.True(parent.VerifyHash());
        }
Пример #4
0
        public void LeftRightHashVerificationTest()
        {
            MerkleNode parentNode = CreateParentNode("abc", "def");

            parentNode.VerifyHash().Should().BeTrue();
        }
Пример #5
0
        public void VerifyHash()
        {
            MerkleNode parent = CreateNode("ae", "lf");

            Assert.True(parent.VerifyHash());
        }
Пример #6
0
        public void LeftRightHashVerificationTest()
        {
            MerkleNode parentNode = CreateParentNode("abc", "def");

            Assert.True(parentNode.VerifyHash());
        }