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 #include "block.pb.h"
11 #include "common/result.hpp"
14 
15 namespace shared_model {
16  namespace proto {
21  public:
24  shared_model::interface::Block>> interface_validator,
26  iroha::protocol::Block>> proto_validator);
27 
28  std::unique_ptr<interface::Block> unsafeCreateBlock(
30  const interface::types::HashType &prev_hash,
33  const interface::types::HashCollectionType &rejected_hashes) override;
34 
42  iroha::expected::Result<std::unique_ptr<interface::Block>, std::string>
43  createBlock(iroha::protocol::Block block);
44 
45  private:
48  interface_validator_;
49  std::unique_ptr<
51  proto_validator_;
52  };
53  } // namespace proto
54 } // namespace shared_model
55 
56 #endif // IROHA_PROTO_BLOCK_FACTORY_HPP
uint64_t HeightType
Type of height (for Block, Proposal etc)
Definition: types.hpp:39
Definition: hash.hpp:18
Definition: abstract_validator.hpp:16
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:13
Definition: block.hpp:15
iroha::expected::Result< std::unique_ptr< interface::Block >, std::string > createBlock(iroha::protocol::Block block)
Definition: proto_block_factory.cpp:56
boost::any_range< HashType, boost::forward_traversal_tag, const HashType & > HashCollectionType
Type of hash collection.
Definition: range_types.hpp:38
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:23
Definition: command_executor.hpp:12
Definition: proto_block_factory.hpp:20
uint64_t TimestampType
Type of timestamp.
Definition: types.hpp:59
boost::any_range< Transaction, boost::random_access_traversal_tag, const Transaction & > TransactionsCollectionType
Type of transactions&#39; collection.
Definition: range_types.hpp:29