Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/test/processor_tests.cpp
Show First 20 Lines • Show All 848 Lines • ▼ Show 20 Lines | BOOST_AUTO_TEST_CASE(quorum_diversity) { | ||||
round = getRound(); | round = getRound(); | ||||
for (size_t i = 0; i < avanodes.size(); i++) { | for (size_t i = 0; i < avanodes.size(); i++) { | ||||
NodeId nodeid = getSuitableNodeToQuery(); | NodeId nodeid = getSuitableNodeToQuery(); | ||||
BOOST_CHECK(node_round_map.find(nodeid) == node_round_map.end()); | BOOST_CHECK(node_round_map.find(nodeid) == node_round_map.end()); | ||||
node_round_map[nodeid] = getRound(); | node_round_map[nodeid] = getRound(); | ||||
runEventLoop(); | runEventLoop(); | ||||
} | } | ||||
// Now only tge first node can vote. All others would be duplicate in the | // Now only the first node can vote. All others would be duplicate in the | ||||
// quorum. | // quorum. | ||||
auto confidence = m_processor->getConfidence(pindex); | auto confidence = m_processor->getConfidence(pindex); | ||||
BOOST_REQUIRE(confidence > 0); | BOOST_REQUIRE(confidence > 0); | ||||
for (auto &pair : node_round_map) { | for (auto &[nodeid, round] : node_round_map) { | ||||
NodeId nodeid = pair.first; | uint64_t r = round; | ||||
uint64_t r = pair.second; | |||||
if (nodeid == firstNodeId) { | if (nodeid == firstNodeId) { | ||||
// Node 0 is the only one which can vote at this stage. | // Node 0 is the only one which can vote at this stage. | ||||
round = r; | round = r; | ||||
continue; | continue; | ||||
} | } | ||||
BOOST_CHECK( | BOOST_CHECK( | ||||
▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines |