From 930d0a5e96d5d893f16b45bf669e51aea071ad7c Mon Sep 17 00:00:00 2001 From: "xingqiang.yuan" Date: Fri, 8 Sep 2023 14:48:17 +0800 Subject: [PATCH] fix output --- crates/cli/src/exec.rs | 2 +- crates/zkwasm/src/loader/mod.rs | 4 ++-- crates/zkwasm/src/runtime/wasmi_interpreter.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/cli/src/exec.rs b/crates/cli/src/exec.rs index c8d1ec543..ba0e197ef 100644 --- a/crates/cli/src/exec.rs +++ b/crates/cli/src/exec.rs @@ -247,7 +247,7 @@ pub fn exec_create_proof( ) -> Result<()> { let loader = ZkWasmLoader::::new(zkwasm_k, wasm_binary, phantom_functions, None)?; - let (circuit, instances) = loader.circuit_with_witness(ExecutionArg { + let (circuit, instances, _) = loader.circuit_with_witness(ExecutionArg { public_inputs, private_inputs, context_inputs, diff --git a/crates/zkwasm/src/loader/mod.rs b/crates/zkwasm/src/loader/mod.rs index 5b660f080..8a08e5664 100644 --- a/crates/zkwasm/src/loader/mod.rs +++ b/crates/zkwasm/src/loader/mod.rs @@ -214,7 +214,7 @@ impl ZkWasmLoader { pub fn circuit_with_witness( &self, arg: ExecutionArg, - ) -> Result<(TestCircuit, Vec)> { + ) -> Result<(TestCircuit, Vec, Vec)> { let execution_result = self.run(arg, true)?; #[allow(unused_mut)] @@ -236,7 +236,7 @@ impl ZkWasmLoader { println!("output:"); println!("{:?}", execution_result.outputs); - Ok((builder.build_circuit(), instance)) + Ok((builder.build_circuit(), instance, execution_result.outputs)) } pub fn mock_test( diff --git a/crates/zkwasm/src/runtime/wasmi_interpreter.rs b/crates/zkwasm/src/runtime/wasmi_interpreter.rs index a8cc7c43e..c3d5f893d 100644 --- a/crates/zkwasm/src/runtime/wasmi_interpreter.rs +++ b/crates/zkwasm/src/runtime/wasmi_interpreter.rs @@ -96,7 +96,7 @@ impl Execution }, result, public_inputs_and_outputs: wasm_io.public_inputs_and_outputs.borrow().clone(), - outputs: wasm_io.public_inputs_and_outputs.borrow().clone(), + outputs: wasm_io.outputs.borrow().clone(), }) } }