fix for wasm build

update readme
This commit is contained in:
kilic 2020-06-13 22:39:33 +03:00
parent 1535846279
commit bc9101a437
2 changed files with 30 additions and 9 deletions

View File

@ -8,11 +8,8 @@ edition = "2018"
crate-type = ["cdylib", "rlib"] crate-type = ["cdylib", "rlib"]
[features] [features]
default = ["sapling_multicore"] multicore = ["sapling-crypto/multicore", "bellman/multicore"]
wasm = ["sapling_wasm"] wasm = ["sapling-crypto/wasm", "bellman/wasm", "bellman/nolog"]
bellman_wasm = ["bellman/wasm", "bellman/nolog"]
sapling_wasm = ["sapling-crypto/wasm"]
sapling_multicore = ["sapling-crypto/multicore"]
[dependencies] [dependencies]
rand = "0.4" rand = "0.4"
@ -22,8 +19,9 @@ bellman = { package = "bellman_ce", version = "0.3.4", default-features = false
[target.'cfg(target_arch = "wasm32")'.dependencies] [target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = { version = "0.1.1" } console_error_panic_hook = { version = "0.1.1" }
wasm-bindgen = "0.2" wasm-bindgen = "0.2.63"
wee_alloc = "0.4.5" wee_alloc = "0.4.5"
web-sys = {version = "0.3", features = ["console", "Performance", "Window"]}
[target.'cfg(target_arch = "wasm32")'.dev-dependencies] [target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = "0.2" wasm-bindgen-test = "0.3"

View File

@ -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)) 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 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
```