mirror of
https://github.com/vacp2p/zerokit.git
synced 2025-01-10 14:26:34 +00:00
fix: wasm tests and ci (#165)
* fix: unwrap values in test * fix: rln-wasm tests weren't being run in ci * chore: cargo fmt
This commit is contained in:
parent
8c3d60ed01
commit
d68dc1ad8e
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -102,7 +102,7 @@ jobs:
|
|||||||
uses: jetli/wasm-pack-action@v0.3.0
|
uses: jetli/wasm-pack-action@v0.3.0
|
||||||
- run: cargo make build
|
- run: cargo make build
|
||||||
working-directory: rln-wasm
|
working-directory: rln-wasm
|
||||||
- run: cargo-make test
|
- run: cargo make test --release
|
||||||
working-directory: rln-wasm
|
working-directory: rln-wasm
|
||||||
|
|
||||||
rln:
|
rln:
|
||||||
|
@ -30,7 +30,7 @@ mod tests {
|
|||||||
let vk = read_file(&vk_path).unwrap();
|
let vk = read_file(&vk_path).unwrap();
|
||||||
|
|
||||||
// Creating an instance of RLN
|
// Creating an instance of RLN
|
||||||
let rln_instance = wasm_new(tree_height, zkey, vk);
|
let rln_instance = wasm_new(tree_height, zkey, vk).unwrap();
|
||||||
|
|
||||||
// Creating membership key
|
// Creating membership key
|
||||||
let mem_keys = wasm_key_gen(rln_instance).unwrap();
|
let mem_keys = wasm_key_gen(rln_instance).unwrap();
|
||||||
@ -59,10 +59,11 @@ mod tests {
|
|||||||
let serialized_message = Uint8Array::from(&serialized_vec[..]);
|
let serialized_message = Uint8Array::from(&serialized_vec[..]);
|
||||||
|
|
||||||
let serialized_rln_witness =
|
let serialized_rln_witness =
|
||||||
wasm_get_serialized_rln_witness(rln_instance, serialized_message);
|
wasm_get_serialized_rln_witness(rln_instance, serialized_message).unwrap();
|
||||||
|
|
||||||
// Obtaining inputs that should be sent to circom witness calculator
|
// Obtaining inputs that should be sent to circom witness calculator
|
||||||
let json_inputs = rln_witness_to_json(rln_instance, serialized_rln_witness.clone());
|
let json_inputs =
|
||||||
|
rln_witness_to_json(rln_instance, serialized_rln_witness.clone()).unwrap();
|
||||||
|
|
||||||
// Calculating witness with JS
|
// Calculating witness with JS
|
||||||
// (Using a JSON since wasm_bindgen does not like Result<Vec<JsBigInt>,JsValue>)
|
// (Using a JSON since wasm_bindgen does not like Result<Vec<JsBigInt>,JsValue>)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user