hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
command_executor.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_AMETSUCHI_COMMAND_EXECUTOR_HPP
7 #define IROHA_AMETSUCHI_COMMAND_EXECUTOR_HPP
8 
10 #include "common/result.hpp"
12 
13 namespace shared_model {
14  namespace interface {
15  class Command;
16  } // namespace interface
17 } // namespace shared_model
18 
19 namespace iroha {
20  namespace ametsuchi {
21 
26  struct CommandError {
27  using ErrorCodeType = uint32_t;
28 
29  CommandError(std::string_view command_name,
30  ErrorCodeType error_code,
31  std::string_view error_extra);
32 
33  std::string command_name;
35  std::string error_extra;
36 
37  std::string toString() const;
38  };
39 
47 
49  public:
50  virtual ~CommandExecutor() = default;
51 
52  virtual CommandResult execute(
55  &creator_account_id,
56  const std::string &tx_hash,
58  bool do_validation) = 0;
59 
60  virtual void skipChanges() = 0;
61 
62  virtual DatabaseTransaction &dbSession() = 0;
63  };
64  } // namespace ametsuchi
65 } // namespace iroha
66 
67 #endif // IROHA_AMETSUCHI_COMMAND_EXECUTOR_HPP
Definition: block_query.hpp:17
std::string error_extra
Definition: command_executor.hpp:35
Definition: result_fwd.hpp:27
std::string command_name
Definition: command_executor.hpp:33
Definition: block_query.hpp:15
std::string AccountIdType
Type of account id.
Definition: types.hpp:38
Definition: command_executor.hpp:48
ErrorCodeType error_code
Definition: command_executor.hpp:34
Definition: command_executor.hpp:26
std::string toString(const ::iroha::utility_service::Status &val)
Definition: proto_status_tools.cpp:56
WsvCommandResult execute(soci::statement &st, Function &&error)
Definition: postgres_wsv_command.cpp:26
Definition: db_transaction.hpp:13
Definition: command.hpp:41
int32_t CommandIndexType
Type of command index within a transaction.
Definition: types.hpp:100
uint32_t ErrorCodeType
Definition: command_executor.hpp:27
Definition: command_executor.hpp:13