示例#1
0
 public void TestScriptPubKey()
 {
     // Check we can extract the to address
     var pubkeyBytes = Hex.Decode(_pubkeyProg);
     var pubkey = new Script(_params, pubkeyBytes, 0, pubkeyBytes.Length);
     var toAddr = new Address(_params, pubkey.PublicKeyHash);
     Assert.AreEqual("mkFQohBpy2HDXrCwyMrYL5RtfrmeiuuPY2", toAddr.ToString());
 }
示例#2
0
 public void TestScriptSig()
 {
     var sigProgBytes = Hex.Decode(_sigProg);
     var script = new Script(_params, sigProgBytes, 0, sigProgBytes.Length);
     // Test we can extract the from address.
     var hash160 = Utils.Sha256Hash160(script.PublicKey);
     var a = new Address(_params, hash160);
     Assert.AreEqual("mkFQohBpy2HDXrCwyMrYL5RtfrmeiuuPY2", a.ToString());
 }
示例#3
0
        public void TestStringification()
        {
            // Test a test-net address.
            var a = new Address(TestParams, Hex.Decode("fda79a24e50ff70ff42f7d89585da5bd19d9e5cc"));
            Assert.AreEqual("n4eA2nbYqErp7H6jebchxAN59DmNpksexv", a.ToString());

            var b = new Address(ProdParams, Hex.Decode("4a22c3c4cbb31e4d03b15550636762bda0baf85a"));
            Assert.AreEqual("17kzeh4N8g49GFvdDzSf8PjaPfyoD1MndL", b.ToString());
        }