hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
proto_block_factory.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_PROTO_BLOCK_FACTORY_HPP
7 #define IROHA_PROTO_BLOCK_FACTORY_HPP
8 
10 
12 #include "block.pb.h"
13 #include "common/result.hpp"
15 
16 namespace shared_model {
17  namespace proto {
22  public:
25  shared_model::interface::Block>> interface_validator,
27  iroha::protocol::Block>> proto_validator);
28 
29  std::unique_ptr<interface::Block> unsafeCreateBlock(
31  const interface::types::HashType &prev_hash,
34  const interface::types::HashCollectionType &rejected_hashes) override;
35 
44  createBlock(iroha::protocol::Block block);
45 
46  private:
49  interface_validator_;
50  std::unique_ptr<
52  proto_validator_;
53  };
54  } // namespace proto
55 } // namespace shared_model
56 
57 #endif // IROHA_PROTO_BLOCK_FACTORY_HPP
uint64_t HeightType
Type of height (for Block, Proposal etc)
Definition: types.hpp:48
Definition: hash.hpp:18
Definition: wsv_restorer_impl.hpp:20
ProtoBlockFactory(std::unique_ptr< shared_model::validation::AbstractValidator< shared_model::interface::Block >> interface_validator, std::unique_ptr< shared_model::validation::AbstractValidator< iroha::protocol::Block >> proto_validator)
Definition: proto_block_factory.cpp:16
Definition: result_fwd.hpp:27
Definition: block.hpp:16
iroha::expected::Result< std::unique_ptr< interface::Block >, std::string > createBlock(iroha::protocol::Block block)
Definition: proto_block_factory.cpp:68
Definition: unsafe_block_factory.hpp:16
std::unique_ptr< interface::Block > unsafeCreateBlock(interface::types::HeightType height, const interface::types::HashType &prev_hash, interface::types::TimestampType created_time, const interface::types::TransactionsCollectionType &txs, const interface::types::HashCollectionType &rejected_hashes) override
Definition: proto_block_factory.cpp:26
boost::any_range< HashType, boost::forward_traversal_tag, const HashType & > HashCollectionType
Type of hash collection.
Definition: range_types.hpp:36
Definition: command_executor.hpp:13
boost::any_range< Transaction, boost::random_access_traversal_tag, Transaction & > TransactionsCollectionType
Type of transactions&#39; collection.
Definition: range_types.hpp:29
Definition: proto_block_factory.hpp:21
uint64_t TimestampType
Type of timestamp.
Definition: types.hpp:69