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  const crypto::Hash &query_hash) const override;
28 
29  std::unique_ptr<interface::QueryResponse> createAccountResponse(
34  std::vector<std::string> roles,
35  const crypto::Hash &query_hash) const override;
36 
37  std::unique_ptr<interface::QueryResponse> createBlockResponse(
38  std::unique_ptr<interface::Block> block,
39  const crypto::Hash &query_hash) const override;
40 
41  std::unique_ptr<interface::QueryResponse> createErrorQueryResponse(
42  ErrorQueryType error_type,
45  const crypto::Hash &query_hash) const override;
46 
47  std::unique_ptr<interface::QueryResponse> createSignatoriesResponse(
48  std::vector<interface::types::PubkeyType> signatories,
49  const crypto::Hash &query_hash) const override;
50 
51  std::unique_ptr<interface::QueryResponse> createTransactionsResponse(
52  std::vector<std::unique_ptr<shared_model::interface::Transaction>>
53  transactions,
54  const crypto::Hash &query_hash) const override;
55 
56  std::unique_ptr<interface::QueryResponse> createTransactionsPageResponse(
57  std::vector<std::unique_ptr<shared_model::interface::Transaction>>
58  transactions,
59  const crypto::Hash &next_tx_hash,
60  interface::types::TransactionsNumberType all_transactions_size,
61  const crypto::Hash &query_hash) const override;
62 
63  std::unique_ptr<interface::QueryResponse> createTransactionsPageResponse(
64  std::vector<std::unique_ptr<shared_model::interface::Transaction>>
65  transactions,
66  interface::types::TransactionsNumberType all_transactions_size,
67  const crypto::Hash &query_hash) const override;
68 
69  std::unique_ptr<interface::QueryResponse>
71  std::vector<std::unique_ptr<shared_model::interface::Transaction>>
72  transactions,
73  interface::types::TransactionsNumberType all_transactions_size,
74  boost::optional<interface::PendingTransactionsPageResponse::BatchInfo>
75  next_batch_info,
76  const crypto::Hash &query_hash) const override;
77 
78  std::unique_ptr<interface::QueryResponse> createAssetResponse(
82  const crypto::Hash &query_hash) const override;
83 
84  std::unique_ptr<interface::QueryResponse> createRolesResponse(
85  std::vector<interface::types::RoleIdType> roles,
86  const crypto::Hash &query_hash) const override;
87 
88  std::unique_ptr<interface::QueryResponse> createRolePermissionsResponse(
89  interface::RolePermissionSet role_permissions,
90  const crypto::Hash &query_hash) const override;
91 
92  std::unique_ptr<interface::BlockQueryResponse> createBlockQueryResponse(
93  std::shared_ptr<const interface::Block> block) const override;
94 
95  std::unique_ptr<interface::BlockQueryResponse> createBlockQueryResponse(
96  std::string error_message) const override;
97  };
98 
99  } // namespace proto
100 } // namespace shared_model
101 
102 #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:146
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:333
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:130
std::string DomainIdType
Iroha domain id type.
Definition: types.hpp:52
Definition: permissions.hpp:92
Definition: amount.hpp:20
Definition: query_response_factory.hpp:36
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:210
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:349
std::string DetailType
Type of detail.
Definition: types.hpp:71
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:194
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:101
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:313
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:58
ErrorQueryType
Definition: query_response_factory.hpp:100
uint8_t PrecisionType
Type of precision.
Definition: types.hpp:40
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:80
std::unique_ptr< interface::QueryResponse > createAccountDetailResponse(interface::types::DetailType account_detail, const crypto::Hash &query_hash) const override
Definition: proto_query_response_factory.cpp:87
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:230
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:279
Definition: command_executor.hpp:12
uint16_t QuorumType
Type of Quorum used in transaction and set quorum.
Definition: types.hpp:61
std::string JsonType
Type of JSON data.
Definition: types.hpp:73
std::string AssetIdType
Type of asset id.
Definition: types.hpp:54