Hash comparison operations
[NovacoinLibrary.git] / NovacoinTest / Program.cs
index 7a2c23f..6f2f8e1 100644 (file)
@@ -270,6 +270,20 @@ namespace NovacoinTest
             keyStore.ResetPool();
             Console.WriteLine("Done in {0} ms.", watch.ElapsedMilliseconds);
 
+            Console.WriteLine("Hash comparison tests:");
+
+            ScryptHash256 hash1 = b1.header.Hash;
+            ScryptHash256 hash2 = b2.header.Hash;
+            ScryptHash256 hash3 = veryBigBlock.header.Hash;
+
+            Console.WriteLine("{0} < {1} : {2}", hash1.ToString(), hash2.ToString(), hash1 < hash2);
+            Console.WriteLine("{0} > {1} : {2}", hash1.ToString(), hash2.ToString(), hash1 > hash2);
+            Console.WriteLine("{0} <= {1} : {2}", hash1.ToString(), hash2.ToString(), hash1 <= hash2);
+            Console.WriteLine("{0} >= {1} : {2}", hash1.ToString(), hash2.ToString(), hash1 >= hash2);
+
+            Console.WriteLine("{0} != {1} : {2}", hash1.ToString(), hash2.ToString(), hash1 != hash2);
+            Console.WriteLine("{0} == {1} : {2}", hash3.ToString(), hash3.ToString(), hash3 == hash3);
+
             /* 
             Console.WriteLine("Reading the block file...");
             var bs = new CBlockStore();