コード例 #1
0
 public void InvalidPrivateKeyWIFChecksum()
 {
     // Changed last character from "C" to "D" to modify checksum.
     (BitcoinAddress address, String result) = BitcoinAddress.CreateAddressFromPrivateKeyWIF("Kx45GeUBSMPReYQwgXiKhG9FzNXrnCeutJp4yjTd5kKxCitadm3D", NetworkType.Main);
     Assert.IsNull(address);
     Assert.AreEqual(result, "WIF private key did not pass checksum test.");
 }
コード例 #2
0
 public void GenerateAddressFromKnownGoodPrivateKeyWIF()
 {
     (BitcoinAddress address, String result) = BitcoinAddress.CreateAddressFromPrivateKeyWIF("Kx45GeUBSMPReYQwgXiKhG9FzNXrnCeutJp4yjTd5kKxCitadm3C", NetworkType.Main);
     Assert.IsNotNull(address);
     Assert.AreEqual(address.PrivateKey, "18e14a7b6a307f426a94f8114701e7c8e774e7f9a47e2c2035db29a206321725");
     Assert.AreEqual(address.P2PKHAddress, "1PMycacnJaSqwwJqjawXBErnLsZ7RkXUAs");
     Assert.AreEqual(address.P2SHAddress, "3BxwGNjvG4CP14tAZodgYyZ7UTjruYDyAM");
 }