X-Git-Url: https://git.novaco.in/?p=NovacoinLibrary.git;a=blobdiff_plain;f=Novacoin%2FCScriptID.cs;h=b9ead5a6d7cba16cce5179155278f09e90c69be3;hp=bd4dea53c13104f72f618ff58823b2b3059343e1;hb=241856f1328f7d900260976c18c29f67c7cebc80;hpb=0beeb4bd4e68e4f0d81832370f2f0388d0d76c65 diff --git a/Novacoin/CScriptID.cs b/Novacoin/CScriptID.cs index bd4dea5..b9ead5a 100644 --- a/Novacoin/CScriptID.cs +++ b/Novacoin/CScriptID.cs @@ -16,25 +16,33 @@ * along with this program. If not, see . */ -using System; -using System.Diagnostics.Contracts; - namespace Novacoin { - public class CScriptID : Hash160 + /// + /// Represents the script identifier. Internal value is calculated as Hash160(script). + /// + public class CScriptID : uint160 { - public CScriptID(Hash160 scriptHash) + public CScriptID() : base() + { + } + + public CScriptID(CScriptID KeyID) : base(KeyID) { - _hashBytes = scriptHash; } - internal CScriptID(byte[] hashBytes) + public CScriptID(uint160 pubKeyHash) : base(pubKeyHash) { - Contract.Requires(hashBytes.Length == 20, "Your data doesn't seem like a hash160 of some value."); + } - _hashBytes = hashBytes; + public CScriptID(byte[] hashBytes) : base(hashBytes) + { } + /// + /// Generate Pay-to-ScriptHash address + /// + /// Base58 formatted novacoin address public override string ToString() { return (new CNovacoinAddress(this)).ToString();