hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
proto_query_response_factory.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_PROTO_QUERY_RESPONSE_FACTORY_HPP
7 #define IROHA_PROTO_QUERY_RESPONSE_FACTORY_HPP
8 
10 
11 namespace shared_model {
12  namespace proto {
13 
15  public:
16  std::unique_ptr<interface::QueryResponse> createAccountAssetResponse(
17  std::vector<std::tuple<interface::types::AccountIdType,
20  const crypto::Hash &query_hash) const override;
21 
22  std::unique_ptr<interface::QueryResponse> createAccountDetailResponse(
23  interface::types::DetailType account_detail,
24  const crypto::Hash &query_hash) const override;
25 
26  std::unique_ptr<interface::QueryResponse> createAccountResponse(
31  std::vector<std::string> roles,
32  const crypto::Hash &query_hash) const override;
33 
34  std::unique_ptr<interface::QueryResponse> createBlockResponse(
35  std::unique_ptr<interface::Block> block,
36  const crypto::Hash &query_hash) const override;
37 
38  std::unique_ptr<interface::QueryResponse> createErrorQueryResponse(
39  ErrorQueryType error_type,
42  const crypto::Hash &query_hash) const override;
43 
44  std::unique_ptr<interface::QueryResponse> createSignatoriesResponse(
45  std::vector<interface::types::PubkeyType> signatories,
46  const crypto::Hash &query_hash) const override;
47 
48  std::unique_ptr<interface::QueryResponse> createTransactionsResponse(
49  std::vector<std::unique_ptr<shared_model::interface::Transaction>>
50  transactions,
51  const crypto::Hash &query_hash) const override;
52 
53  std::unique_ptr<interface::QueryResponse> createTransactionsPageResponse(
54  std::vector<std::unique_ptr<shared_model::interface::Transaction>>
55  transactions,
56  const crypto::Hash &next_tx_hash,
57  interface::types::TransactionsNumberType all_transactions_size,
58  const crypto::Hash &query_hash) const override;
59 
60  std::unique_ptr<interface::QueryResponse> createTransactionsPageResponse(
61  std::vector<std::unique_ptr<shared_model::interface::Transaction>>
62  transactions,
63  interface::types::TransactionsNumberType all_transactions_size,
64  const crypto::Hash &query_hash) const override;
65 
66  std::unique_ptr<interface::QueryResponse> createAssetResponse(
70  const crypto::Hash &query_hash) const override;
71 
72  std::unique_ptr<interface::QueryResponse> createRolesResponse(
73  std::vector<interface::types::RoleIdType> roles,
74  const crypto::Hash &query_hash) const override;
75 
76  std::unique_ptr<interface::QueryResponse> createRolePermissionsResponse(
77  interface::RolePermissionSet role_permissions,
78  const crypto::Hash &query_hash) const override;
79 
80  std::unique_ptr<interface::BlockQueryResponse> createBlockQueryResponse(
81  std::shared_ptr<const interface::Block> block) const override;
82 
83  std::unique_ptr<interface::BlockQueryResponse> createBlockQueryResponse(
84  std::string error_message) const override;
85  };
86 
87  } // namespace proto
88 } // namespace shared_model
89 
90 #endif // IROHA_PROTO_QUERY_RESPONSE_FACTORY_HPP
Definition: hash.hpp:18
std::unique_ptr< interface::QueryResponse > createErrorQueryResponse(ErrorQueryType error_type, interface::ErrorQueryResponse::ErrorMessageType error_msg, interface::ErrorQueryResponse::ErrorCodeType error_code, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:138
std::string ErrorMessageType
Message type.
Definition: error_query_response.hpp:56
std::unique_ptr< interface::QueryResponse > createRolesResponse(std::vector< interface::types::RoleIdType > roles, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:289
std::unique_ptr< interface::QueryResponse > createBlockResponse(std::unique_ptr< interface::Block > block, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:122
std::string DomainIdType
Iroha domain id type.
Definition: types.hpp:49
Definition: permissions.hpp:92
Definition: amount.hpp:20
Definition: query_response_factory.hpp:34
std::unique_ptr< interface::QueryResponse > createTransactionsResponse(std::vector< std::unique_ptr< shared_model::interface::Transaction >> transactions, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:202
Definition: proto_query_response_factory.hpp:14
std::unique_ptr< interface::BlockQueryResponse > createBlockQueryResponse(std::shared_ptr< const interface::Block > block) const override
std::unique_ptr< interface::QueryResponse > createRolePermissionsResponse(interface::RolePermissionSet role_permissions, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:305
std::string DetailType
Type of detail.
Definition: types.hpp:69
std::unique_ptr< interface::QueryResponse > createSignatoriesResponse(std::vector< interface::types::PubkeyType > signatories, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:186
std::unique_ptr< interface::QueryResponse > createAccountResponse(interface::types::AccountIdType account_id, interface::types::DomainIdType domain_id, interface::types::QuorumType quorum, interface::types::JsonType jsonData, std::vector< std::string > roles, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:93
std::string AccountIdType
Type of account id.
Definition: types.hpp:35
std::unique_ptr< interface::QueryResponse > createAssetResponse(interface::types::AssetIdType asset_id, interface::types::DomainIdType domain_id, interface::types::PrecisionType precision, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:269
std::unique_ptr< interface::QueryResponse > createAccountAssetResponse(std::vector< std::tuple< interface::types::AccountIdType, interface::types::AssetIdType, shared_model::interface::Amount >> assets, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:58
ErrorQueryType
Definition: query_response_factory.hpp:91
uint8_t PrecisionType
Type of precision.
Definition: types.hpp:37
uint32_t ErrorCodeType
Error code type.
Definition: error_query_response.hpp:64
uint16_t TransactionsNumberType
Type of a number of transactions in block and query response page.
Definition: types.hpp:77
std::unique_ptr< interface::QueryResponse > createAccountDetailResponse(interface::types::DetailType account_detail, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:79
std::unique_ptr< interface::QueryResponse > createTransactionsPageResponse(std::vector< std::unique_ptr< shared_model::interface::Transaction >> transactions, const crypto::Hash &next_tx_hash, interface::types::TransactionsNumberType all_transactions_size, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:221
Definition: command_executor.hpp:12
uint16_t QuorumType
Type of Quorum used in transaction and set quorum.
Definition: types.hpp:57
std::string JsonType
Type of JSON data.
Definition: types.hpp:71
std::string AssetIdType
Type of asset id.
Definition: types.hpp:51