hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
vote_message.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_VOTE_MESSAGE_HPP
7 #define IROHA_VOTE_MESSAGE_HPP
8 
9 #include <memory>
10 
11 #include "consensus/yac/yac_hash_provider.hpp" // for YacHash
13 #include "utils/string_builder.hpp"
14 
15 namespace iroha {
16  namespace consensus {
17  namespace yac {
18 
22  struct VoteMessage {
24  std::shared_ptr<shared_model::interface::Signature> signature;
25 
26  bool operator==(const VoteMessage &rhs) const {
27  return hash == rhs.hash and *signature == *rhs.signature;
28  }
29 
30  bool operator!=(const VoteMessage &rhs) const {
31  return not(*this == rhs);
32  }
33 
34  std::string toString() const {
36  .init("VoteMessage")
37  .appendNamed("yac hash", hash)
38  .appendNamed("signature", signature)
39  .finalize();
40  }
41  };
42 
43  } // namespace yac
44  } // namespace consensus
45 } // namespace iroha
46 
47 #endif // IROHA_VOTE_MESSAGE_HPP
std::string toString() const
Definition: vote_message.hpp:34
PrettyStringBuilder & init(const std::string &name)
Definition: string_builder.cpp:18
Definition: yac_hash_provider.hpp:30
std::string finalize()
Definition: string_builder.cpp:44
std::shared_ptr< shared_model::interface::Signature > signature
Definition: vote_message.hpp:24
Definition: string_builder.hpp:18
Definition: block_query.hpp:15
YacHash hash
Definition: vote_message.hpp:23
bool operator==(const VoteMessage &rhs) const
Definition: vote_message.hpp:26
Definition: vote_message.hpp:22
bool operator!=(const VoteMessage &rhs) const
Definition: vote_message.hpp:30
PrettyStringBuilder & appendNamed(const Name &name, const Value &value)
----—— Augmented appending functions. ----—— ///
Definition: string_builder.hpp:53