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  interface::types::TimestampType createdTime() const override;
40 
41  interface::types::TransactionsNumberType txsNumber() const override;
42 
44  const override;
45 
46  const interface::types::BlobType &payload() const override;
47 
48  typename interface::Block::ModelType *clone() const override;
49 
50  const iroha::protocol::Block_v1 &getTransport() const;
51 
52  ~Block() override;
53 
54  private:
55  struct Impl;
56  std::unique_ptr<Impl> impl_;
57  };
58  } // namespace proto
59 } // namespace shared_model
60 
61 #endif // IROHA_SHARED_MODEL_PROTO_BLOCK_HPP
uint64_t HeightType
Type of height (for Block, Proposal etc)
Definition: types.hpp:41
Definition: hash.hpp:18
const interface::types::BlobType & payload() const override
Definition: block.cpp:133
Definition: blob.hpp:24
Definition: peer.hpp:48
const iroha::protocol::Block_v1 & getTransport() const
Definition: block.cpp:137
const interface::types::HashType & prevHash() const override
Definition: block.cpp:81
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:85
Definition: block.hpp:15
iroha::protocol::Block_v1 TransportType
Definition: block.hpp:18
interface::types::HeightType height() const override
Definition: block.cpp:77
Definition: block_query.hpp:16
interface::types::SignatureRangeType signatures() const override
Definition: block.cpp:89
interface::Block::ModelType * clone() const override
Definition: block.cpp:141
Definition: range_types.hpp:19
interface::types::HashCollectionType rejected_transactions_hashes() const override
Definition: block.cpp:128
boost::any_range< HashType, boost::forward_traversal_tag, const HashType & > HashCollectionType
Type of hash collection.
Definition: range_types.hpp:38
Definition: block.hpp:16
uint16_t TransactionsNumberType
Type of a number of transactions in block and query response page.
Definition: types.hpp:79
interface::types::TimestampType createdTime() const override
Definition: block.cpp:120
interface::types::TransactionsCollectionType transactions() const override
Definition: block.cpp:73
bool addSignature(const crypto::Signed &signed_blob, const crypto::PublicKey &public_key) override
Definition: block.cpp:93
Definition: block.cpp:17
Definition: command_executor.hpp:12
interface::types::TransactionsNumberType txsNumber() const override
Definition: block.cpp:124
uint64_t TimestampType
Type of timestamp.
Definition: types.hpp:61
boost::any_range< Transaction, boost::random_access_traversal_tag, const Transaction & > TransactionsCollectionType
Type of transactions&#39; collection.
Definition: range_types.hpp:29