Skip to content

Commit

Permalink
fix wasm_output
Browse files Browse the repository at this point in the history
  • Loading branch information
junyu0312 authored and xgaozoyoe committed Oct 9, 2023
1 parent e6fc5d0 commit 32cb2ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions crates/cli/src/app_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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,
Expand All @@ -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(())
}
Expand Down
2 changes: 1 addition & 1 deletion crates/zkwasm/src/runtime/wasmi_interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl Execution<RuntimeValue>
},
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(),
})
}
}
Expand Down

0 comments on commit 32cb2ac

Please sign in to comment.