예제 #1
0
        public int CompareTo(Account other)
        {
            if (ReferenceEquals(this, other))
            {
                return(0);
            }

            return(PublicKeyHash.ToHexString().CompareTo(other.PublicKeyHash.ToHexString()));
        }
예제 #2
0
 public bool Equals(KeyPair other)
 {
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     return(PublicKeyHash.Equals(other.PublicKeyHash));
 }
예제 #3
0
        public JObject GetJson()
        {
            var result = new JObject();

            if (PublicKeyHash == null)
            {
                throw new SerializeException(string.Format(ErrorCodes.ParameterMissing, _publicKeyHashName));
            }

            if (_key == null)
            {
                throw new SerializeException(string.Format(ErrorCodes.ParameterMissing, _keyName));
            }

            result.Add(_networkName, Enum.GetName(typeof(Networks), Network));
            result.Add(_typeName, Enum.GetName(typeof(ScriptTypes), Type));
            result.Add(_publicKeyHashName, PublicKeyHash.ToHexString());
            result.Add(_keyName, _key.GetJson());
            return(result);
        }
예제 #4
0
 public override int GetHashCode()
 {
     return(PublicKeyHash.GetHashCode());
 }