MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / interactive_open_sandbox

Function interactive_open_sandbox

src/Chain/libraries/cli/Cli.cpp:827–857  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

825 }
826
827 void interactive_open_sandbox()
828 {
829 if (_client->get_chain()->get_is_in_sandbox())
830 return;
831
832 *_out << "The sandbox must be open to execute this command. You can:\n";
833 *_out << "(o) Open the sandbox\n";
834 *_out << "(q) Abort the command\n";
835
836 string choice = get_line("Choose [o/q]: ");
837
838 if (choice == "o")
839 {
840 fc::istream_ptr argument_stream = std::make_shared<fc::stringstream>();
841 try
842 {
843 parse_and_execute_interactive_command("sandbox_open", argument_stream);
844 }
845 catch (const thinkyoung::cli::abort_cli_command&)
846 {
847 }
848 }
849 else if (choice == "q")
850 {
851 FC_THROW_EXCEPTION(thinkyoung::cli::abort_cli_command, "");
852 }
853 else
854 {
855 *_out << "Wrong answer!\n";
856 }
857 }
858
859 void format_and_print_result(const string& command,
860 const fc::variants arguments,

Callers 1

execute_commandFunction · 0.85

Calls 4

get_is_in_sandboxMethod · 0.80
get_chainMethod · 0.80
get_lineFunction · 0.70

Tested by

no test coverage detected