/// Creates a `CertifiedStreamSlice` from the given subnet, containing a stream
/// slice with the given configuration.
Creates a `CertifiedStreamSlice` from the given subnet, containing a stream
slice with the given configuration.
Creates a ` CertifiedStreamSlice ` from the given subnet containing a stream slice with the given configuration .
pub(crate) fn make_certified_stream_slice(
    from: SubnetId,
    config: StreamConfig,
) -> CertifiedStreamSlice {
    let state_manager = FakeStateManager::new();
    let (_height, mut state) = state_manager.take_tip();
    let stream = generate_stream(&config);
    state.with_streams(btreemap![from => stream]);
    state_manager.commit_and_certify(state, CERTIFIED_HEIGHT, CertificationScope::Metadata);
    state_manager
        .encode_certified_stream_slice(
            from,
            Some(StreamIndex::new(config.message_begin)),
            Some(StreamIndex::new(config.message_begin)),
            Some((config.message_end - config.message_begin) as usize),
            None,
        )
        .unwrap()
}
pub ( crate ) fn make_certified_stream_slice ( from : SubnetId , config : StreamConfig , ) -> CertifiedStreamSlice { let state_manager = FakeStateManager :: new ( ) ; let ( _height , mut state ) = state_manager . take_tip ( ) ; let stream = generate_stream ( & config ) ; state . with_streams ( btreemap ! [ from stream ] ) ; state_manager . commit_and_certify ( state , CERTIFIED_HEIGHT , CertificationScope :: Metadata ) ; state_manager . encode_certified_stream_slice ( from , Some ( StreamIndex :: new ( config . message_begin ) ) , Some ( StreamIndex :: new ( config . message_begin ) ) , Some ( ( config . message_end - config . message_begin ) as usize ) , None , ) . unwrap ( ) }
Creates a `CertifiedStreamSlice` from the given subnet, containing a stream
slice with the given configuration.
Creates a ` CertifiedStreamSlice ` from the given subnet containing a stream slice with the given configuration .
from
SubnetId
config
StreamConfig