message: Clean up the conditional password prompt for SecureEnclave
diff: @@ -249,6 +249,15 @@ chain::action generate_nonce_action() {
  return chain::action( {}, config::null_account_name, "nonce", fc::raw::pack(fc::time_point::now().time_since_epoch().count()));
  }
  +void prompt_for_wallet_password(string& pw, const string& name) {
  + if(pw.size() == 0 && name != "SecureEnclave") {
  + std::cout << localized("password: ");
  + fc::set_console_echo(false);
  + std::getline( std::cin, pw, '\n' );
  + fc::set_console_echo(true);
  + }
  +}
  +
  fc::variant determine_required_keys(const signed_transaction& trx) {
  // TODO better error checking
  //wdump((trx));
  @@ -2185,12 +2194,7 @@ int main( int argc, char** argv ) {
  unlockWallet->add_option("--password", wallet_pw, localized("The password returned by wallet create"));
  unlockWallet->add_option( "--unlock-timeout", wallet_unlock_timeout, localized("The timeout for unlocked wallet in seconds"));
  unlockWallet->set_callback([&wallet_name, &wallet_pw] {
  - if( wallet_pw.size() == 0 && wallet_name != "SecureEnclave") {
  - std::cout << localized("password: ");
  - fc::set_console_echo(false);
  - std::getline( std::cin, wallet_pw, '\n' );
  - fc::set_console_echo(true);
  - }
  + prompt_for_wallet_password(wallet_pw, wallet_name);
  fc::variants vs = {fc::variant(wallet_name), fc::variant(wallet_pw)};
  call(wallet_url, wallet_unlock, vs);
  @@ -2223,12 +2227,7 @@ int main( int argc, char** argv ) {
  removeKeyWallet->add_option("key", wallet_rm_key_str, localized("Public key in WIF format to remove"))->required();
  removeKeyWallet->add_option("--password", wallet_pw, localized("The password returned by wallet create"));
  removeKeyWallet->set_callback([&wallet_name, &wallet_pw, &wallet_rm_key_str] {
  - if( wallet_pw.size() == 0 ) {
  - std::cout << localized("password: ");
  - fc::set_console_echo(false);
  - std::getline( std::cin, wallet_pw, '\n' );
  - fc::set_console_echo(true);
  - }
  + prompt_for_wallet_password(wallet_pw, wallet_name);
  public_key_type pubkey;
  try {
  pubkey = public_key_type( wallet_rm_key_str );
  @@ -2272,12 +2271,7 @@ int main( int argc, char** argv ) {
  listPrivKeys->add_option("-n,--name", wallet_name, localized("The name of the wallet to list keys from"), true);
  listPrivKeys->add_option("--password", wallet_pw, localized("The password returned by wallet create"));
  listPrivKeys->set_callback([&wallet_name, &wallet_pw] {
  - if( wallet_pw.size() == 0 ) {
  - std::cout << localized("password: ");
  - fc::set_console_echo(false);
  - std::getline( std::cin, wallet_pw, '\n' );
  - fc::set_console_echo(true);
  - }
  + prompt_for_wallet_password(wallet_pw, wallet_name);
  fc::variants vs = {fc::variant(wallet_name), fc::variant(wallet_pw)};
  const auto& v = call(wallet_url, wallet_list_keys, vs);
  std::cout << fc::json::to_pretty_string(v) << std::endl;
  