hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
transaction.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_SHARED_MODEL_TRANSACTION_HPP
7 #define IROHA_SHARED_MODEL_TRANSACTION_HPP
8 
9 #include "common/cloneable.hpp"
12 
13 namespace shared_model {
14  namespace interface {
15 
16  class BatchMeta;
17  class Command;
18 
23  class Transaction : public Signable<Transaction>,
24  public Cloneable<Transaction> {
25  public:
29  virtual const types::AccountIdType &creatorAccountId() const = 0;
30 
34  virtual types::QuorumType quorum() const = 0;
35 
37  using CommandsType = boost::any_range<Command,
38  boost::random_access_traversal_tag,
39  const Command &>;
40 
44  virtual CommandsType commands() const = 0;
45 
49  virtual const types::BlobType &reducedPayload() const = 0;
50 
51  // TODO [IR-1874] Akvinikym 16.11.18: rename the field
55  virtual const types::HashType &reducedHash() const = 0;
56 
57  /*
58  * @return Batch Meta if exists
59  */
60  virtual boost::optional<std::shared_ptr<BatchMeta>> batchMeta() const = 0;
61 
62  std::string toString() const override;
63  };
64 
65  } // namespace interface
66 } // namespace shared_model
67 #endif // IROHA_SHARED_MODEL_TRANSACTION_HPP
Definition: hash.hpp:18
virtual const types::BlobType & reducedPayload() const =0
Definition: blob.hpp:25
virtual types::QuorumType quorum() const =0
Definition: signable.hpp:35
Definition: cloneable.hpp:33
boost::any_range< Command, boost::random_access_traversal_tag, const Command & > CommandsType
Type of ordered collection of commands.
Definition: transaction.hpp:39
std::string AccountIdType
Type of account id.
Definition: types.hpp:39
virtual const types::HashType & reducedHash() const =0
virtual CommandsType commands() const =0
Definition: command.hpp:40
std::string toString() const override
Definition: transaction.cpp:15
virtual boost::optional< std::shared_ptr< BatchMeta > > batchMeta() const =0
virtual const types::AccountIdType & creatorAccountId() const =0
Definition: command_executor.hpp:12
uint16_t QuorumType
Type of Quorum used in transaction and set quorum.
Definition: types.hpp:62
Definition: transaction.hpp:23