コード例 #1
0
        protected override bool Parse(ArgumentsParser arguments)
        {
            name             = arguments.String(nameof(name), null);
            password         = arguments.String(nameof(password), null);
            agreedatalicence = arguments.Bool(nameof(agreedatalicence), false);

            if (!agreedatalicence || string.IsNullOrEmpty(name) || !WalletApp.IsValidPassword(password))
            {
                return(false);
            }
            return(true);
        }
コード例 #2
0
        protected override bool Parse(ArgumentsParser arguments)
        {
            key         = arguments.String(nameof(key), null);
            keypassword = arguments.String(nameof(keypassword), null);

            try
            {
                keyStore = KeyStore.Restore(key);
            }
            catch { }

            return(keyStore != null && WalletApp.IsValidPassword(keypassword));
        }
コード例 #3
0
        protected override bool Parse(ArgumentsParser arguments)
        {
            chainid          = arguments.Integer(nameof(chainid), 0);
            accountpassword  = arguments.String(nameof(accountpassword), null);
            chainkeyname     = arguments.String(nameof(chainkeyname), null);
            chainkeypassword = arguments.String(nameof(chainkeypassword), null);

            if (chainid <= Protocol.CoreChainId || !WalletApp.IsValidPassword(accountpassword) || string.IsNullOrEmpty(chainkeyname) || !WalletApp.IsValidPassword(chainkeypassword))
            {
                return(false);
            }

            return(true);
        }
コード例 #4
0
        protected override bool Parse(ArgumentsParser arguments)
        {
            targetaccount = arguments.Long(nameof(targetaccount), -1);
            reason        = arguments.String(nameof(reason), null);
            password      = arguments.String(nameof(password), null);

            var amountstr = arguments.String(nameof(amount), null);

            if (targetaccount < 0 || string.IsNullOrWhiteSpace(amountstr) || !WalletApp.IsValidPassword(password) || !AccountUpdateOperation.IsReasonValid(reason))
            {
                return(false);
            }

            var hasDot = false;

            foreach (var c in amountstr)
            {
                if (c == '.' && !hasDot)
                {
                    hasDot = true;
                    continue;
                }

                if (!(c >= '0' && c <= '9'))
                {
                    SetError("Amount invalid");
                    return(false);
                }
            }

            if (!decimal.TryParse(amountstr, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out var d))
            {
                SetError("Amount invalid");
                return(false);
            }

            amount = Currency.ToHel(d);

            return(amount > 0);
        }
コード例 #5
0
        protected override bool Parse(ArgumentsParser arguments)
        {
            password = arguments.String(nameof(password), null);

            return(WalletApp.IsValidPassword(password));
        }
コード例 #6
0
        protected override bool Parse(ArgumentsParser arguments)
        {
            keytype     = arguments.String(nameof(keytype), null);
            keypassword = arguments.String(nameof(keypassword), null);
            accountid   = arguments.Long(nameof(accountid), -1);
            chainid     = arguments.Integer(nameof(chainid), -1);
            keyindex    = arguments.Integer(nameof(keyindex), -1);

            return((keytype == "coreaccount" || keytype == "serviceaccount" || keytype == "chainkey") && WalletApp.IsValidPassword(keypassword));
        }