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()); }
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()); }
public void TestIp() { var bytes = Hex.Decode("41043e96222332ea7848323c08116dddafbfa917b8e37f0bdf63841628267148588a09a43540942d58d49717ad3fabfe14978cf4f0a8b84d2435dad16e9aa4d7f935ac"); var s = new Script(_params, bytes, 0, bytes.Length); Assert.IsTrue(s.IsSentToIp); }