Skip to content

Commit 561ecf2

Browse files
committed
add deserialize function for WasmProverProof
1 parent 1e57024 commit 561ecf2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

plonk-wasm/src/plonk_proof.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,15 @@ macro_rules! impl_proof {
622622
}
623623
}
624624

625+
#[wasm_bindgen]
626+
#[allow(deprecated)]
627+
pub fn deserialize(s: &str) -> WasmProverProof {
628+
let bytes = base64::decode(s).unwrap();
629+
let proof: ProverProof<$G, OpeningProof<$G>> = rmp_serde::from_slice(&bytes).unwrap();
630+
// Deprecated used on purpose: updating this leads to a bug in o1js
631+
WasmProverProof::from((proof, Vec::new()))
632+
}
633+
625634
#[wasm_bindgen]
626635
pub struct [<Wasm $field_name:camel RuntimeTable>] {
627636
id: i32,

0 commit comments

Comments
 (0)