Skip to content

Commit 399d10a

Browse files
pa-longalexpitsikoulis
authored andcommitted
Add imports support to verifyFunctionExecution.
Signed-off-by: makerare <[email protected]>
1 parent dbe60ca commit 399d10a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

wasm/src/programs/execution.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,16 @@ pub fn verify_function_execution(
107107
verifying_key: &VerifyingKey,
108108
program: &Program,
109109
function_id: &str,
110+
imports: Option<Object>,
110111
) -> Result<bool, String> {
111112
let function = IdentifierNative::from_str(function_id).map_err(|e| e.to_string())?;
112113
let program_id = ProgramID::<CurrentNetwork>::from_str(&program.id()).unwrap();
113-
let mut process = ProcessNative::load_web().map_err(|e| e.to_string())?;
114+
let mut process_native = ProcessNative::load_web().map_err(|e| e.to_string())?;
115+
let process = &mut process_native;
116+
117+
let program_native = ProgramNative::from_str(program.to_string().as_str()).map_err(|e| e.to_string())?;
118+
ProgramManager::resolve_imports(process, &program_native, imports)?;
119+
114120
if &program.id() != "credits.aleo" {
115121
process.add_program(program).map_err(|e| e.to_string())?;
116122
}

0 commit comments

Comments
 (0)