Skip to content

Commit 1b2a5c5

Browse files
Shift type conversion macros to iterator semantics + bump sdk version for release
1 parent 4bf93d1 commit 1b2a5c5

File tree

6 files changed

+6
-14
lines changed

6 files changed

+6
-14
lines changed

create-leo-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-leo-app",
3-
"version": "0.8.2",
3+
"version": "0.8.6",
44
"type": "module",
55
"license": "GPL-3.0",
66
"collaborators": [

sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@provablehq/sdk",
3-
"version": "0.8.2",
3+
"version": "0.8.6",
44
"description": "A Software Development Kit (SDK) for Zero-Knowledge Transactions",
55
"collaborators": [
66
"The Provable Team"

wasm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aleo-wasm"
3-
version = "0.8.0"
3+
version = "0.8.6"
44
authors = [ "The Provable Team" ]
55
description = "WebAssembly based toolkit for developing zero-knowledge applications with Aleo"
66
homepage = "https://provable.com"

wasm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@provablehq/wasm",
3-
"version": "0.8.2",
3+
"version": "0.8.6",
44
"description": "SnarkVM WASM binaries with javascript bindings",
55
"collaborators": [
66
"The Provable Team"

wasm/src/utilities/array.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
macro_rules! from_wasm_object_array {
2121
($input:expr, $wasm_type:ident) => {{
2222
$input
23-
.to_vec()
24-
.into_iter()
23+
.iter()
2524
.map(|x| {
2625
$wasm_type::try_from_js_value(x).map(|x| *x).map_err(|_| "Input must be an array of fields".to_string())
2726
})
@@ -34,7 +33,6 @@ macro_rules! from_wasm_object_array {
3433
macro_rules! from_js_typed_array {
3534
($input:expr, $method:ident, $_type:expr) => {{
3635
$input
37-
.to_vec()
3836
.iter()
3937
.map(|x| x.$method().ok_or_else(|| format!("Input must be a {} array", $_type)))
4038
.collect::<Result<Vec<bool>, String>>()

wasm/src/utilities/bits.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,5 @@
1616

1717
#[macro_export]
1818
macro_rules! to_bits_array_le {
19-
($self:expr) => {{
20-
let array = js_sys::Array::new();
21-
$self.0.to_bits_le().iter().for_each(|bit| {
22-
array.push(&JsValue::from_bool(*bit));
23-
});
24-
array
25-
}};
19+
($self:expr) => {{ $self.0.to_bits_le().iter().map(|x| wasm_bindgen::JsValue::from_bool(*x)).collect::<js_sys::Array>() }};
2620
}

0 commit comments

Comments
 (0)