hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
postgres_command_executor.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_POSTGRES_COMMAND_EXECUTOR_HPP
7 #define IROHA_POSTGRES_COMMAND_EXECUTOR_HPP
8 
11 
12 namespace shared_model {
13  namespace interface {
14  class PermissionToString;
15  }
16 } // namespace shared_model
17 
18 namespace iroha {
19  namespace ametsuchi {
20 
22  public:
24  soci::session &transaction,
25  std::shared_ptr<shared_model::interface::PermissionToString>
26  perm_converter);
27 
28  void setCreatorAccountId(
30  &creator_account_id) override;
31 
32  void doValidation(bool do_validation) override;
33 
34  CommandResult operator()(
35  const shared_model::interface::AddAssetQuantity &command) override;
36 
37  CommandResult operator()(
38  const shared_model::interface::AddPeer &command) override;
39 
40  CommandResult operator()(
41  const shared_model::interface::AddSignatory &command) override;
42 
43  CommandResult operator()(
44  const shared_model::interface::AppendRole &command) override;
45 
46  CommandResult operator()(
47  const shared_model::interface::CreateAccount &command) override;
48 
49  CommandResult operator()(
50  const shared_model::interface::CreateAsset &command) override;
51 
52  CommandResult operator()(
53  const shared_model::interface::CreateDomain &command) override;
54 
55  CommandResult operator()(
56  const shared_model::interface::CreateRole &command) override;
57 
58  CommandResult operator()(
59  const shared_model::interface::DetachRole &command) override;
60 
61  CommandResult operator()(
62  const shared_model::interface::GrantPermission &command) override;
63 
64  CommandResult operator()(
65  const shared_model::interface::RemoveSignatory &command) override;
66 
67  CommandResult operator()(
68  const shared_model::interface::RevokePermission &command) override;
69 
70  CommandResult operator()(
71  const shared_model::interface::SetAccountDetail &command) override;
72 
73  CommandResult operator()(
74  const shared_model::interface::SetQuorum &command) override;
75 
76  CommandResult operator()(
78  override;
79 
80  CommandResult operator()(
81  const shared_model::interface::TransferAsset &command) override;
82 
83  static void prepareStatements(soci::session &sql);
84 
85  private:
86  soci::session &sql_;
87  bool do_validation_;
88 
90  std::shared_ptr<shared_model::interface::PermissionToString>
91  perm_converter_;
92 
93  // 14.09.18 nickaleks: IR-1708 Load SQL from separate files
94  static const std::string addAssetQuantityBase;
95  static const std::string addPeerBase;
96  static const std::string addSignatoryBase;
97  static const std::string appendRoleBase;
98  static const std::string createAccountBase;
99  static const std::string createAssetBase;
100  static const std::string createDomainBase;
101  static const std::string createRoleBase;
102  static const std::string detachRoleBase;
103  static const std::string grantPermissionBase;
104  static const std::string removeSignatoryBase;
105  static const std::string revokePermissionBase;
106  static const std::string setAccountDetailBase;
107  static const std::string setQuorumBase;
108  static const std::string subtractAssetQuantityBase;
109  static const std::string transferAssetBase;
110  };
111  } // namespace ametsuchi
112 } // namespace iroha
113 
114 #endif // IROHA_POSTGRES_COMMAND_EXECUTOR_HPP
Definition: add_signatory.hpp:18
expected::Result< void, CommandError > CommandResult
Definition: command_executor.hpp:56
Definition: set_quorum.hpp:17
Definition: subtract_asset_quantity.hpp:19
Definition: detach_role.hpp:18
Definition: remove_signatory.hpp:17
Definition: create_asset.hpp:17
Definition: append_role.hpp:18
Definition: transfer_asset.hpp:18
Definition: block_query.hpp:16
Definition: postgres_command_executor.hpp:21
std::string AccountIdType
Type of account id.
Definition: types.hpp:35
Definition: command_executor.hpp:58
Definition: create_domain.hpp:17
Definition: create_account.hpp:18
Definition: grant_permission.hpp:18
Definition: set_account_detail.hpp:18
Definition: revoke_permission.hpp:18
Definition: add_asset_quantity.hpp:19
Definition: create_role.hpp:21
Definition: command_executor.hpp:12
Definition: add_peer.hpp:19