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

            return(PublicKeyHash.ToHexString().CompareTo(other.PublicKeyHash.ToHexString()));
        }
예제 #2
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);
        }