pub(crate) fn create_node<REv>(
        event_queue: EventQueueHandle<REv>,
        rng: &mut TestRng,
    ) -> InMemoryNetwork<P>
    where
        REv: From<NetworkAnnouncement<NodeId, P>> + Send,
    {
        ACTIVE_NETWORK.with(|active_network| {
            active_network
                .borrow_mut()
                .as_mut()
                .expect("tried to create node without active network set")
                .downcast_mut::<Self>()
                .expect("active network has wrong message type")
                .create_node_local(event_queue, rng)
        })
    }
/// Creates an in-memory network component on the active network.
///
/// # Panics
///
/// Panics if the internal lock has been poisoned, there is no active network or the active
/// network is not of the correct message type.
Creates an in-memory network component on the active network.
Creates an in - memory network component on the active network .
pub(crate) fn create_node<REv>(
        event_queue: EventQueueHandle<REv>,
        rng: &mut TestRng,
    ) -> InMemoryNetwork<P>
    where
        REv: From<NetworkAnnouncement<NodeId, P>> + Send,
    {
        ACTIVE_NETWORK.with(|active_network| {
            active_network
                .borrow_mut()
                .as_mut()
                .expect("tried to create node without active network set")
                .downcast_mut::<Self>()
                .expect("active network has wrong message type")
                .create_node_local(event_queue, rng)
        })
    }
pub ( crate ) fn create_node < REv > ( event_queue : EventQueueHandle < REv > , rng : & mut TestRng , ) -> InMemoryNetwork < P > where REv : From < NetworkAnnouncement < NodeId , P > > + Send , { ACTIVE_NETWORK . with ( | active_network | { active_network . borrow_mut ( ) . as_mut ( ) . expect ( " " ) . downcast_mut :: < Self > ( ) . expect ( " " ) . create_node_local ( event_queue , rng ) } ) }
Creates an in-memory network component on the active network.
Creates an in - memory network component on the active network .
event_queue
EventQueueHandle<REv>
rng
&mut TestRng
event_queue
EventQueueHandle<REv>
rng
&mut TestRng
panics
Panics if the internal lock has been poisoned, there is no active network or the active
network is not of the correct message type.
Panics if the internal lock has been poisoned there is no active network or the active network is not of the correct message type .