Scrypt hashing is working now
[NovacoinLibrary.git] / NovacoinTest / Program.cs
index f354961..b74e14a 100644 (file)
@@ -6,6 +6,7 @@ using System.Text;
 namespace NovacoinTest
 {
     using Novacoin;
+    using System.Collections.Generic;
 
     class Program
     {
@@ -70,6 +71,10 @@ namespace NovacoinTest
             Console.WriteLine("Hard-Coded privkey address: {0}", keyPair4.GetKeyID().ToString());
             Console.WriteLine("Hard-Coded privkey: {0}\n", keyPair4.ToString());
 
+            // Privkey hex deserialization test
+            CKeyPair keyPair5 = new CKeyPair(keyPair4.Secret.ToArray());
+            Console.WriteLine("Decoded privkey in Hex: {0}", keyPair5.ToHex());
+            Console.WriteLine("Decoded privkey address: {0}\n", keyPair5.GetKeyID().ToString());
 
             /// ECDSA keypair signing test
 
@@ -94,6 +99,12 @@ namespace NovacoinTest
             CNovacoinAddress donationAddress = new CNovacoinAddress(strDonationAddress);
             Console.WriteLine("Address reserialization is OK: {0}", donationAddress.ToString() == pubKeyTest.GetKeyID().ToString());
 
+            /// Block header hashing test
+            IEnumerable<byte> dataBytesForScrypt = b1.header.ToBytes();
+            ScryptHash256 scryptHash = ScryptHash256.Compute256(dataBytesForScrypt);
+
+            Console.WriteLine("block1 header hash: {0}", scryptHash.ToString());
+
             Console.ReadLine();
         }
     }