hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
block.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_SHARED_MODEL_PROTO_BLOCK_HPP
7 #define IROHA_SHARED_MODEL_PROTO_BLOCK_HPP
8 
10 
11 #include "block.pb.h"
13 
14 namespace shared_model {
15  namespace proto {
16  class Block final : public interface::Block {
17  public:
18  using TransportType = iroha::protocol::Block_v1;
19 
20  Block(Block &&o) noexcept;
21  Block &operator=(Block &&o) noexcept = default;
22  explicit Block(const TransportType &ref);
23  explicit Block(TransportType &&ref);
24 
26  const override;
27 
28  interface::types::HeightType height() const override;
29 
30  const interface::types::HashType &prevHash() const override;
31 
32  const interface::types::BlobType &blob() const override;
33 
34  interface::types::SignatureRangeType signatures() const override;
35 
36  bool addSignature(const crypto::Signed &signed_blob,
37  const crypto::PublicKey &public_key) override;
38 
39  const interface::types::HashType &hash() const override;
40 
41  interface::types::TimestampType createdTime() const override;
42 
43  interface::types::TransactionsNumberType txsNumber() const override;
44 
46  const override;
47 
48  const interface::types::BlobType &payload() const override;
49 
50  typename interface::Block::ModelType *clone() const override;
51 
52  const iroha::protocol::Block_v1 &getTransport() const;
53 
54  ~Block() override;
55 
56  private:
57  struct Impl;
58  std::unique_ptr<Impl> impl_;
59  };
60  } // namespace proto
61 } // namespace shared_model
62 
63 #endif // IROHA_SHARED_MODEL_PROTO_BLOCK_HPP
uint64_t HeightType
Type of height (for Block, Proposal etc)
Definition: types.hpp:43
Definition: hash.hpp:18
const interface::types::BlobType & payload() const override
Definition: block.cpp:137
Definition: blob.hpp:25
Definition: peer.hpp:48
const iroha::protocol::Block_v1 & getTransport() const
Definition: block.cpp:141
const interface::types::HashType & prevHash() const override
Definition: block.cpp:82
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
Block(Block &&o) noexcept
const interface::types::BlobType & blob() const override
Definition: block.cpp:86
Definition: block.hpp:16
iroha::protocol::Block_v1 TransportType
Definition: block.hpp:18
interface::types::HeightType height() const override
Definition: block.cpp:78
Definition: block_query.hpp:14
interface::types::SignatureRangeType signatures() const override
Definition: block.cpp:90
interface::Block::ModelType * clone() const override
Definition: block.cpp:145
Definition: range_types.hpp:19
interface::types::HashCollectionType rejected_transactions_hashes() const override
Definition: block.cpp:132
const char * PublicKey
Definition: iroha_conf_literals.cpp:41
Definition: block.hpp:16
uint16_t TransactionsNumberType
Type of a number of transactions in block and query response page.
Definition: types.hpp:81
interface::types::TimestampType createdTime() const override
Definition: block.cpp:124
const interface::types::HashType & hash() const override
Definition: block.cpp:120
interface::types::TransactionsCollectionType transactions() const override
Definition: block.cpp:74
bool addSignature(const crypto::Signed &signed_blob, const crypto::PublicKey &public_key) override
Definition: block.cpp:94
Definition: block.cpp:17
boost::any_range< HashType, boost::forward_traversal_tag, const HashType & > HashCollectionType
Type of hash collection.
Definition: range_types.hpp:36
Definition: command_executor.hpp:12
interface::types::TransactionsNumberType txsNumber() const override
Definition: block.cpp:128
uint64_t TimestampType
Type of timestamp.
Definition: types.hpp:64
boost::any_range< Transaction, boost::random_access_traversal_tag, const Transaction & > TransactionsCollectionType
Type of transactions&#39; collection.
Definition: range_types.hpp:29