fn execute_query_method_for_ingress(
        &self,
        canister: CanisterState,
        ingress: Ingress,
        cycles: NumInstructions,
        time: Time,
    ) -> ExecuteMessageResult<CanisterState> {
        // Letting the canister grow arbitrarily when executing the
        // query is fine as we do not persist state modifications.
        let subnet_available_memory =
            SubnetAvailableMemory::new(self.config.subnet_memory_capacity.get() as i64);
        let execution_parameters = self.execution_parameters(
            &canister,
            cycles,
            subnet_available_memory,
            ExecutionMode::Replicated,
        );
        let (canister, cycles, result) = self.hypervisor.execute_query(
            QueryExecutionType::Replicated,
            ingress.method_name.as_str(),
            ingress.method_payload.as_slice(),
            *ingress.source.get_ref(),
            canister,
            None,
            time,
            execution_parameters,
        );

        let result = result
            .map_err(|err| self.log_and_transform_to_user_error(err, &canister.canister_id()));
        let ingress_status = match result {
            Ok(wasm_result) => match wasm_result {
                None => IngressStatus::Failed {
                    receiver: canister.canister_id().get(),
                    user_id: ingress.source,
                    error: UserError::new(
                        ErrorCode::CanisterDidNotReply,
                        format!(
                            "Canister {} did not reply to the call",
                            canister.canister_id(),
                        ),
                    ),
                    time,
                },
                Some(wasm_result) => IngressStatus::Completed {
                    receiver: canister.canister_id().get(),
                    user_id: ingress.source,
                    result: wasm_result,
                    time,
                },
            },
            Err(user_error) => IngressStatus::Failed {
                receiver: canister.canister_id().get(),
                user_id: ingress.source,
                error: user_error,
                time,
            },
        };
        ExecuteMessageResult {
            canister,
            num_instructions_left: cycles,
            ingress_status: Some((ingress.message_id, ingress_status)),
            heap_delta: NumBytes::from(0),
        }
    }
// Execute a query call from an ingress message.
Execute a query call from an ingress message.
Execute a query call from an ingress message .
fn execute_query_method_for_ingress(
        &self,
        canister: CanisterState,
        ingress: Ingress,
        cycles: NumInstructions,
        time: Time,
    ) -> ExecuteMessageResult<CanisterState> {
        // Letting the canister grow arbitrarily when executing the
        // query is fine as we do not persist state modifications.
        let subnet_available_memory =
            SubnetAvailableMemory::new(self.config.subnet_memory_capacity.get() as i64);
        let execution_parameters = self.execution_parameters(
            &canister,
            cycles,
            subnet_available_memory,
            ExecutionMode::Replicated,
        );
        let (canister, cycles, result) = self.hypervisor.execute_query(
            QueryExecutionType::Replicated,
            ingress.method_name.as_str(),
            ingress.method_payload.as_slice(),
            *ingress.source.get_ref(),
            canister,
            None,
            time,
            execution_parameters,
        );
        let result = result
            .map_err(|err| self.log_and_transform_to_user_error(err, &canister.canister_id()));
        let ingress_status = match result {
            Ok(wasm_result) => match wasm_result {
                None => IngressStatus::Failed {
                    receiver: canister.canister_id().get(),
                    user_id: ingress.source,
                    error: UserError::new(
                        ErrorCode::CanisterDidNotReply,
                        format!(
                            "Canister {} did not reply to the call",
                            canister.canister_id(),
                        ),
                    ),
                    time,
                },
                Some(wasm_result) => IngressStatus::Completed {
                    receiver: canister.canister_id().get(),
                    user_id: ingress.source,
                    result: wasm_result,
                    time,
                },
            },
            Err(user_error) => IngressStatus::Failed {
                receiver: canister.canister_id().get(),
                user_id: ingress.source,
                error: user_error,
                time,
            },
        };
        ExecuteMessageResult {
            canister,
            num_instructions_left: cycles,
            ingress_status: Some((ingress.message_id, ingress_status)),
            heap_delta: NumBytes::from(0),
        }
    }
fn execute_query_method_for_ingress ( & self , canister : CanisterState , ingress : Ingress , cycles : NumInstructions , time : Time , ) -> ExecuteMessageResult < CanisterState > { // Letting the canister grow arbitrarily when executing the // query is fine as we do not persist state modifications. let subnet_available_memory = SubnetAvailableMemory :: new ( self . config . subnet_memory_capacity . get ( ) as i64 ) ; let execution_parameters = self . execution_parameters ( & canister , cycles , subnet_available_memory , ExecutionMode :: Replicated , ) ; let ( canister , cycles , result ) = self . hypervisor . execute_query ( QueryExecutionType :: Replicated , ingress . method_name . as_str ( ) , ingress . method_payload . as_slice ( ) , * ingress . source . get_ref ( ) , canister , None , time , execution_parameters , ) ; let result = result . map_err ( | err | self . log_and_transform_to_user_error ( err , & canister . canister_id ( ) ) ) ; let ingress_status = match result { Ok ( wasm_result ) => match wasm_result { None => IngressStatus :: Failed { receiver : canister . canister_id ( ) . get ( ) , user_id : ingress . source , error : UserError :: new ( ErrorCode :: CanisterDidNotReply , format ! ( " " canister canister_id ( ) ) , ) , time , } , Some ( wasm_result ) => IngressStatus :: Completed { receiver : canister . canister_id ( ) . get ( ) , user_id : ingress . source , result : wasm_result , time , } , } , Err ( user_error ) => IngressStatus :: Failed { receiver : canister . canister_id ( ) . get ( ) , user_id : ingress . source , error : user_error , time , } , } ; ExecuteMessageResult { canister , num_instructions_left : cycles , ingress_status : Some ( ( ingress . message_id , ingress_status ) ) , heap_delta : NumBytes :: from ( 0 ) , } }
Execute a query call from an ingress message.
Execute a query call from an ingress message .
&self
canister
CanisterState
ingress
Ingress
cycles
NumInstructions
time
Time
&self
canister
CanisterState
ingress
Ingress
cycles
NumInstructions
time
Time