Skip to content

Commit

Permalink
remove read/write from noirc_wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
kevaundray committed Oct 29, 2023
1 parent 129ca94 commit 1152384
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions compiler/wasm/src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub fn acir_read_bytes(bytes: Vec<u8>) -> JsValue {
console_error_panic_hook::set_once();
let circuit = Circuit::read(&*bytes).unwrap();
let circuit = Circuit::deserialize_circuit(&bytes).unwrap();
<JsValue as JsValueSerdeExt>::from_serde(&circuit).unwrap()
}

#[wasm_bindgen]
pub fn acir_write_bytes(acir: JsValue) -> Vec<u8> {
console_error_panic_hook::set_once();
let circuit: Circuit = JsValueSerdeExt::into_serde(&acir).unwrap();
let mut bytes = Vec::new();
circuit.write(&mut bytes).unwrap();
bytes
Circuit::serialize_circuit(&circuit)
}

0 comments on commit 1152384

Please sign in to comment.