Bitcoin ABC 0.34.2
P2P Digital Currency
Namespaces | Functions
peermanager_tests.cpp File Reference
#include <avalanche/delegationbuilder.h>
#include <avalanche/peermanager.h>
#include <avalanche/proofbuilder.h>
#include <avalanche/proofcomparator.h>
#include <avalanche/statistics.h>
#include <avalanche/test/util.h>
#include <cashaddrenc.h>
#include <config.h>
#include <consensus/activation.h>
#include <core_io.h>
#include <key_io.h>
#include <script/solver.h>
#include <uint256.h>
#include <util/fs_helpers.h>
#include <util/time.h>
#include <util/translation.h>
#include <validation.h>
#include <test/util/blockindex.h>
#include <test/util/random.h>
#include <test/util/setup_common.h>
#include <boost/test/unit_test.hpp>
#include <limits>
#include <optional>
#include <unordered_map>
Include dependency graph for peermanager_tests.cpp:

Go to the source code of this file.

Namespaces

namespace  avalanche
 

Functions

 BOOST_AUTO_TEST_CASE (select_peer_linear)
 
 BOOST_AUTO_TEST_CASE (select_peer_dichotomic)
 
 BOOST_AUTO_TEST_CASE (select_peer_random)
 
static void addNodeWithScore (Chainstate &active_chainstate, avalanche::PeerManager &pm, NodeId node, uint32_t score)
 
 BOOST_AUTO_TEST_CASE (peer_probabilities)
 
 BOOST_AUTO_TEST_CASE (remove_peer)
 
 BOOST_AUTO_TEST_CASE (compact_slots)
 
 BOOST_AUTO_TEST_CASE (compact_slots_non_uniform_scores)
 
 BOOST_AUTO_TEST_CASE (node_crud)
 
 BOOST_AUTO_TEST_CASE (node_binding)
 
 BOOST_AUTO_TEST_CASE (node_binding_reorg)
 
 BOOST_AUTO_TEST_CASE (proof_conflict)
 
 BOOST_AUTO_TEST_CASE (immature_proofs)
 
 BOOST_AUTO_TEST_CASE (dangling_node)
 
 BOOST_AUTO_TEST_CASE (proof_accessors)
 
 BOOST_FIXTURE_TEST_CASE (conflicting_proof_rescan, NoCoolDownFixture)
 
 BOOST_FIXTURE_TEST_CASE (conflicting_proof_selection, NoCoolDownFixture)
 
 BOOST_AUTO_TEST_CASE (conflicting_immature_proofs)
 
 BOOST_FIXTURE_TEST_CASE (preferred_conflicting_proof, NoCoolDownFixture)
 
 BOOST_FIXTURE_TEST_CASE (update_next_conflict_time, NoCoolDownFixture)
 
 BOOST_FIXTURE_TEST_CASE (register_force_accept, NoCoolDownFixture)
 
 BOOST_FIXTURE_TEST_CASE (evicted_proof, NoCoolDownFixture)
 
 BOOST_AUTO_TEST_CASE (conflicting_proof_cooldown)
 
 BOOST_FIXTURE_TEST_CASE (reject_proof, NoCoolDownFixture)
 
 BOOST_AUTO_TEST_CASE (should_request_more_nodes)
 
 BOOST_AUTO_TEST_CASE (score_ordering)
 
 BOOST_FIXTURE_TEST_CASE (known_score_tracking, NoCoolDownFixture)
 
 BOOST_AUTO_TEST_CASE (connected_score_tracking)
 
 BOOST_FIXTURE_TEST_CASE (proof_radix_tree, NoCoolDownFixture)
 
 BOOST_AUTO_TEST_CASE (received_avaproofs)
 
 BOOST_FIXTURE_TEST_CASE (cleanup_dangling_proof, NoCoolDownFixture)
 
 BOOST_AUTO_TEST_CASE (register_proof_missing_utxo)
 
 BOOST_FIXTURE_TEST_CASE (proof_expiry, NoCoolDownFixture)
 
 BOOST_AUTO_TEST_CASE (select_staking_reward_winner)
 
 BOOST_FIXTURE_TEST_CASE (stake_contender_vote, NoCoolDownFixture)
 
 BOOST_FIXTURE_TEST_CASE (stake_contender_winners, NoCoolDownFixture)
 
 BOOST_AUTO_TEST_CASE (remote_proof)
 
 BOOST_AUTO_TEST_CASE (get_remote_status)
 
 BOOST_AUTO_TEST_CASE (dangling_with_remotes)
 
 BOOST_AUTO_TEST_CASE (avapeers_dump)
 
 BOOST_AUTO_TEST_CASE (dangling_proof_invalidation)
 
 BOOST_FIXTURE_TEST_CASE (dangling_evicted_on_preferred_peer, NoCoolDownFixture)
 
 BOOST_FIXTURE_TEST_CASE (cleanup_dangling_conflict, NoCoolDownFixture)
 

Function Documentation

◆ addNodeWithScore()

static void addNodeWithScore ( Chainstate &  active_chainstate,
avalanche::PeerManager &  pm,
NodeId  node,
uint32_t  score 
)
static

Definition at line 371 of file peermanager_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BOOST_AUTO_TEST_CASE() [1/27]

BOOST_AUTO_TEST_CASE ( avapeers_dump  )

Definition at line 3265 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [2/27]

BOOST_AUTO_TEST_CASE ( compact_slots  )

Definition at line 498 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [3/27]

BOOST_AUTO_TEST_CASE ( compact_slots_non_uniform_scores  )

Definition at line 530 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [4/27]

BOOST_AUTO_TEST_CASE ( conflicting_immature_proofs  )

Definition at line 1206 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [5/27]

