Resolve `mdbook test` failures in `book/src/user/wasm-port.md`.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2022-11-29 21:13:07 +00:00
parent 966b5fc3b7
commit 9116ac13e2
1 changed files with 4 additions and 4 deletions

View File

@ -12,7 +12,7 @@ In the case of Zordle, this code is contained in [wasm.rs](https://github.com/na
### Prover
```rust
```rust,ignore
#[wasm_bindgen]
pub async fn prove_play(final_word: String, words_js: JsValue, params_ser: JsValue) -> JsValue {
// Steps:
@ -34,7 +34,7 @@ The output is a `Vec<u8>` converted to a `JSValue` using Serde. This is later pa
### Verifier
```rust
```rust,ignore
#[wasm_bindgen]
pub fn verify_play(final_word: String, proof_js: JsValue, diffs_u64_js: JsValue, params_ser: JsValue) -> bool {
// Steps:
@ -51,7 +51,7 @@ Similar to the prover, we take in input and output a boolean true/false indicati
Additionally, both the prover and verifier functions input `params_ser`, a serialised form of the public parameters of the polynomial commitment scheme. These are passed in as input (instead of being regenerated in prove/verify functions) as a performance optimisation since these are constant based only on the circuit's value of `K`. We can store these seperately on a static web server and pass them in as input to the WASM. To generate the binary serialised form of these (seperately outside the WASM functions), you can run something like:
```rust
```rust,ignore
fn write_params(K: u32) {
let mut params_file = File::create("params.bin").unwrap();
let params: Params<EqAffine> = Params::new(K);
@ -124,4 +124,4 @@ Often, you'll run into issues with your Rust code and see that the WASM executio
## Credits
This guide was written by [Nalin](https://twitter.com/nibnalin). Thanks additionally to [Uma](https://twitter.com/pumatheuma) and [Blaine](https://twitter.com/BlaineBublitz) for significant work on figuring out these steps. Feel free to reach out to me if you have trouble with any of these steps.
This guide was written by [Nalin](https://twitter.com/nibnalin). Thanks additionally to [Uma](https://twitter.com/pumatheuma) and [Blaine](https://twitter.com/BlaineBublitz) for significant work on figuring out these steps. Feel free to reach out to me if you have trouble with any of these steps.