6 #ifndef IROHA_CLI_INTERACTIVE_QUERY_CLI_HPP 7 #define IROHA_CLI_INTERACTIVE_QUERY_CLI_HPP 10 #include <unordered_map> 19 class ModelCryptoProvider;
25 namespace interactive {
41 const std::string &account_id,
42 const std::string &default_peer_ip,
44 uint64_t query_counter,
45 const std::shared_ptr<iroha::model::ModelCryptoProvider> &provider,
56 using QueryName = std::string;
57 using QueryParams = std::vector<std::string>;
65 void create_queries_menu();
73 void create_result_menu();
76 const std::string GET_ACC =
"get_acc";
77 const std::string GET_ACC_AST =
"get_acc_ast";
78 const std::string GET_ACC_AST_TX =
"get_acc_ast_tx";
79 const std::string GET_ACC_TX =
"get_acc_tx";
80 const std::string GET_TX =
"get_tx";
81 const std::string GET_ACC_SIGN =
"get_acc_sign";
82 const std::string GET_ROLES =
"get_roles";
83 const std::string GET_AST_INFO =
"get_ast_info";
84 const std::string GET_ROLE_PERM =
"get_role_perm";
87 using QueryHandler = std::shared_ptr<iroha::model::Query> (
89 std::unordered_map<QueryName, QueryHandler> query_handlers_;
102 bool parseQuery(std::string line);
104 std::shared_ptr<iroha::model::Query> parseGetAccount(QueryParams params);
105 std::shared_ptr<iroha::model::Query> parseGetAccountAssets(
107 std::shared_ptr<iroha::model::Query> parseGetAccountAssetTransactions(
109 std::shared_ptr<iroha::model::Query> parseGetAccountTransactions(
111 std::shared_ptr<iroha::model::Query> parseGetTransactions(
113 std::shared_ptr<iroha::model::Query> parseGetSignatories(
115 std::shared_ptr<iroha::model::Query> parseGetRoles(QueryParams params);
116 std::shared_ptr<iroha::model::Query> parseGetRolePermissions(
118 std::shared_ptr<iroha::model::Query> parseGetAssetInfo(
123 std::unordered_map<QueryName, ResultHandler> result_handlers_;
134 bool parseResult(std::string line);
136 bool parseSendToIroha(QueryParams line);
137 bool parseSaveFile(QueryParams line);
144 std::string creator_;
146 std::string default_peer_ip_;
153 uint64_t local_time_;
156 std::shared_ptr<iroha::model::Query> query_;
162 std::shared_ptr<iroha::model::ModelCryptoProvider> provider_;
178 #endif // IROHA_CLI_INTERACTIVE_QUERY_CLI_HPP Definition: client.cpp:16
MenuContext
Definition: interactive_common_cli.hpp:29
Definition: interactive_query_cli.hpp:26
std::vector< std::string > MenuPoints
Definition: interactive_common_cli.hpp:60
std::shared_ptr< Logger > LoggerPtr
Definition: logger_fwd.hpp:22
Definition: block_query.hpp:15
std::unordered_map< std::string, ParamsDescription > ParamsMap
Definition: interactive_common_cli.hpp:62
std::shared_ptr< LoggerManagerTree > LoggerManagerTreePtr
Definition: logger_manager_fwd.hpp:14
std::unordered_map< std::string, std::string > DescriptionMap
Definition: interactive_common_cli.hpp:58
Definition: query_generator.hpp:23