fn make_random_events(
            rng: &mut TestRng,
            start_id: Id,
            count: usize,
            path_filter: &str,
            deploys: &mut HashMap<DeployHash, Deploy>,
        ) -> Vec<ServerSentEvent> {
            (start_id..(start_id + count as u32))
                .map(|id| {
                    let data = match path_filter {
                        SSE_API_MAIN_PATH => SseData::random_block_added(rng),
                        SSE_API_DEPLOYS_PATH => {
                            let (event, deploy) = SseData::random_deploy_accepted(rng);
                            assert!(deploys.insert(*deploy.id(), deploy).is_none());
                            event
                        }
                        SSE_API_SIGNATURES_PATH => SseData::random_finality_signature(rng),
                        _ => unreachable!(),
                    };
                    ServerSentEvent { id: Some(id), data }
                })
                .collect()
        }
// Returns `count` random SSE events, all of a single variant defined by `path_filter`.  The
// events will have sequential IDs starting from `start_id`, and if the path filter
// indicates the events should be deploy-accepted ones, the corresponding random deploys
// will be inserted into `deploys`.
Returns `count` random SSE events, all of a single variant defined by `path_filter`.  The
events will have sequential IDs starting from `start_id`, and if the path filter
indicates the events should be deploy-accepted ones, the corresponding random deploys
will be inserted into `deploys`.
Returns ` count ` random SSE events all of a single variant defined by ` path_filter ` . The events will have sequential IDs starting from ` start_id ` and if the path filter indicates the events should be deploy - accepted ones the corresponding random deploys will be inserted into ` deploys ` .
fn make_random_events(
            rng: &mut TestRng,
            start_id: Id,
            count: usize,
            path_filter: &str,
            deploys: &mut HashMap<DeployHash, Deploy>,
        ) -> Vec<ServerSentEvent> {
            (start_id..(start_id + count as u32))
                .map(|id| {
                    let data = match path_filter {
                        SSE_API_MAIN_PATH => SseData::random_block_added(rng),
                        SSE_API_DEPLOYS_PATH => {
                            let (event, deploy) = SseData::random_deploy_accepted(rng);
                            assert!(deploys.insert(*deploy.id(), deploy).is_none());
                            event
                        }
                        SSE_API_SIGNATURES_PATH => SseData::random_finality_signature(rng),
                        _ => unreachable!(),
                    };
                    ServerSentEvent { id: Some(id), data }
                })
                .collect()
        }
fn make_random_events ( rng : & mut TestRng , start_id : Id , count : usize , path_filter : & str , deploys : & mut HashMap < DeployHash , Deploy > , ) -> Vec < ServerSentEvent > { ( start_id .. ( start_id + count as u32 ) ) . map ( | id | { let data = match path_filter { SSE_API_MAIN_PATH => SseData :: random_block_added ( rng ) , SSE_API_DEPLOYS_PATH => { let ( event , deploy ) = SseData :: random_deploy_accepted ( rng ) ; assert ! ( deploys insert ( deploy id ( ) deploy ) is_none ( ) ) ; event } SSE_API_SIGNATURES_PATH => SseData :: random_finality_signature ( rng ) , _ => unreachable ! ( ) , } ; ServerSentEvent { id : Some ( id ) , data } } ) . collect ( ) }
Returns `count` random SSE events, all of a single variant defined by `path_filter`.
Returns ` count ` random SSE events all of a single variant defined by ` path_filter ` .
rng
&mut TestRng
start_id
Id
count
usize
path_filter
&str
deploys
&mut HashMap<DeployHash, Deploy>
rng
&mut TestRng
start_id
Id
count
usize
path_filter
&str
deploys
&mut HashMap<DeployHash, Deploy>