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 
9 #include "common/result.hpp"
11 
12 namespace shared_model {
13  namespace interface {
14  class Command;
15  } // namespace interface
16 } // namespace shared_model
17 
18 namespace iroha {
19  namespace ametsuchi {
20 
25  struct CommandError {
26  using ErrorCodeType = uint32_t;
27 
28  std::string command_name;
30  std::string error_extra;
31 
32  std::string toString() const;
33  };
34 
41  using CommandResult = expected::Result<void, CommandError>;
42 
44  public:
45  virtual ~CommandExecutor() = default;
46 
47  virtual CommandResult execute(
50  &creator_account_id,
51  bool do_validation) = 0;
52  };
53  } // namespace ametsuchi
54 } // namespace iroha
55 
56 #endif // IROHA_AMETSUCHI_COMMAND_EXECUTOR_HPP
expected::Result< void, CommandError > CommandResult
Definition: command_executor.hpp:41
std::string error_extra
Definition: command_executor.hpp:30
std::string command_name
Definition: command_executor.hpp:28
Definition: block_query.hpp:14
std::string AccountIdType
Type of account id.
Definition: types.hpp:39
Definition: command_executor.hpp:43
ErrorCodeType error_code
Definition: command_executor.hpp:29
Definition: command_executor.hpp:25
WsvCommandResult execute(soci::statement &st, Function &&error)
Definition: postgres_wsv_command.cpp:23
std::string toString(interface::permissions::Role r)
Definition: permissions.cpp:22
Definition: command.hpp:40
uint32_t ErrorCodeType
Definition: command_executor.hpp:26
Definition: command_executor.hpp:12