MCPcopy Create free account
hub / github.com/ElementsProject/elements / run_test

Method run_test

test/functional/p2p_compactblocks.py:881–945  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

879 assert_highbandwidth_states(self.nodes[0], hb_to=True, hb_from=False)
880
881 def run_test(self):
882 util.node_fastmerkle = self.nodes[0]
883 self.wallet = MiniWallet(self.nodes[0])
884
885 # Setup the p2p connections
886 self.segwit_node = self.nodes[0].add_p2p_connection(TestP2PConn(cmpct_version=2))
887 self.old_node = self.nodes[0].add_p2p_connection(TestP2PConn(cmpct_version=1), services=NODE_NETWORK)
888 self.additional_segwit_node = self.nodes[0].add_p2p_connection(TestP2PConn(cmpct_version=2))
889
890 # We will need UTXOs to construct transactions in later tests.
891 self.make_utxos()
892
893 assert softfork_active(self.nodes[0], "segwit")
894
895 self.log.info("Testing SENDCMPCT p2p message... ")
896 self.test_sendcmpct(self.segwit_node, old_node=self.old_node)
897 self.test_sendcmpct(self.additional_segwit_node)
898
899 self.log.info("Testing compactblock construction...")
900 self.test_compactblock_construction(self.old_node)
901 self.test_compactblock_construction(self.segwit_node)
902
903 self.log.info("Testing compactblock requests (segwit node)... ")
904 self.test_compactblock_requests(self.segwit_node)
905
906 self.log.info("Testing getblocktxn requests (segwit node)...")
907 self.test_getblocktxn_requests(self.segwit_node)
908
909 self.log.info("Testing getblocktxn handler (segwit node should return witnesses)...")
910 self.test_getblocktxn_handler(self.segwit_node)
911 self.test_getblocktxn_handler(self.old_node)
912
913 self.log.info("Testing compactblock requests/announcements not at chain tip...")
914 self.test_compactblocks_not_at_tip(self.segwit_node)
915 self.test_compactblocks_not_at_tip(self.old_node)
916
917 self.log.info("Testing handling of incorrect blocktxn responses...")
918 self.test_incorrect_blocktxn_response(self.segwit_node)
919
920 self.log.info("Testing reconstructing compact blocks from all peers...")
921 self.test_compactblock_reconstruction_multiple_peers(self.segwit_node, self.additional_segwit_node)
922
923 # Test that if we submitblock to node1, we'll get a compact block
924 # announcement to all peers.
925 # (Post-segwit activation, blocks won't propagate from node0 to node1
926 # automatically, so don't bother testing a block announced to node0.)
927 self.log.info("Testing end-to-end block relay...")
928 self.request_cb_announcements(self.old_node)
929 self.request_cb_announcements(self.segwit_node)
930 self.test_end_to_end_block_relay([self.segwit_node, self.old_node])
931
932 self.log.info("Testing handling of invalid compact blocks...")
933 self.test_invalid_tx_in_compactblock(self.segwit_node)
934 self.test_invalid_tx_in_compactblock(self.old_node)
935
936 self.log.info("Testing handling of multiple blocktxn responses...")
937 self.test_multiple_blocktxn_response(self.segwit_node)
938

Callers

nothing calls this directly

Tested by

no test coverage detected