// A helper function to lookup the CallContextManager and create a new
// CallContext in it.
A helper function to lookup the CallContextManager and create a new
CallContext in it.
A helper function to lookup the CallContextManager and create a new CallContext in it .
fn new_call_context(
        &self,
        canister: &mut CanisterState,
        call_origin: CallOrigin,
    ) -> CallContextId {
        let canister_id = canister.canister_id();
        // The `unwrap()` here is safe as we ensured that the canister has a call
        // context manager in `get_canister_from_state()`.
        let manager = canister
            .system_state
            .call_context_manager_mut()
            .unwrap_or_else(|| {
                fatal!(
                    self.log,
                    "Canister {}: Expected to find a CallContextManager",
                    canister_id
                )
            });
        manager.new_call_context(call_origin, Cycles::from(0))
    }
fn new_call_context ( & self , canister : & mut CanisterState , call_origin : CallOrigin , ) -> CallContextId { let canister_id = canister . canister_id ( ) ; // The `unwrap()` here is safe as we ensured that the canister has a call // context manager in `get_canister_from_state()`. let manager = canister . system_state . call_context_manager_mut ( ) . unwrap_or_else ( | | { fatal ! ( self log " " canister_id ) } ) ; manager . new_call_context ( call_origin , Cycles :: from ( 0 ) ) }
A helper function to lookup the CallContextManager and create a new
CallContext in it.
A helper function to lookup the CallContextManager and create a new CallContext in it .
&self
canister
&mut CanisterState
call_origin
CallOrigin