diff --git a/crates/cli/src/app_builder.rs b/crates/cli/src/app_builder.rs index ed028b6b4..ba042935e 100644 --- a/crates/cli/src/app_builder.rs +++ b/crates/cli/src/app_builder.rs @@ -4,11 +4,9 @@ use clap::AppSettings; use delphinus_zkwasm::circuits::config::MIN_K; use log::info; use log::warn; -use std::cell::RefCell; use std::fs; use std::io::Write; use std::path::PathBuf; -use std::rc::Rc; use std::sync::Arc; use std::sync::Mutex; @@ -136,7 +134,7 @@ pub trait AppBuilder: CommandBuilder { } else { assert!(public_inputs.len() <= Self::MAX_PUBLIC_INPUT_SIZE); - let context_output = Rc::new(RefCell::new(vec![])); + let context_output = Arc::new(Mutex::new(vec![])); exec_dry_run( zkwasm_k, @@ -145,10 +143,10 @@ pub trait AppBuilder: CommandBuilder { public_inputs, private_inputs, context_in, - Arc::new(Mutex::new(vec![])), + context_output.clone(), )?; - write_context_output(&context_output.borrow(), context_out_path)?; + write_context_output(&context_output.lock().unwrap(), context_out_path)?; Ok(()) } diff --git a/crates/zkwasm/src/runtime/wasmi_interpreter.rs b/crates/zkwasm/src/runtime/wasmi_interpreter.rs index e51ee1df9..937c6f176 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(), }) } }