From f6e262fba5b9687396a0a250010c29e96031906b Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Tue, 9 Jan 2024 08:38:57 +0100 Subject: [PATCH] Use execute_function for nested calls in CallStack::PackageRun --- synthesizer/process/src/stack/call/mod.rs | 2 +- synthesizer/process/src/stack/evaluate.rs | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/synthesizer/process/src/stack/call/mod.rs b/synthesizer/process/src/stack/call/mod.rs index d34e31d91f..024ca0a9af 100644 --- a/synthesizer/process/src/stack/call/mod.rs +++ b/synthesizer/process/src/stack/call/mod.rs @@ -259,7 +259,7 @@ impl CallTrait for Call { call_stack.push(request.clone())?; // Evaluate the request. - let response = substack.evaluate_function::(call_stack, console_caller)?; + let response = substack.execute_function::(call_stack, console_caller, rng)?; // Return the request and response. (request, response) diff --git a/synthesizer/process/src/stack/evaluate.rs b/synthesizer/process/src/stack/evaluate.rs index 6d6b6f5761..9dda9b6db2 100644 --- a/synthesizer/process/src/stack/evaluate.rs +++ b/synthesizer/process/src/stack/evaluate.rs @@ -106,10 +106,6 @@ impl StackEvaluate for Stack { // Retrieve the next request, based on the call stack mode. let (request, call_stack) = match &call_stack { CallStack::Evaluate(authorization) => (authorization.next()?, call_stack), - CallStack::PackageRun(requests, _, _) => { - let last_request = requests.last().ok_or(anyhow!("CallStack does not contain request"))?.clone(); - (last_request, call_stack) - } // If the evaluation is performed in the `Execute` mode, create a new `Evaluate` mode. // This is done to ensure that evaluation during execution is performed consistently. CallStack::Execute(authorization, _) => { @@ -120,9 +116,7 @@ impl StackEvaluate for Stack { let call_stack = CallStack::Evaluate(authorization); (request, call_stack) } - _ => bail!( - "Illegal operation: call stack must be `PackageRun`, `Evaluate` or `Execute` in `evaluate_function`." - ), + _ => bail!("Illegal operation: call stack must be `Evaluate` or `Execute` in `evaluate_function`."), }; lap!(timer, "Retrieve the next request");