Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/test/processor_tests.cpp
Show First 20 Lines • Show All 271 Lines • ▼ Show 20 Lines | struct ProofProvider { | ||||
buildVotesForItems(uint32_t error, | buildVotesForItems(uint32_t error, | ||||
std::vector<std::shared_ptr<Proof>> &&items) { | std::vector<std::shared_ptr<Proof>> &&items) { | ||||
size_t numItems = items.size(); | size_t numItems = items.size(); | ||||
std::vector<Vote> votes; | std::vector<Vote> votes; | ||||
votes.reserve(numItems); | votes.reserve(numItems); | ||||
// Votes are sorted by high score first | // Votes are sorted by high score first | ||||
std::sort(items.begin(), items.end(), ProofSharedPointerComparator()); | std::sort(items.begin(), items.end(), ProofComparator()); | ||||
for (auto &item : items) { | for (auto &item : items) { | ||||
votes.emplace_back(error, item->getId()); | votes.emplace_back(error, item->getId()); | ||||
} | } | ||||
return votes; | return votes; | ||||
} | } | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 894 Lines • Show Last 20 Lines |