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 
36  .init("VoteMessage")
37  .append("yac hash", hash.toString())
38  .append("signature",
39  signature ? signature->toString() : "not set")
40  .finalize();
41  }
42  };
43 
44  } // namespace yac
45  } // namespace consensus
46 } // namespace iroha
47 
48 #endif // IROHA_VOTE_MESSAGE_HPP
PrettyStringBuilder & init(const std::string &name)
Definition: string_builder.cpp:18
bool operator==(const VoteMessage &rhs) const
Definition: vote_message.hpp:26
Definition: yac_hash_provider.hpp:30
std::shared_ptr< shared_model::interface::Signature > signature
Definition: vote_message.hpp:24
string(REPLACE".""/"CMAKE_SWIG_OUTDIR ${SWIG_JAVA_PKG}) else() set(CMAKE_SWIG_FLAGS"") endif() myswig_add_library(irohajava LANGUAGE java SOURCES bindings.i) unset(CMAKE_SWIG_FLAGS) swig_link_libraries(irohajava $
Definition: CMakeLists.txt:54
Definition: string_builder.hpp:16
Definition: block_query.hpp:16
std::string toString() const
Definition: yac_hash_provider.hpp:82
YacHash hash
Definition: vote_message.hpp:23
bool operator!=(const VoteMessage &rhs) const
Definition: vote_message.hpp:30
std::string toString() const
Definition: vote_message.hpp:34
PrettyStringBuilder & append(const std::string &name, const std::string &value)
Definition: string_builder.cpp:36
Definition: vote_message.hpp:22