hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
tx_response.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_TX_RESPONSE_HPP
7 #define IROHA_TX_RESPONSE_HPP
8 
9 #include <boost/variant/variant_fwd.hpp>
10 
13 
14 namespace shared_model {
15  namespace interface {
16 
21  class RejectedTxResponse;
22  class CommittedTxResponse;
23  class MstExpiredResponse;
25  class MstPendingResponse;
27 
31  class TransactionResponse : public ModelPrimitive<TransactionResponse> {
32  private:
34  template <typename... Value>
35  using wrap = boost::variant<const Value &...>;
36 
37  protected:
42  virtual int priority() const noexcept = 0;
43 
44  public:
56 
59 
63  virtual const TransactionHashType &transactionHash() const = 0;
64 
68  virtual const ResponseVariantType &get() const = 0;
69 
77  statelessErrorOrCommandName() const = 0;
78 
80  using FailedCommandIndexType = size_t;
84  virtual FailedCommandIndexType failedCommandIndex() const = 0;
85 
87  using ErrorCodeType = uint32_t;
91  virtual ErrorCodeType errorCode() const = 0;
92 
103  noexcept;
104 
105  // ------------------------| Primitive override |-------------------------
106 
107  std::string toString() const override;
108 
109  bool operator==(const ModelType &rhs) const override;
110  };
111  } // namespace interface
112 } // namespace shared_model
113 #endif // IROHA_TX_RESPONSE_HPP
virtual const TransactionHashType & transactionHash() const =0
uint32_t ErrorCodeType
Type of command error code.
Definition: tx_response.hpp:87
TrivialProto< interface::CommittedTxResponse, iroha::protocol::ToriiResponse > CommittedTxResponse
Definition: proto_concrete_tx_response.hpp:42
virtual const StatelessErrorOrFailedCommandNameType & statelessErrorOrCommandName() const =0
Definition: hash.hpp:18
std::string StatelessErrorOrFailedCommandNameType
Definition: tx_response.hpp:72
TrivialProto< interface::StatefulValidTxResponse, iroha::protocol::ToriiResponse > StatefulValidTxResponse
Definition: proto_concrete_tx_response.hpp:37
TrivialProto< interface::EnoughSignaturesCollectedResponse, iroha::protocol::ToriiResponse > EnoughSignaturesCollectedResponse
Definition: proto_concrete_tx_response.hpp:56
crypto::Hash HashType
Type of hash.
Definition: types.hpp:33
size_t FailedCommandIndexType
Type of command index, which failed validation.
Definition: tx_response.hpp:80
TrivialProto< interface::MstPendingResponse, iroha::protocol::ToriiResponse > MstPendingResponse
Definition: proto_concrete_tx_response.hpp:53
string(REPLACE".""/"CMAKE_SWIG_OUTDIR ${SWIG_JAVA_PKG}) else() set(CMAKE_SWIG_FLAGS"") endif() myswig_add_library(irohajava LANGUAGE java SOURCES bindings.i) unset(CMAKE_SWIG_FLAGS) swig_link_libraries(irohajava $
Definition: CMakeLists.txt:54
virtual ErrorCodeType errorCode() const =0
std::string toString() const override
Definition: tx_response.cpp:45
virtual FailedCommandIndexType failedCommandIndex() const =0
TrivialProto< interface::RejectedTxResponse, iroha::protocol::ToriiResponse > RejectedTxResponse
Definition: proto_concrete_tx_response.hpp:44
TrivialProto< interface::StatelessValidTxResponse, iroha::protocol::ToriiResponse > StatelessValidTxResponse
Definition: proto_concrete_tx_response.hpp:29
PrioritiesComparisonResult comparePriorities(const ModelType &other) const noexcept
Definition: tx_response.cpp:35
Definition: enough_signatures_collected_response.hpp:15
Definition: tx_response.hpp:31
bool operator==(const ModelType &rhs) const override
Definition: tx_response.cpp:56
wrap< StatelessFailedTxResponse, StatelessValidTxResponse, StatefulFailedTxResponse, StatefulValidTxResponse, RejectedTxResponse, CommittedTxResponse, MstExpiredResponse, NotReceivedTxResponse, MstPendingResponse, EnoughSignaturesCollectedResponse > ResponseVariantType
Type of variant, that handle all concrete tx responses in the system.
Definition: tx_response.hpp:55
Definition: model_primitive.hpp:23
TrivialProto< interface::MstExpiredResponse, iroha::protocol::ToriiResponse > MstExpiredResponse
Definition: proto_concrete_tx_response.hpp:49
TrivialProto< interface::StatelessFailedTxResponse, iroha::protocol::ToriiResponse > StatelessFailedTxResponse
Definition: proto_concrete_tx_response.hpp:26
Definition: command_executor.hpp:12
virtual int priority() const noexcept=0
TrivialProto< interface::StatefulFailedTxResponse, iroha::protocol::ToriiResponse > StatefulFailedTxResponse
Definition: proto_concrete_tx_response.hpp:34
TrivialProto< interface::NotReceivedTxResponse, iroha::protocol::ToriiResponse > NotReceivedTxResponse
Definition: proto_concrete_tx_response.hpp:51
PrioritiesComparisonResult
Definition: tx_response.hpp:96