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  size_t total_assets_number,
21  std::optional<shared_model::interface::types::AssetIdType>
22  next_asset_id,
23  const crypto::Hash &query_hash) const override;
24 
25  std::unique_ptr<interface::QueryResponse> createAccountDetailResponse(
26  interface::types::DetailType account_detail,
27  size_t total_number,
28  std::optional<std::reference_wrapper<
30  next_record_id,
31  const crypto::Hash &query_hash) const override;
32 
33  std::unique_ptr<interface::QueryResponse> createAccountResponse(
38  std::vector<std::string> roles,
39  const crypto::Hash &query_hash) const override;
40 
41  std::unique_ptr<interface::QueryResponse> createBlockResponse(
42  std::unique_ptr<interface::Block> block,
43  const crypto::Hash &query_hash) const override;
44 
45  std::unique_ptr<interface::QueryResponse> createErrorQueryResponse(
46  ErrorQueryType error_type,
49  const crypto::Hash &query_hash) const override;
50 
51  std::unique_ptr<interface::QueryResponse> createSignatoriesResponse(
52  std::vector<std::string> signatories,
53  const crypto::Hash &query_hash) const override;
54 
55  std::unique_ptr<interface::QueryResponse> createTransactionsResponse(
56  std::vector<std::unique_ptr<shared_model::interface::Transaction>>
57  transactions,
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  std::optional<std::reference_wrapper<const crypto::Hash>>
64  next_tx_hash,
65  interface::types::TransactionsNumberType all_transactions_size,
66  const crypto::Hash &query_hash) const override;
67 
68  std::unique_ptr<interface::QueryResponse>
70  std::vector<std::unique_ptr<shared_model::interface::Transaction>>
71  transactions,
72  interface::types::TransactionsNumberType all_transactions_size,
73  std::optional<interface::PendingTransactionsPageResponse::BatchInfo>
74  next_batch_info,
75  const crypto::Hash &query_hash) const override;
76 
77  std::unique_ptr<interface::QueryResponse> createAssetResponse(
81  const crypto::Hash &query_hash) const override;
82 
83  std::unique_ptr<interface::QueryResponse> createRolesResponse(
84  std::vector<interface::types::RoleIdType> roles,
85  const crypto::Hash &query_hash) const override;
86 
87  std::unique_ptr<interface::QueryResponse> createRolePermissionsResponse(
88  interface::RolePermissionSet role_permissions,
89  const crypto::Hash &query_hash) const override;
90 
91  std::unique_ptr<interface::QueryResponse> createPeersResponse(
93  const crypto::Hash &query_hash) const override;
94 
95  std::unique_ptr<interface::QueryResponse> createEngineReceiptsResponse(
96  const std::vector<std::unique_ptr<interface::EngineReceipt>>
97  &engine_response_records,
98  const crypto::Hash &query_hash) const override;
99 
100  std::unique_ptr<interface::BlockQueryResponse> createBlockQueryResponse(
101  std::shared_ptr<const interface::Block> block) const override;
102 
103  std::unique_ptr<interface::BlockQueryResponse> createBlockQueryResponse(
104  std::string error_message) const override;
105  };
106 
107  } // namespace proto
108 } // namespace shared_model
109 
110 #endif // IROHA_PROTO_QUERY_RESPONSE_FACTORY_HPP
std::unique_ptr< interface::QueryResponse > createSignatoriesResponse(std::vector< std::string > signatories, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:205
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:157
std::unique_ptr< interface::QueryResponse > createPeersResponse(interface::types::PeerList peers, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:359
std::unique_ptr< interface::QueryResponse > createAccountDetailResponse(interface::types::DetailType account_detail, size_t total_number, std::optional< std::reference_wrapper< const shared_model::interface::AccountDetailRecordId >> next_record_id, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:88
std::string ErrorMessageType
Message type.
Definition: error_query_response.hpp:54
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:323
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:141
std::string DomainIdType
Iroha domain id type.
Definition: types.hpp:58
Definition: permissions.hpp:103
Definition: amount.hpp:21
Definition: query_response_factory.hpp:39
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:221
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 > createAccountAssetResponse(std::vector< std::tuple< interface::types::AccountIdType, interface::types::AssetIdType, shared_model::interface::Amount >> assets, size_t total_assets_number, std::optional< shared_model::interface::types::AssetIdType > next_asset_id, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:59
Provides query metadata for account detail list pagination.
Definition: account_detail_record_id.hpp:17
std::unique_ptr< interface::QueryResponse > createRolePermissionsResponse(interface::RolePermissionSet role_permissions, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:339
std::string DetailType
Type of detail.
Definition: types.hpp:77
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:112
std::string AccountIdType
Type of account id.
Definition: types.hpp:38
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:303
std::unique_ptr< interface::QueryResponse > createPendingTransactionsPageResponse(std::vector< std::unique_ptr< shared_model::interface::Transaction >> transactions, interface::types::TransactionsNumberType all_transactions_size, std::optional< interface::PendingTransactionsPageResponse::BatchInfo > next_batch_info, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:269
ErrorQueryType
Definition: query_response_factory.hpp:110
uint8_t PrecisionType
Type of precision.
Definition: types.hpp:46
uint32_t ErrorCodeType
Error code type.
Definition: error_query_response.hpp:62
uint16_t TransactionsNumberType
Type of a number of transactions in block and query response page.
Definition: types.hpp:86
std::unique_ptr< interface::QueryResponse > createEngineReceiptsResponse(const std::vector< std::unique_ptr< interface::EngineReceipt >> &engine_response_records, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:375
std::unique_ptr< interface::QueryResponse > createTransactionsPageResponse(std::vector< std::unique_ptr< shared_model::interface::Transaction >> transactions, std::optional< std::reference_wrapper< 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:240
std::vector< std::shared_ptr< shared_model::interface::Peer > > PeerList
Type of peers collection.
Definition: types.hpp:95
Definition: command_executor.hpp:13
uint16_t QuorumType
Type of Quorum used in transaction and set quorum.
Definition: types.hpp:67
std::string JsonType
Type of JSON data.
Definition: types.hpp:79
std::string AssetIdType
Type of asset id.
Definition: types.hpp:60