hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
iroha::ametsuchi::MutableFactory Class Referenceabstract

#include "mutable_factory.hpp"

Inheritance diagram for iroha::ametsuchi::MutableFactory:
Inheritance graph
Collaboration diagram for iroha::ametsuchi::MutableFactory:
Collaboration graph

Public Member Functions

virtual expected::Result< std::unique_ptr< MutableStorage >, std::string > createMutableStorage ()=0
 
virtual CommitResult commit (std::unique_ptr< MutableStorage > mutableStorage)=0
 
virtual bool preparedCommitEnabled () const =0
 Check if prepared commits are enabled. More...
 
virtual CommitResult commitPrepared (std::shared_ptr< const shared_model::interface::Block > block)=0
 
virtual ~MutableFactory ()=default
 

Constructor & Destructor Documentation

virtual iroha::ametsuchi::MutableFactory::~MutableFactory ( )
virtualdefault

Member Function Documentation

virtual CommitResult iroha::ametsuchi::MutableFactory::commit ( std::unique_ptr< MutableStorage mutableStorage)
pure virtual

Commit mutable storage to Ametsuchi. This transforms Ametsuchi to the new state consistent with MutableStorage.

Parameters
mutableStorage
Returns
the status of commit

Implemented in iroha::ametsuchi::StorageImpl.

virtual CommitResult iroha::ametsuchi::MutableFactory::commitPrepared ( std::shared_ptr< const shared_model::interface::Block block)
pure virtual

Try to apply prepared block to Ametsuchi.

Parameters
blockThe previously prepared block that will be committed now.
Returns
Result of committing the prepared block.

Implemented in iroha::ametsuchi::StorageImpl.

virtual expected::Result<std::unique_ptr<MutableStorage>, std::string> iroha::ametsuchi::MutableFactory::createMutableStorage ( )
pure virtual

Creates a mutable storage from the current state. Mutable storage is the only way to commit the block to the ledger.

Returns
Created Result with mutable storage or error string

Implemented in iroha::ametsuchi::StorageImpl.

virtual bool iroha::ametsuchi::MutableFactory::preparedCommitEnabled ( ) const
pure virtual

Check if prepared commits are enabled.

Implemented in iroha::ametsuchi::StorageImpl.


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