hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
shared_model::interface::TransactionResponse Class Referenceabstract

#include "tx_response.hpp"

Inheritance diagram for shared_model::interface::TransactionResponse:
Inheritance graph
Collaboration diagram for shared_model::interface::TransactionResponse:
Collaboration graph

Public Types

enum  PrioritiesComparisonResult { PrioritiesComparisonResult::kLess, PrioritiesComparisonResult::kEqual, PrioritiesComparisonResult::kGreater }
 
using ResponseVariantType = wrap< StatelessFailedTxResponse, StatelessValidTxResponse, StatefulFailedTxResponse, StatefulValidTxResponse, RejectedTxResponse, CommittedTxResponse, MstExpiredResponse, NotReceivedTxResponse, MstPendingResponse, EnoughSignaturesCollectedResponse >
 Type of variant, that handle all concrete tx responses in the system. More...
 
using TransactionHashType = interface::types::HashType
 Type of transaction hash. More...
 
using StatelessErrorOrFailedCommandNameType = std::string
 
using FailedCommandIndexType = size_t
 Type of command index, which failed validation. More...
 
using ErrorCodeType = uint32_t
 Type of command error code. More...
 
- Public Types inherited from shared_model::interface::ModelPrimitive< TransactionResponse >
using ModelType = TransactionResponse
 

Public Member Functions

virtual const TransactionHashTypetransactionHash () const =0
 
virtual const ResponseVariantTypeget () const =0
 
virtual const StatelessErrorOrFailedCommandNameTypestatelessErrorOrCommandName () const =0
 
virtual FailedCommandIndexType failedCommandIndex () const =0
 
virtual ErrorCodeType errorCode () const =0
 
PrioritiesComparisonResult comparePriorities (const ModelType &other) const noexcept
 
std::string toString () const override
 
bool operator== (const ModelType &rhs) const override
 
- Public Member Functions inherited from shared_model::interface::ModelPrimitive< TransactionResponse >
virtual bool operator== (const ModelType &rhs) const=0
 
virtual bool operator!= (const ModelType &rhs) const
 
virtual ~ModelPrimitive ()=default
 

Protected Member Functions

virtual int priority () const noexcept=0
 

Detailed Description

TransactionResponse is a status of transaction in system

Member Typedef Documentation

◆ ErrorCodeType

Type of command error code.

◆ FailedCommandIndexType

Type of command index, which failed validation.

◆ ResponseVariantType

◆ StatelessErrorOrFailedCommandNameType

Type of stateless validation error or command name, which failed validation

◆ TransactionHashType

Member Enumeration Documentation

◆ PrioritiesComparisonResult

Enumeration for holding result of priorities comparison

Enumerator
kLess 
kEqual 
kGreater 

Member Function Documentation

◆ comparePriorities()

TransactionResponse::PrioritiesComparisonResult TransactionResponse::comparePriorities ( const ModelType other) const
noexcept

Compare priorities of two transaction responses

Parameters
otherresponse
Returns
enumeration result of that comparison

◆ errorCode()

virtual ErrorCodeType shared_model::interface::TransactionResponse::errorCode ( ) const
pure virtual
Returns
error code, with which the command failed

Implemented in shared_model::proto::TransactionResponse.

◆ failedCommandIndex()

virtual FailedCommandIndexType shared_model::interface::TransactionResponse::failedCommandIndex ( ) const
pure virtual
Returns
index of failed command

Implemented in shared_model::proto::TransactionResponse.

◆ get()

virtual const ResponseVariantType& shared_model::interface::TransactionResponse::get ( ) const
pure virtual
Returns
attached concrete tx response

Implemented in shared_model::proto::TransactionResponse.

◆ operator==()

bool TransactionResponse::operator== ( const ModelType rhs) const
override

◆ priority()

virtual int shared_model::interface::TransactionResponse::priority ( ) const
protectedpure virtualnoexcept
Returns
priority of this transaction response; transaction response can only be replaced with one with higher priority

◆ statelessErrorOrCommandName()

virtual const StatelessErrorOrFailedCommandNameType& shared_model::interface::TransactionResponse::statelessErrorOrCommandName ( ) const
pure virtual
Returns
name of the failed command, if present; empty string otherwise

Implemented in shared_model::proto::TransactionResponse.

◆ toString()

std::string TransactionResponse::toString ( ) const
overridevirtual

Make string developer representation of object

Returns
string with internal state of object

Reimplemented from shared_model::interface::ModelPrimitive< TransactionResponse >.

Here is the call graph for this function:

◆ transactionHash()

virtual const TransactionHashType& shared_model::interface::TransactionResponse::transactionHash ( ) const
pure virtual
Returns
hash of corresponding transaction

Implemented in shared_model::proto::TransactionResponse.


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