6 #ifndef IROHA_CLI_INTERACTIVE_TRANSACTION_CLI_HPP 7 #define IROHA_CLI_INTERACTIVE_TRANSACTION_CLI_HPP 9 #include <unordered_map> 19 class ModelCryptoProvider;
24 namespace interactive {
38 const std::string &creator_account,
39 const std::string &default_peer_ip,
41 const std::shared_ptr<iroha::model::ModelCryptoProvider> &provider,
64 void createCommandMenu();
68 void createResultMenu();
71 const std::string ADD_ASSET_QTY =
"add_ast_qty";
72 const std::string ADD_PEER =
"add_peer";
73 const std::string ADD_SIGN =
"add_sign";
74 const std::string CREATE_ACC =
"crt_acc";
75 const std::string CREATE_ASSET =
"crt_ast";
76 const std::string CREATE_DOMAIN =
"crt_dmn";
77 const std::string REMOVE_SIGN =
"rem_sign";
78 const std::string SET_QUO =
"set_qrm";
79 const std::string SET_ACC_KV =
"set_acc_kv";
80 const std::string SUB_ASSET_QTY =
"sub_ast_qty";
81 const std::string TRAN_ASSET =
"tran_ast";
83 const std::string CREATE_ROLE =
"crt_role";
84 const std::string APPEND_ROLE =
"apnd_role";
85 const std::string DETACH_ROLE =
"detach";
86 const std::string GRANT_PERM =
"grant_perm";
87 const std::string REVOKE_PERM =
"revoke_perm";
90 using CommandHandler = std::shared_ptr<iroha::model::Command> (
94 std::unordered_map<std::string, CommandHandler> command_handlers_;
108 bool parseCommand(std::string line);
110 std::shared_ptr<iroha::model::Command> parseAddAssetQuantity(
111 std::vector<std::string> line);
112 std::shared_ptr<iroha::model::Command> parseAddPeer(
113 std::vector<std::string> line);
114 std::shared_ptr<iroha::model::Command> parseAddSignatory(
115 std::vector<std::string> line);
116 std::shared_ptr<iroha::model::Command> parseCreateAccount(
117 std::vector<std::string> line);
118 std::shared_ptr<iroha::model::Command> parseCreateAsset(
119 std::vector<std::string> line);
120 std::shared_ptr<iroha::model::Command> parseCreateDomain(
121 std::vector<std::string> line);
122 std::shared_ptr<iroha::model::Command> parseRemoveSignatory(
123 std::vector<std::string> line);
124 std::shared_ptr<iroha::model::Command> parseSetQuorum(
125 std::vector<std::string> line);
126 std::shared_ptr<iroha::model::Command> parseSetAccountDetail(
127 std::vector<std::string> line);
128 std::shared_ptr<iroha::model::Command> parseSubtractAssetQuantity(
129 std::vector<std::string> line);
130 std::shared_ptr<iroha::model::Command> parseTransferAsset(
131 std::vector<std::string> line);
132 std::shared_ptr<iroha::model::Command> parseAppendRole(
133 std::vector<std::string> line);
134 std::shared_ptr<iroha::model::Command> parseDetachRole(
135 std::vector<std::string> line);
136 std::shared_ptr<iroha::model::Command> parseCreateRole(
137 std::vector<std::string> line);
138 std::shared_ptr<iroha::model::Command> parseGrantPermission(
139 std::vector<std::string> line);
140 std::shared_ptr<iroha::model::Command> parseRevokePermission(
141 std::vector<std::string> line);
144 using ResultHandler =
146 std::unordered_map<std::string, ResultHandler> result_handlers_;
157 bool parseResult(std::string line);
159 bool parseSendToIroha(std::vector<std::string> params);
160 bool parseSaveFile(std::vector<std::string> params);
161 bool parseGoBack(std::vector<std::string> params);
162 bool parseAddCommand(std::vector<std::string> params);
172 std::string creator_;
173 std::string default_peer_ip_;
180 std::vector<std::shared_ptr<iroha::model::Command>> commands_;
183 std::shared_ptr<iroha::model::ModelCryptoProvider> provider_;
200 #endif // IROHA_CLI_INTERACTIVE_TRANSACTION_CLI_HPP Definition: command_generator.hpp:22
Definition: client.cpp:16
MenuContext
Definition: interactive_common_cli.hpp:29
Definition: transaction.hpp:26
Definition: interactive_transaction_cli.hpp:25
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: transaction_generator.hpp:17