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_PROTO_TRANSACTION_HPP
7 #define IROHA_SHARED_MODEL_PROTO_TRANSACTION_HPP
8 
10 #include "transaction.pb.h"
11 
12 namespace shared_model {
13  namespace proto {
14  class Transaction final : public interface::Transaction {
15  public:
17 
18  explicit Transaction(const TransportType &transaction);
19 
20  explicit Transaction(TransportType &&transaction);
21 
22  explicit Transaction(TransportType &transaction);
23 
24  Transaction(const Transaction &transaction);
25 
26  Transaction(Transaction &&o) noexcept;
27 
28  ~Transaction() override;
29 
30  const interface::types::AccountIdType &creatorAccountId() const override;
31 
32  Transaction::CommandsType commands() const override;
33 
34  const interface::types::BlobType &blob() const override;
35 
36  const interface::types::BlobType &payload() const override;
37 
38  const interface::types::BlobType &reducedPayload() const override;
39 
40  interface::types::SignatureRangeType signatures() const override;
41 
42  const interface::types::HashType &reducedHash() const override;
43 
44  bool addSignature(const crypto::Signed &signed_blob,
45  const crypto::PublicKey &public_key) override;
46 
47  const interface::types::HashType &hash() const override;
48 
49  const TransportType &getTransport() const;
50 
51  interface::types::TimestampType createdTime() const override;
52 
53  interface::types::QuorumType quorum() const override;
54 
55  boost::optional<std::shared_ptr<interface::BatchMeta>> batchMeta()
56  const override;
57 
58  protected:
59  Transaction::ModelType *clone() const override;
60 
61  private:
62  struct Impl;
63  std::unique_ptr<Impl> impl_;
64  };
65  } // namespace proto
66 } // namespace shared_model
67 
68 #endif // IROHA_SHARED_MODEL_PROTO_TRANSACTION_HPP
Transaction(const TransportType &transaction)
Definition: transaction.cpp:68
bool addSignature(const crypto::Signed &signed_blob, const crypto::PublicKey &public_key) override
Definition: transaction.cpp:119
Definition: hash.hpp:18
Definition: default_constructible_unary_fn.hpp:23
Definition: transaction.hpp:14
Definition: blob.hpp:24
const interface::types::HashType & hash() const override
Definition: transaction.cpp:146
interface::types::TimestampType createdTime() const override
Definition: transaction.cpp:154
Transaction::CommandsType commands() const override
Definition: transaction.cpp:95
boost::any_range< Command, boost::random_access_traversal_tag, const Command & > CommandsType
Type of ordered collection of commands.
Definition: transaction.hpp:37
Definition: peer.hpp:48
const interface::types::AccountIdType & creatorAccountId() const override
Definition: transaction.cpp:90
boost::any_range< interface::Signature, boost::forward_traversal_tag, const Signature & > SignatureRangeType
Type of signature range, which returns when signatures are invoked.
Definition: range_types.hpp:24
const interface::types::BlobType & blob() const override
Definition: transaction.cpp:99
Transaction::ModelType * clone() const override
Definition: transaction.cpp:167
interface::types::SignatureRangeType signatures() const override
Definition: transaction.cpp:111
std::string AccountIdType
Type of account id.
Definition: types.hpp:37
Definition: range_types.hpp:19
const interface::types::BlobType & payload() const override
Definition: transaction.cpp:103
const char * PublicKey
Definition: iroha_conf_literals.cpp:33
const TransportType & getTransport() const
Definition: transaction.cpp:150
boost::optional< std::shared_ptr< interface::BatchMeta > > batchMeta() const override
Definition: transaction.cpp:163
Definition: command_executor.hpp:12
const interface::types::HashType & reducedHash() const override
Definition: transaction.cpp:115
const interface::types::BlobType & reducedPayload() const override
Definition: transaction.cpp:107
uint16_t QuorumType
Type of Quorum used in transaction and set quorum.
Definition: types.hpp:59
Definition: transaction.hpp:22
iroha::protocol::Transaction TransportType
Definition: transaction.hpp:16
interface::types::QuorumType quorum() const override
Definition: transaction.cpp:158
Definition: batch_meta.hpp:18
uint64_t TimestampType
Type of timestamp.
Definition: types.hpp:61