TARAXA
Loading...
Searching...
No Matches
votes_bundle_rlp.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <libdevcore/Common.h>
4#include <libdevcore/RLP.h>
5
6#include <vector>
7
9
10namespace taraxa {
11
12class PbftVote;
13class PillarVote;
14
19// TOOD[2865]: move to cpp file
20constexpr static size_t kPbftVotesBundleRlpSize{5};
21
28dev::bytes encodePbftVotesBundleRlp(const std::vector<std::shared_ptr<PbftVote>>& votes);
29
36std::vector<std::shared_ptr<PbftVote>> decodePbftVotesBundleRlp(const dev::RLP& votes_bundle_rlp);
37
39 std::vector<std::shared_ptr<PbftVote>> votes;
40
42};
43
44constexpr static size_t kPillarVotesBundleRlpSize{3};
45
52dev::bytes encodePillarVotesBundleRlp(const std::vector<std::shared_ptr<PillarVote>>& votes);
53
60std::vector<std::shared_ptr<PillarVote>> decodePillarVotesBundleRlp(const dev::RLP& votes_bundle_rlp);
61
63 std::vector<std::shared_ptr<PillarVote>> pillar_votes;
64
66};
67
70} // namespace taraxa
Definition RLP.h:56
#define HAS_RLP_FIELDS
Definition encoding_rlp.hpp:208
std::vector< std::shared_ptr< PillarVote > > pillar_votes
Definition votes_bundle_rlp.hpp:63
std::vector< std::shared_ptr< PbftVote > > votes
Definition votes_bundle_rlp.hpp:39
std::vector< std::shared_ptr< PillarVote > > decodePillarVotesBundleRlp(const dev::RLP &votes_bundle_rlp)
Decodes pillar votes from optimized votes bundle rlp.
Definition votes_bundle_rlp.cpp:81
static constexpr size_t kPillarVotesBundleRlpSize
Definition votes_bundle_rlp.hpp:44
std::vector< std::shared_ptr< PbftVote > > decodePbftVotesBundleRlp(const dev::RLP &votes_bundle_rlp)
Decodes pbft votes from optimized votes bundle rlp.
Definition votes_bundle_rlp.cpp:33
dev::bytes encodePillarVotesBundleRlp(const std::vector< std::shared_ptr< PillarVote > > &votes)
Encodes pillar votes into optimized votes bundle rlp.
Definition votes_bundle_rlp.cpp:60
dev::bytes encodePbftVotesBundleRlp(const std::vector< std::shared_ptr< PbftVote > > &votes)
Encodes pbft votes into optimized votes bundle rlp.
Definition votes_bundle_rlp.cpp:8
static constexpr size_t kPbftVotesBundleRlpSize
Definition votes_bundle_rlp.hpp:20
Definition votes_bundle_rlp.hpp:38
Definition votes_bundle_rlp.hpp:62
std::vector<::byte > bytes
Definition Common.h:46
Definition app.hpp:16