hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
shared_model::proto::ProtoBlockFactory Class Reference

#include "proto_block_factory.hpp"

Inheritance diagram for shared_model::proto::ProtoBlockFactory:
Inheritance graph
Collaboration diagram for shared_model::proto::ProtoBlockFactory:
Collaboration graph

Public Member Functions

 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)
 
std::unique_ptr< interface::BlockunsafeCreateBlock (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
 
iroha::expected::Result< std::unique_ptr< interface::Block >, std::string > createBlock (iroha::protocol::Block block)
 
- Public Member Functions inherited from shared_model::interface::UnsafeBlockFactory
virtual ~UnsafeBlockFactory ()=default
 

Detailed Description

ProtoBlockFactory is used to create proto::Block objects

Constructor & Destructor Documentation

ProtoBlockFactory::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 
)

Member Function Documentation

iroha::expected::Result< std::unique_ptr< shared_model::interface::Block >, std::string > ProtoBlockFactory::createBlock ( iroha::protocol::Block  block)

Create block variant

Parameters
block- proto block from which block variant is created
Returns
Pointer to block. Error if block is invalid

Here is the caller graph for this function:

std::unique_ptr< shared_model::interface::Block > ProtoBlockFactory::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 
)
overridevirtual

Create block without any validation

Parameters
height- block height
prev_hash- hash of the previous block
created_time- time the block is created
txs- list of transactions. If it empty, EmptyBlock is creted
Returns
BlockVariant with block or empty block

Implements shared_model::interface::UnsafeBlockFactory.

Here is the call graph for this function:


The documentation for this class was generated from the following files: