90 bytes rlp(
bool inc_sig =
true,
bool inc_weight =
false)
const;
107 uint64_t
calculateWeight(uint64_t stake,
double dpos_total_votes_count,
double threshold)
const;
113 std::optional<uint64_t>
getWeight()
const;
116 std::ostringstream strm;
117 strm <<
"[Vote] " << std::endl;
118 strm <<
" vote_hash: " <<
vote_hash_ << std::endl;
119 strm <<
" voter: " <<
getVoter() << std::endl;
121 strm <<
" blockhash: " <<
block_hash_ << std::endl;
132 Json::Value
toJSON()
const;
#define HAS_RLP_FIELDS
Definition encoding_rlp.hpp:208
VrfPbftSortition vrf_sortition_
Definition pbft_vote.hpp:144
bool verifyVrfSortition(const vrf_pk_t &pk, bool strict) const
Verify VRF sortition.
Definition pbft_vote.cpp:102
bytes rlp(bool inc_sig=true, bool inc_weight=false) const
Recursive Length Prefix.
Definition pbft_vote.cpp:57
bytes optimizedRlp() const
Optimized Recursive Length Prefix.
Definition pbft_vote.cpp:81
vote_hash_t sha3(bool inc_sig) const override
Secure Hash Algorithm 3.
Definition pbft_vote.cpp:126
Json::Value toJSON() const
Get vote in JSON representation.
Definition pbft_vote.cpp:89
std::optional< uint64_t > weight_
Definition pbft_vote.hpp:145
PbftStep getStep() const
Get vote PBFT step.
Definition pbft_vote.cpp:124
const VrfPbftSortition & getVrfSortition() const
Get VRF sortition.
Definition pbft_vote.cpp:104
const public_t & getVoter() const
Get voter public key.
Definition vote.cpp:20
std::optional< uint64_t > getWeight() const
Get vote weight.
Definition pbft_vote.cpp:114
std::string toString() const
Definition pbft_vote.hpp:115
uint64_t calculateWeight(uint64_t stake, double dpos_total_votes_count, double threshold) const
Calculate vote weight.
Definition pbft_vote.cpp:108
PbftVoteTypes getType() const
Get vote type.
Definition pbft_vote.cpp:118
PbftPeriod getPeriod() const
Get vote PBFT period.
Definition pbft_vote.cpp:120
PbftRound getRound() const
Get vote PBFT round.
Definition pbft_vote.cpp:122
bool operator==(const PbftVote &other) const
Definition pbft_vote.cpp:54
const vrf_wrapper::vrf_proof_t & getSortitionProof() const
Get VRF sortition proof.
Definition pbft_vote.cpp:106
vote_hash_t vote_hash_
Definition vote.hpp:75
blk_hash_t block_hash_
Definition vote.hpp:72
sig_t vote_signature_
Definition vote.hpp:73
const vrf_wrapper::vrf_output_t & getCredential() const
Get VRF sortition output.
Definition pbft_vote.cpp:116
PbftVote class is a vote class that includes vote hash, vote on PBFT block hash, vote signature,...
Definition pbft_vote.hpp:20
Vote class is a vote class that includes vote hash, vote on PBFT block hash, vote signature,...
Definition vote.hpp:15
VrfPbftSortition class used for doing VRF sortition to place a vote or to propose a new PBFT block.
Definition vrf_sortition.hpp:76
PbftVoteTypes
Definition vrf_sortition.hpp:21
dev::FixedHash< crypto_vrf_PUBLICKEYBYTES > vrf_pk_t
Definition vrf_wrapper.hpp:11
uint32_t PbftStep
Definition types.hpp:27
std::vector< byte > bytes
Definition types.hpp:53
uint32_t PbftRound
Definition types.hpp:26
EthBlockNumber PbftPeriod
Definition types.hpp:25