ui/ui/src/main/java/com/squareup/subzero/SubzeroCli.java
private void uiTest() throws Exception {
    screens = new Screens(new Framebuffer(config), config.getTeamName());

    try {
      while (true) {
        String input = screens.readQRCode();

        if (!screens.approveAction(
            "You are trying to transfer 10000 btc to hackers. Sounds cool?")) {
          System.out.println("Rejected!");
          return;
        }

        screens.promptForOperatorCard("Please insert Operator Card and then press enter");

        String passwordPrompt = "Please type your Operator Card password";
        while (true) {
          String password = screens.promptPassword(passwordPrompt);
          if (password.equals("ponies")) {
            break;
          }
          passwordPrompt = "Incorrect. Please type your Operator Card password";
        }

        screens.removeOperatorCard("Please remove Operator card and then hit <enter>.");

        // Please wait screen should now be displayed
        Thread.sleep(3000);

        // Generate a big QR code:
        String big = new String(new char[1999]).replace("\0", "M");
        screens.displayQRCode(big); // return value ignored so exit doesn't work
        // reflect back the original scanned QR code:
        Screens.ExitOrRestart command = screens.displayQRCode(input);
        if (command == Screens.ExitOrRestart.Exit) {
          return;
        }
        // otherwise command was restart, and we loop.
      }
    } catch (Exception e) {
      screens.exception(e);
    }
  }
/**
   * This goes through the various screens, so you can test changes to them without needing to
   * worry about any system state, run Plutus, etc.
   */
This goes through the various screens, so you can test changes to them without needing to
worry about any system state, run Plutus, etc.
This goes through the various screens so you can test changes to them without needing to worry about any system state run Plutus etc .
private void uiTest() throws Exception {
    screens = new Screens(new Framebuffer(config), config.getTeamName());
    try {
      while (true) {
        String input = screens.readQRCode();
        if (!screens.approveAction(
            "You are trying to transfer 10000 btc to hackers. Sounds cool?")) {
          System.out.println("Rejected!");
          return;
        }
        screens.promptForOperatorCard("Please insert Operator Card and then press enter");
        String passwordPrompt = "Please type your Operator Card password";
        while (true) {
          String password = screens.promptPassword(passwordPrompt);
          if (password.equals("ponies")) {
            break;
          }
          passwordPrompt = "Incorrect. Please type your Operator Card password";
        }
        screens.removeOperatorCard("Please remove Operator card and then hit <enter>.");
        Thread.sleep(3000);
        String big = new String(new char[1999]).replace("\0", "M");
        screens.displayQRCode(big); 
        Screens.ExitOrRestart command = screens.displayQRCode(input);
        if (command == Screens.ExitOrRestart.Exit) {
          return;
        }
      }
    } catch (Exception e) {
      screens.exception(e);
    }
  }
private void uiTest ( ) throws Exception { screens = new Screens ( new Framebuffer ( config ) , config . getTeamName ( ) ) ; try { while ( true ) { String input = screens . readQRCode ( ) ; if ( ! screens . approveAction ( "You are trying to transfer 10000 btc to hackers. Sounds cool?" ) ) { System . out . println ( "Rejected!" ) ; return ; } screens . promptForOperatorCard ( "Please insert Operator Card and then press enter" ) ; String passwordPrompt = "Please type your Operator Card password" ; while ( true ) { String password = screens . promptPassword ( passwordPrompt ) ; if ( password . equals ( "ponies" ) ) { break ; } passwordPrompt = "Incorrect. Please type your Operator Card password" ; } screens . removeOperatorCard ( "Please remove Operator card and then hit <enter>." ) ; Thread . sleep ( 3000 ) ; String big = new String ( new char [ 1999 ] ) . replace ( "\0" , "M" ) ; screens . displayQRCode ( big ) ; Screens . ExitOrRestart command = screens . displayQRCode ( input ) ; if ( command == Screens . ExitOrRestart . Exit ) { return ; } } } catch ( Exception e ) { screens . exception ( e ) ; } }
This goes through the various screens, so you can test changes to them without needing to
 worry about any system state, run Plutus, etc.
This goes through the various screens so you can test changes to them without needing to worry about any system state run Plutus etc .
// Please wait screen should now be displayed // Generate a big QR code: // return value ignored so exit doesn't work // reflect back the original scanned QR code: // otherwise command was restart, and we loop.