def test_get_root_block_header_sync_from_genesis(self):
    ' Test the broadcast is only done to the neighbors '
    id1 = Identity.create_random_identity()
    acc1 = Address.create_from_identity(id1, full_shard_key=0)
    with ClusterContext(2, acc1, connect=False) as clusters:
        master = clusters[0].master
        root_block_header_list = [master.root_state.tip]
        for i in range(10):
            root_block = call_async(master.get_next_block_to_mine(Address.create_empty_account(), branch_value=None))
            call_async(master.add_root_block(root_block))
            root_block_header_list.append(root_block.header)
        call_async(clusters[1].network.connect('127.0.0.1', clusters[0].network.env.cluster_config.P2P_PORT))
        assert_true_with_timeout((lambda : (clusters[1].master.root_state.tip == root_block_header_list[(- 1)])))
        self.assertEqual(clusters[1].master.synchronizer.stats.blocks_downloaded, (len(root_block_header_list) - 1))
Test the broadcast is only done to the neighbors
def test_get_root_block_header_sync_from_genesis(self):
    '  '
    id1 = Identity.create_random_identity()
    acc1 = Address.create_from_identity(id1, full_shard_key=0)
    with ClusterContext(2, acc1, connect=False) as clusters:
        master = clusters[0].master
        root_block_header_list = [master.root_state.tip]
        for i in range(10):
            root_block = call_async(master.get_next_block_to_mine(Address.create_empty_account(), branch_value=None))
            call_async(master.add_root_block(root_block))
            root_block_header_list.append(root_block.header)
        call_async(clusters[1].network.connect('127.0.0.1', clusters[0].network.env.cluster_config.P2P_PORT))
        assert_true_with_timeout((lambda : (clusters[1].master.root_state.tip == root_block_header_list[(- 1)])))
        self.assertEqual(clusters[1].master.synchronizer.stats.blocks_downloaded, (len(root_block_header_list) - 1))