hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
wsv_command.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_WSV_COMMAND_HPP
7 #define IROHA_WSV_COMMAND_HPP
8 
9 #include <set>
10 #include <string>
11 
12 #include "common/result.hpp"
16 
17 namespace shared_model {
18  namespace interface {
19  class Asset;
20  class Account;
21  class Domain;
22  class Peer;
23  class AccountAsset;
24  } // namespace interface
25 } // namespace shared_model
26 
27 namespace iroha {
28  struct TopBlockInfo;
29 
30  namespace ametsuchi {
31 
38  using WsvError = std::string;
39 
47 
51  class WsvCommand {
52  public:
53  virtual ~WsvCommand() = default;
54 
60  virtual WsvCommandResult insertRole(
61  const shared_model::interface::types::RoleIdType &role_name) = 0;
62 
69  virtual WsvCommandResult insertAccountRole(
71  const shared_model::interface::types::RoleIdType &role_name) = 0;
78  virtual WsvCommandResult deleteAccountRole(
80  const shared_model::interface::types::RoleIdType &role_name) = 0;
81 
88  virtual WsvCommandResult insertRolePermissions(
90  const shared_model::interface::RolePermissionSet &permissions) = 0;
91 
99  virtual WsvCommandResult insertAccountGrantablePermission(
101  &permittee_account_id,
104 
113  virtual WsvCommandResult deleteAccountGrantablePermission(
115  &permittee_account_id,
118 
124  virtual WsvCommandResult insertAccount(
125  const shared_model::interface::Account &account) = 0;
126 
132  virtual WsvCommandResult updateAccount(
133  const shared_model::interface::Account &account) = 0;
134 
143  virtual WsvCommandResult setAccountKV(
146  &creator_account_id,
147  const std::string &key,
148  const std::string &val) = 0;
149 
155  virtual WsvCommandResult insertAsset(
156  const shared_model::interface::Asset &asset) = 0;
157 
163  virtual WsvCommandResult upsertAccountAsset(
164  const shared_model::interface::AccountAsset &asset) = 0;
165 
171  virtual WsvCommandResult insertSignatory(
172  shared_model::interface::types::PublicKeyHexStringView signatory) = 0;
173 
180  virtual WsvCommandResult insertAccountSignatory(
182  shared_model::interface::types::PublicKeyHexStringView signatory) = 0;
183 
190  virtual WsvCommandResult deleteAccountSignatory(
192  shared_model::interface::types::PublicKeyHexStringView signatory) = 0;
193 
199  virtual WsvCommandResult deleteSignatory(
200  shared_model::interface::types::PublicKeyHexStringView signatory) = 0;
201 
207  virtual WsvCommandResult insertPeer(
208  const shared_model::interface::Peer &peer) = 0;
209 
215  virtual WsvCommandResult deletePeer(
216  const shared_model::interface::Peer &peer) = 0;
217 
223  virtual WsvCommandResult insertDomain(
224  const shared_model::interface::Domain &domain) = 0;
225 
231  virtual WsvCommandResult setTopBlockInfo(
232  const TopBlockInfo &top_block_info) const = 0;
233  };
234 
235  } // namespace ametsuchi
236 } // namespace iroha
237 
238 #endif // IROHA_WSV_COMMAND_HPP
Definition: account.hpp:20
Grantable
Definition: permissions.hpp:76
Definition: peer.hpp:20
Definition: permissions.hpp:103
Definition: domain.hpp:19
Definition: result_fwd.hpp:27
Definition: ledger_state.hpp:14
std::string WsvError
Definition: wsv_command.hpp:38
Definition: wsv_command.hpp:51
Definition: block_query.hpp:15
std::string AccountIdType
Type of account id.
Definition: types.hpp:38
Definition: asset.hpp:19
Definition: command_executor.hpp:12
Definition: account_asset.hpp:20
std::string RoleIdType
Type of role (i.e admin, user)
Definition: types.hpp:54