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  boost::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,
29  &> next_record_id,
30  const crypto::Hash &query_hash) const override;
31 
32  std::unique_ptr<interface::QueryResponse> createAccountResponse(
37  std::vector<std::string> roles,
38  const crypto::Hash &query_hash) const override;
39 
40  std::unique_ptr<interface::QueryResponse> createBlockResponse(
41  std::unique_ptr<interface::Block> block,
42  const crypto::Hash &query_hash) const override;
43 
44  std::unique_ptr<interface::QueryResponse> createErrorQueryResponse(
45  ErrorQueryType error_type,
48  const crypto::Hash &query_hash) const override;
49 
50  std::unique_ptr<interface::QueryResponse> createSignatoriesResponse(
51  std::vector<interface::types::PubkeyType> signatories,
52  const crypto::Hash &query_hash) const override;
53 
54  std::unique_ptr<interface::QueryResponse> createTransactionsResponse(
55  std::vector<std::unique_ptr<shared_model::interface::Transaction>>
56  transactions,
57  const crypto::Hash &query_hash) const override;
58 
59  std::unique_ptr<interface::QueryResponse> createTransactionsPageResponse(
60  std::vector<std::unique_ptr<shared_model::interface::Transaction>>
61  transactions,
62  boost::optional<const crypto::Hash &> next_tx_hash,
63  interface::types::TransactionsNumberType all_transactions_size,
64  const crypto::Hash &query_hash) const override;
65 
66  std::unique_ptr<interface::QueryResponse>
68  std::vector<std::unique_ptr<shared_model::interface::Transaction>>
69  transactions,
70  interface::types::TransactionsNumberType all_transactions_size,
71  boost::optional<interface::PendingTransactionsPageResponse::BatchInfo>
72  next_batch_info,
73  const crypto::Hash &query_hash) const override;
74 
75  std::unique_ptr<interface::QueryResponse> createAssetResponse(
79  const crypto::Hash &query_hash) const override;
80 
81  std::unique_ptr<interface::QueryResponse> createRolesResponse(
82  std::vector<interface::types::RoleIdType> roles,
83  const crypto::Hash &query_hash) const override;
84 
85  std::unique_ptr<interface::QueryResponse> createRolePermissionsResponse(
86  interface::RolePermissionSet role_permissions,
87  const crypto::Hash &query_hash) const override;
88 
89  std::unique_ptr<interface::QueryResponse> createPeersResponse(
91  const crypto::Hash &query_hash) const override;
92 
93  std::unique_ptr<interface::BlockQueryResponse> createBlockQueryResponse(
94  std::shared_ptr<const interface::Block> block) const override;
95 
96  std::unique_ptr<interface::BlockQueryResponse> createBlockQueryResponse(
97  std::string error_message) const override;
98  };
99 
100  } // namespace proto
101 } // namespace shared_model
102 
103 #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:158
std::unique_ptr< interface::QueryResponse > createPeersResponse(interface::types::PeerList peers, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:360
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:324
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:142
std::string DomainIdType
Iroha domain id type.
Definition: types.hpp:53
Definition: permissions.hpp:96
Definition: amount.hpp:19
Definition: query_response_factory.hpp:38
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:222
Definition: proto_query_response_factory.hpp:14
std::unique_ptr< interface::BlockQueryResponse > createBlockQueryResponse(std::shared_ptr< const interface::Block > block) const override
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:340
std::string DetailType
Type of detail.
Definition: types.hpp:72
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:206
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:113
std::string AccountIdType
Type of account id.
Definition: types.hpp:39
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:304
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, boost::optional< shared_model::interface::types::AssetIdType > next_asset_id, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:60
ErrorQueryType
Definition: query_response_factory.hpp:108
uint8_t PrecisionType
Type of precision.
Definition: types.hpp:41
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:81
std::unique_ptr< interface::QueryResponse > createAccountDetailResponse(interface::types::DetailType account_detail, size_t total_number, boost::optional< const shared_model::interface::AccountDetailRecordId & > next_record_id, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:89
std::unique_ptr< interface::QueryResponse > createTransactionsPageResponse(std::vector< std::unique_ptr< shared_model::interface::Transaction >> transactions, boost::optional< 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:241
std::unique_ptr< interface::QueryResponse > createPendingTransactionsPageResponse(std::vector< std::unique_ptr< shared_model::interface::Transaction >> transactions, interface::types::TransactionsNumberType all_transactions_size, boost::optional< interface::PendingTransactionsPageResponse::BatchInfo > next_batch_info, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:270
Definition: command_executor.hpp:12
uint16_t QuorumType
Type of Quorum used in transaction and set quorum.
Definition: types.hpp:62
std::vector< std::shared_ptr< shared_model::interface::Peer >> PeerList
Type of peers collection.
Definition: types.hpp:90
std::string JsonType
Type of JSON data.
Definition: types.hpp:74
std::string AssetIdType
Type of asset id.
Definition: types.hpp:55