From bc9101a4374c57535511b32dcf76619acb3102f3 Mon Sep 17 00:00:00 2001 From: kilic Date: Sat, 13 Jun 2020 22:39:33 +0300 Subject: [PATCH] fix for wasm build update readme --- Cargo.toml | 12 +++++------- README.md | 27 +++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 173141f..ef1bfd7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,11 +8,8 @@ edition = "2018" crate-type = ["cdylib", "rlib"] [features] -default = ["sapling_multicore"] -wasm = ["sapling_wasm"] -bellman_wasm = ["bellman/wasm", "bellman/nolog"] -sapling_wasm = ["sapling-crypto/wasm"] -sapling_multicore = ["sapling-crypto/multicore"] +multicore = ["sapling-crypto/multicore", "bellman/multicore"] +wasm = ["sapling-crypto/wasm", "bellman/wasm", "bellman/nolog"] [dependencies] rand = "0.4" @@ -22,8 +19,9 @@ bellman = { package = "bellman_ce", version = "0.3.4", default-features = false [target.'cfg(target_arch = "wasm32")'.dependencies] console_error_panic_hook = { version = "0.1.1" } -wasm-bindgen = "0.2" +wasm-bindgen = "0.2.63" wee_alloc = "0.4.5" +web-sys = {version = "0.3", features = ["console", "Performance", "Window"]} [target.'cfg(target_arch = "wasm32")'.dev-dependencies] -wasm-bindgen-test = "0.2" +wasm-bindgen-test = "0.3" diff --git a/README.md b/README.md index e6bd27d..0b26b45 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,34 @@ This is the development repo of rate limit nullifier zkSNARK circuits. For details, see work in progress document [here](https://hackmd.io/tMTLMYmTR5eynw2lwK9n1w?view)) +## Test -## Wasm support +``` +cargo test --release --features multicore rln_32 -- --nocapture +``` -### Test +## Generate Test Keys + +``` +cargo run --release --example export_test_keys +``` + +## Wasm Support + +## Test + +With wasm-pack: ``` wasm-pack test --release --node -- --features wasm ``` + +With cargo: + +Follow the steps [here](https://rustwasm.github.io/docs/wasm-bindgen/wasm-bindgen-test/usage.html#appendix-using-wasm-bindgen-test-without-wasm-pack) before running the test. + +Then run: + +``` +cargo build --tests --release --target wasm32-unknown-unknown --features wasm +``` \ No newline at end of file