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 
9 #include "block.pb.h"
12 
13 namespace shared_model {
14  namespace proto {
15  class Block final : public interface::Block {
16  public:
17  using TransportType = iroha::protocol::Block_v1;
18 
19  Block(Block &&o) noexcept;
20  Block &operator=(Block &&o) noexcept = default;
21  explicit Block(const TransportType &ref);
22  explicit Block(TransportType &&ref);
23 
25  const override;
26 
27  interface::types::HeightType height() const override;
28 
29  const interface::types::HashType &prevHash() const override;
30 
31  const interface::types::BlobType &blob() const override;
32 
34 
35  bool addSignature(
36  interface::types::SignedHexStringView signed_blob,
37  interface::types::PublicKeyHexStringView public_key) override;
38 
39  const interface::types::HashType &hash() const override;
40 
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:48
Definition: hash.hpp:18
const interface::types::BlobType & payload() const override
Definition: block.cpp:139
Definition: blob.hpp:27
const interface::types::HashType & prevHash() const override
Definition: block.cpp:83
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
Block & operator=(Block &&o) noexcept=default
const interface::types::BlobType & blob() const override
Definition: block.cpp:87
Definition: block.hpp:16
iroha::protocol::Block_v1 TransportType
Definition: block.hpp:17
interface::types::HeightType height() const override
Definition: block.cpp:79
interface::types::SignatureRangeType signatures() const override
Definition: block.cpp:91
interface::Block::ModelType * clone() const override
Definition: block.cpp:147
interface::types::HashCollectionType rejected_transactions_hashes() const override
Definition: block.cpp:134
const iroha::protocol::Block_v1 & getTransport() const
Definition: block.cpp:143
Definition: block.hpp:15
interface::types::TimestampType createdTime() const override
Definition: block.cpp:130
const interface::types::HashType & hash() const override
Definition: block.cpp:126
interface::types::TransactionsCollectionType transactions() const override
Definition: block.cpp:75
Definition: block.cpp:18
boost::any_range< HashType, boost::forward_traversal_tag, const HashType & > HashCollectionType
Type of hash collection.
Definition: range_types.hpp:36
Definition: command_executor.hpp:13
boost::any_range< Transaction, boost::random_access_traversal_tag, Transaction & > TransactionsCollectionType
Type of transactions&#39; collection.
Definition: range_types.hpp:29
bool addSignature(interface::types::SignedHexStringView signed_blob, interface::types::PublicKeyHexStringView public_key) override
Definition: block.cpp:95
uint64_t TimestampType
Type of timestamp.
Definition: types.hpp:69