BOOST_AUTO_TEST_CASE ( conflicting_proof_cooldown  )

Definition at line 1423 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [6/27]

BOOST_AUTO_TEST_CASE ( connected_score_tracking  )

Definition at line 1849 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [7/27]

BOOST_AUTO_TEST_CASE ( dangling_node  )

Definition at line 976 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [8/27]

BOOST_AUTO_TEST_CASE ( dangling_proof_invalidation  )

Definition at line 3397 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [9/27]

BOOST_AUTO_TEST_CASE ( dangling_with_remotes  )

Definition at line 3153 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [10/27]

BOOST_AUTO_TEST_CASE ( get_remote_status  )

Definition at line 3028 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [11/27]

BOOST_AUTO_TEST_CASE ( immature_proofs  )

Definition at line 893 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [12/27]

BOOST_AUTO_TEST_CASE ( node_binding  )

Definition at line 654 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [13/27]

BOOST_AUTO_TEST_CASE ( node_binding_reorg  )

Definition at line 760 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [14/27]

BOOST_AUTO_TEST_CASE ( node_crud  )

Definition at line 575 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [15/27]

BOOST_AUTO_TEST_CASE ( peer_probabilities  )

Definition at line 380 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [16/27]

BOOST_AUTO_TEST_CASE ( proof_accessors  )

Definition at line 1026 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [17/27]

BOOST_AUTO_TEST_CASE ( proof_conflict  )

Definition at line 824 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [18/27]

BOOST_AUTO_TEST_CASE ( received_avaproofs  )

Definition at line 2059 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [19/27]

BOOST_AUTO_TEST_CASE ( register_proof_missing_utxo  )

Definition at line 2223 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [20/27]

BOOST_AUTO_TEST_CASE ( remote_proof  )

Definition at line 2867 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [21/27]

BOOST_AUTO_TEST_CASE ( remove_peer  )

Definition at line 418 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [22/27]

BOOST_AUTO_TEST_CASE ( score_ordering  )

Definition at line 1704 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [23/27]

BOOST_AUTO_TEST_CASE ( select_peer_dichotomic  )

Definition at line 286 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [24/27]

BOOST_AUTO_TEST_CASE ( select_peer_linear  )

Definition at line 234 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [25/27]

BOOST_AUTO_TEST_CASE ( select_peer_random  )

Definition at line 341 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [26/27]

BOOST_AUTO_TEST_CASE ( select_staking_reward_winner  )

Definition at line 2280 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [27/27]

BOOST_AUTO_TEST_CASE ( should_request_more_nodes  )

Definition at line 1581 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_FIXTURE_TEST_CASE() [1/15]

BOOST_FIXTURE_TEST_CASE ( cleanup_dangling_conflict  ,
NoCoolDownFixture   
)

Definition at line 3518 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_FIXTURE_TEST_CASE() [2/15]

BOOST_FIXTURE_TEST_CASE ( cleanup_dangling_proof  ,
NoCoolDownFixture   
)

Definition at line 2083 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_FIXTURE_TEST_CASE() [3/15]

BOOST_FIXTURE_TEST_CASE ( conflicting_proof_rescan  ,
NoCoolDownFixture   
)

Definition at line 1075 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_FIXTURE_TEST_CASE() [4/15]

BOOST_FIXTURE_TEST_CASE ( conflicting_proof_selection  ,
NoCoolDownFixture   
)

Definition at line 1112 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_FIXTURE_TEST_CASE() [5/15]

BOOST_FIXTURE_TEST_CASE ( dangling_evicted_on_preferred_peer  ,
NoCoolDownFixture   
)

Definition at line 3479 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_FIXTURE_TEST_CASE() [6/15]

BOOST_FIXTURE_TEST_CASE ( evicted_proof  ,
NoCoolDownFixture   
)

Definition at line 1391 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_FIXTURE_TEST_CASE() [7/15]

BOOST_FIXTURE_TEST_CASE ( known_score_tracking  ,
NoCoolDownFixture   
)

Definition at line 1730 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_FIXTURE_TEST_CASE() [8/15]

BOOST_FIXTURE_TEST_CASE ( preferred_conflicting_proof  ,
NoCoolDownFixture   
)

Definition at line 1257 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_FIXTURE_TEST_CASE() [9/15]

BOOST_FIXTURE_TEST_CASE ( proof_expiry  ,
NoCoolDownFixture   
)

Definition at line 2236 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_FIXTURE_TEST_CASE() [10/15]

BOOST_FIXTURE_TEST_CASE ( proof_radix_tree  ,
NoCoolDownFixture   
)

Definition at line 1944 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_FIXTURE_TEST_CASE() [11/15]

BOOST_FIXTURE_TEST_CASE ( register_force_accept  ,
NoCoolDownFixture   
)

Definition at line 1325 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_FIXTURE_TEST_CASE() [12/15]

BOOST_FIXTURE_TEST_CASE ( reject_proof  ,
NoCoolDownFixture   
)

Definition at line 1495 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_FIXTURE_TEST_CASE() [13/15]

BOOST_FIXTURE_TEST_CASE ( stake_contender_vote  ,
NoCoolDownFixture   
)

Definition at line 2624 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_FIXTURE_TEST_CASE() [14/15]

BOOST_FIXTURE_TEST_CASE ( stake_contender_winners  ,
NoCoolDownFixture   
)

Definition at line 2784 of file peermanager_tests.cpp.

Here is the call graph for this function:

◆ BOOST_FIXTURE_TEST_CASE() [15/15]

BOOST_FIXTURE_TEST_CASE ( update_next_conflict_time  ,
NoCoolDownFixture   
)

Definition at line 1290 of file peermanager_tests.cpp.

Here is the call graph for this function: