Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc_p2p_avalanche_proof_voting.py
| Show All 33 Lines | |||||
| class AvalancheProofVotingTest(BitcoinTestFramework): | class AvalancheProofVotingTest(BitcoinTestFramework): | ||||
| def set_test_params(self): | def set_test_params(self): | ||||
| self.setup_clean_chain = True | self.setup_clean_chain = True | ||||
| self.num_nodes = 1 | self.num_nodes = 1 | ||||
| self.conflicting_proof_cooldown = 100 | self.conflicting_proof_cooldown = 100 | ||||
| self.peer_replacement_cooldown = 2000 | self.peer_replacement_cooldown = 2000 | ||||
| self.extra_args = [ | self.extra_args = [ | ||||
| ['-enableavalanche=1', '-enableavalancheproofreplacement=1', | ['-enableavalanche=1', '-enableavalancheproofreplacement=1', | ||||
| f'-avalancheconflictingproofcooldown={self.conflicting_proof_cooldown}', f'-avalanchepeerreplacementcooldown={self.peer_replacement_cooldown}', '-avacooldown=0'], | f'-avalancheconflictingproofcooldown={self.conflicting_proof_cooldown}', | ||||
| f'-avalanchepeerreplacementcooldown={self.peer_replacement_cooldown}', | |||||
| '-avacooldown=0', '-avaminquorumstake=0', '-avaminquorumconnectedstakeratio=0'], | |||||
| ] | ] | ||||
| self.supports_cli = False | self.supports_cli = False | ||||
| # Build a fake quorum of nodes. | # Build a fake quorum of nodes. | ||||
| def get_quorum(self, node): | def get_quorum(self, node): | ||||
| quorum = [get_ava_p2p_interface(node) | quorum = [get_ava_p2p_interface(node) | ||||
| for _ in range(0, QUORUM_NODE_COUNT)] | for _ in range(0, QUORUM_NODE_COUNT)] | ||||
| ▲ Show 20 Lines • Show All 243 Lines • ▼ Show 20 Lines | def update_tests(self, node): | ||||
| "Proof not found", | "Proof not found", | ||||
| node.getrawavalancheproof, | node.getrawavalancheproof, | ||||
| f"{proofid_seq50:0{64}x}") | f"{proofid_seq50:0{64}x}") | ||||
| def vote_tests(self, node): | def vote_tests(self, node): | ||||
| self.restart_node(0, extra_args=['-enableavalanche=1', | self.restart_node(0, extra_args=['-enableavalanche=1', | ||||
| '-avacooldown=0', | '-avacooldown=0', | ||||
| '-avalancheconflictingproofcooldown=0', | '-avalancheconflictingproofcooldown=0', | ||||
| '-whitelist=noban@127.0.0.1', ]) | '-whitelist=noban@127.0.0.1', | ||||
| '-avaminquorumstake=0', | |||||
| '-avaminquorumconnectedstakeratio=0']) | |||||
| ava_node = get_ava_p2p_interface(node) | ava_node = get_ava_p2p_interface(node) | ||||
| # Generate coinbases to use for stakes | # Generate coinbases to use for stakes | ||||
| stakes_key = node.get_deterministic_priv_key() | stakes_key = node.get_deterministic_priv_key() | ||||
| blocks = node.generatetoaddress(4, stakes_key.address) | blocks = node.generatetoaddress(4, stakes_key.address) | ||||
| # Get the ava key so we can verify signatures. | # Get the ava key so we can verify signatures. | ||||
| ▲ Show 20 Lines • Show All 110 Lines • Show Last 20 Lines | |||||