示例#1
0
        private void UnlockAccount(string address, bool timeout = true)
        {
            var accounts = _keyStore.ListAccounts();

            if (accounts == null || accounts.Count <= 0)
            {
                _screenManager.PrintError("error: the account '" + address + "' does not exist.");
                return;
            }

            if (!accounts.Contains(address))
            {
                _screenManager.PrintError("account does not exist!");
                return;
            }

            var password = _screenManager.AskInvisible("password: "******"incorrect password!");
            }
            else if (tryOpen == AElfKeyStore.Errors.AccountAlreadyUnlocked)
            {
                _screenManager.PrintError("account already unlocked!");
            }
            else if (tryOpen == AElfKeyStore.Errors.None)
            {
                _screenManager.PrintLine("account successfully unlocked!");
            }
        }
示例#2
0
        public CommandInfo ListAccount()
        {
            var result = new CommandInfo("account list", "account");

            result.InfoMsg = _keyStore.ListAccounts();
            if (result.InfoMsg.Count != 0)
            {
                result.Result = true;
            }

            return(result);
        }