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 boost::optional< std::unique_ptr< LedgerState > > commit (std::unique_ptr< MutableStorage > mutableStorage)=0
 
virtual boost::optional< std::unique_ptr< LedgerState > > 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 boost::optional<std::unique_ptr<LedgerState> > 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
new state of the ledger, boost::none if commit failed

Implemented in iroha::ametsuchi::StorageImpl.

virtual boost::optional<std::unique_ptr<LedgerState> > iroha::ametsuchi::MutableFactory::commitPrepared ( std::shared_ptr< const shared_model::interface::Block block)
pure virtual

Try to apply prepared block to Ametsuchi.

Returns
state of the ledger if commit is succesful, boost::none if prepared block failed to apply. WSV is not changed in this case.

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.


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