From d318b1c3fbb43c1f57a159aa119ba4dda06260e9 Mon Sep 17 00:00:00 2001 From: lklimek <842586+lklimek@users.noreply.github.com> Date: Tue, 17 Dec 2024 14:56:15 +0100 Subject: [PATCH] build: bump wasm-bindgen to 0.2.99 (#2395) --- .devcontainer/Dockerfile | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/tests-build-js.yml | 2 +- Cargo.lock | 52 ++++++++++--------- Dockerfile | 2 +- README.md | 2 +- packages/wasm-dpp/Cargo.toml | 4 +- packages/wasm-dpp/README.md | 2 +- .../wasm-dpp/src/identity/factory_utils.rs | 12 ++--- .../state_transition/asset_lock_proof/mod.rs | 5 +- .../identity_create_transition.rs | 19 +++---- .../identity_update_transition.rs | 31 ++++------- 12 files changed, 61 insertions(+), 74 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index ce363420efb..f2373424b67 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -66,7 +66,7 @@ RUN set -ex; \ rm /tmp/cargo-binstall; \ cargo binstall -V -RUN cargo binstall wasm-bindgen-cli@0.2.86 --locked \ +RUN cargo binstall wasm-bindgen-cli@0.2.99 --locked \ --no-discover-github-token \ --disable-telemetry \ --no-track \ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 269798a2ff6..0fd5f05672f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,7 +70,7 @@ jobs: if: ${{ steps.check-artifact.outputs.exists != 'true' }} - name: Install wasm-bindgen-cli - run: cargo binstall wasm-bindgen-cli@0.2.86 + run: cargo binstall wasm-bindgen-cli@0.2.99 if: ${{ steps.check-artifact.outputs.exists != 'true' }} - name: Build packages diff --git a/.github/workflows/tests-build-js.yml b/.github/workflows/tests-build-js.yml index a36bd91e2c0..0efd75fc7ce 100644 --- a/.github/workflows/tests-build-js.yml +++ b/.github/workflows/tests-build-js.yml @@ -50,7 +50,7 @@ jobs: if: ${{ steps.check-artifact.outputs.exists != 'true' }} - name: Install wasm-bindgen-cli - run: cargo binstall wasm-bindgen-cli@0.2.86 + run: cargo binstall wasm-bindgen-cli@0.2.99 if: ${{ steps.check-artifact.outputs.exists != 'true' }} - name: Build JS packages diff --git a/Cargo.lock b/Cargo.lock index b07e274bdbc..ce0b960f28a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -2772,10 +2772,11 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.63" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -4397,7 +4398,7 @@ dependencies = [ [[package]] name = "serde-wasm-bindgen" version = "0.5.0" -source = "git+https://github.com/QuantumExplorer/serde-wasm-bindgen?branch=feat/not_human_readable#121d1f7fbf62cb97f74b91626a1b23851098cc82" +source = "git+https://github.com/QuantumExplorer/serde-wasm-bindgen?branch=feat%2Fnot_human_readable#121d1f7fbf62cb97f74b91626a1b23851098cc82" dependencies = [ "js-sys", "serde", @@ -4890,7 +4891,7 @@ dependencies = [ [[package]] name = "tenderdash-abci" version = "1.2.1+1.3.0" -source = "git+https://github.com/dashpay/rs-tenderdash-abci?tag=v1.2.1+1.3.0#aad72f4d25816bdf0f584ee4ba3cd383addf8a33" +source = "git+https://github.com/dashpay/rs-tenderdash-abci?tag=v1.2.1%2B1.3.0#aad72f4d25816bdf0f584ee4ba3cd383addf8a33" dependencies = [ "bytes", "futures", @@ -4911,7 +4912,7 @@ dependencies = [ [[package]] name = "tenderdash-proto" version = "1.2.1+1.3.0" -source = "git+https://github.com/dashpay/rs-tenderdash-abci?tag=v1.2.1+1.3.0#aad72f4d25816bdf0f584ee4ba3cd383addf8a33" +source = "git+https://github.com/dashpay/rs-tenderdash-abci?tag=v1.2.1%2B1.3.0#aad72f4d25816bdf0f584ee4ba3cd383addf8a33" dependencies = [ "bytes", "chrono", @@ -4930,7 +4931,7 @@ dependencies = [ [[package]] name = "tenderdash-proto-compiler" version = "1.2.1+1.3.0" -source = "git+https://github.com/dashpay/rs-tenderdash-abci?tag=v1.2.1+1.3.0#aad72f4d25816bdf0f584ee4ba3cd383addf8a33" +source = "git+https://github.com/dashpay/rs-tenderdash-abci?tag=v1.2.1%2B1.3.0#aad72f4d25816bdf0f584ee4ba3cd383addf8a33" dependencies = [ "fs_extra", "prost-build", @@ -5300,7 +5301,7 @@ dependencies = [ [[package]] name = "tower" version = "0.4.13" -source = "git+https://github.com/QuantumExplorer/tower?branch=fix/indexMap2OnV0413#5286f8c605d10f48d51254f2434c5ab3fc5d7779" +source = "git+https://github.com/QuantumExplorer/tower?branch=fix%2FindexMap2OnV0413#5286f8c605d10f48d51254f2434c5ab3fc5d7779" dependencies = [ "futures-core", "futures-util", @@ -5344,12 +5345,12 @@ dependencies = [ [[package]] name = "tower-layer" version = "0.3.2" -source = "git+https://github.com/QuantumExplorer/tower?branch=fix/indexMap2OnV0413#5286f8c605d10f48d51254f2434c5ab3fc5d7779" +source = "git+https://github.com/QuantumExplorer/tower?branch=fix%2FindexMap2OnV0413#5286f8c605d10f48d51254f2434c5ab3fc5d7779" [[package]] name = "tower-service" version = "0.3.2" -source = "git+https://github.com/QuantumExplorer/tower?branch=fix/indexMap2OnV0413#5286f8c605d10f48d51254f2434c5ab3fc5d7779" +source = "git+https://github.com/QuantumExplorer/tower?branch=fix%2FindexMap2OnV0413#5286f8c605d10f48d51254f2434c5ab3fc5d7779" [[package]] name = "tracing" @@ -5645,23 +5646,23 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.86" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.86" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", "syn 2.0.75", @@ -5670,21 +5671,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.36" +version = "0.4.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e" +checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.86" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5692,9 +5694,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.86" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", @@ -5705,9 +5707,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.86" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "wasm-dpp" @@ -5746,9 +5748,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.63" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" +checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/Dockerfile b/Dockerfile index 5c8ac67655e..671b488fff4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -313,7 +313,7 @@ RUN --mount=type=secret,id=AWS \ RUN --mount=type=secret,id=AWS \ source /root/env; \ - cargo binstall wasm-bindgen-cli@0.2.86 cargo-chef@0.1.67 \ + cargo binstall wasm-bindgen-cli@0.2.99 cargo-chef@0.1.67 \ --locked \ --no-discover-github-token \ --disable-telemetry \ diff --git a/README.md b/README.md index 5f4536c1769..d3bf8d7503d 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ this repository may be used on the following networks: in terminal run `echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc` or `echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.bash_profile` depending on your default shell. You can find your default shell with `echo $SHELL` - Reload your shell with `source ~/.zshrc` or `source ~/.bash_profile` - - `cargo install wasm-bindgen-cli@0.2.86` + - `cargo install wasm-bindgen-cli@0.2.99` - *double-check that wasm-bindgen-cli version above matches wasm-bindgen version in Cargo.lock file* - *Depending on system, additional packages may need to be installed as a prerequisite for wasm-bindgen-cli. If anything is missing, installation will error and prompt what packages are missing (i.e. clang, llvm, libssl-dev)* - essential build tools - example for Debian/Ubuntu: `apt install -y build-essential libssl-dev pkg-config clang cmake llvm` diff --git a/packages/wasm-dpp/Cargo.toml b/packages/wasm-dpp/Cargo.toml index 25c7307efff..c84743b3fb4 100644 --- a/packages/wasm-dpp/Cargo.toml +++ b/packages/wasm-dpp/Cargo.toml @@ -15,7 +15,7 @@ serde_json = { version = "1.0", features = ["preserve_order"] } # Meantime if you want to update wasm-bindgen you also need to update version in: # - packages/wasm-dpp/scripts/build-wasm.sh # - Dockerfile -wasm-bindgen = { version = "=0.2.86" } +wasm-bindgen = { version = "=0.2.99" } js-sys = "0.3.53" web-sys = { version = "0.3.6", features = ["console"] } thiserror = { version = "1.0.63" } @@ -49,7 +49,7 @@ hex = { version = "0.4" } paste = "1.0.14" anyhow = { version = "1.0.75" } # required, cargo-machete false positive -wasm-bindgen-futures = "0.4.33" +wasm-bindgen-futures = "0.4.49" async-trait = "0.1.59" bincode = "2.0.0-rc.3" [profile.release] diff --git a/packages/wasm-dpp/README.md b/packages/wasm-dpp/README.md index 73b3494c454..e16390f30ad 100644 --- a/packages/wasm-dpp/README.md +++ b/packages/wasm-dpp/README.md @@ -39,7 +39,7 @@ Library consumers must ignore class names minification for `@dashevo/wasm-dpp` l - Install [Rust](https://www.rust-lang.org/tools/install) v1.73+ - Add wasm32 target: `$ rustup target add wasm32-unknown-unknown` -- Install wasm-bingen-cli: `cargo install wasm-bindgen-cli@0.2.86` +- Install wasm-bingen-cli: `cargo install wasm-bindgen-cli@0.2.99` - *double-check that wasm-bindgen-cli version above matches wasm-bindgen version in Cargo.lock file* - *Depending on system, additional packages may need to be installed as a prerequisite for wasm-bindgen-cli. If anything is missing, installation will error and prompt what packages are missing (i.e. clang, llvm, libssl-dev)* diff --git a/packages/wasm-dpp/src/identity/factory_utils.rs b/packages/wasm-dpp/src/identity/factory_utils.rs index 18e19428423..f14431ac8ee 100644 --- a/packages/wasm-dpp/src/identity/factory_utils.rs +++ b/packages/wasm-dpp/src/identity/factory_utils.rs @@ -9,7 +9,6 @@ use dpp::identity::{IdentityPublicKey, KeyID}; use dpp::serialization::ValueConvertible; use dpp::state_transition::public_key_in_creation::IdentityPublicKeyInCreation; use std::collections::BTreeMap; -use wasm_bindgen::__rt::Ref; use wasm_bindgen::{JsCast, JsValue}; pub fn parse_public_keys( @@ -47,11 +46,10 @@ pub fn parse_create_identity_update_transition_keys( let keys: Vec = add_public_keys_array .iter() .map(|key| { - let public_key: Ref = - generic_of_js_val::( - &key, - "IdentityPublicKeyWithWitness", - )?; + let public_key = generic_of_js_val::( + &key, + "IdentityPublicKeyWithWitness", + )?; Ok(public_key.clone().into()) }) @@ -74,7 +72,7 @@ pub fn parse_create_identity_update_transition_keys( let keys: Vec = disable_public_keys_array .iter() .map(|key| { - let public_key_wasm: Ref = + let public_key_wasm = generic_of_js_val::(&key, "IdentityPublicKey")?; Ok(public_key_wasm.get_id()) }) diff --git a/packages/wasm-dpp/src/identity/state_transition/asset_lock_proof/mod.rs b/packages/wasm-dpp/src/identity/state_transition/asset_lock_proof/mod.rs index 861188d0ca4..dd4fca03cd3 100644 --- a/packages/wasm-dpp/src/identity/state_transition/asset_lock_proof/mod.rs +++ b/packages/wasm-dpp/src/identity/state_transition/asset_lock_proof/mod.rs @@ -5,7 +5,6 @@ pub use chain::*; pub use instant::*; use std::convert::TryInto; use wasm_bindgen::JsCast; -use wasm_bindgen::__rt::Ref; use dpp::identity::errors::UnknownAssetLockProofTypeError; use wasm_bindgen::prelude::*; @@ -144,13 +143,13 @@ pub fn create_asset_lock_proof_from_wasm_instance( match lock_type { AssetLockProofType::Instant => { - let instant: Ref = + let instant = generic_of_js_val::(js_value, "InstantAssetLockProof")?; Ok(AssetLockProof::Instant(instant.clone().into())) } AssetLockProofType::Chain => { - let chain: Ref = + let chain = generic_of_js_val::(js_value, "ChainAssetLockProof")?; Ok(AssetLockProof::Chain(chain.clone().into())) diff --git a/packages/wasm-dpp/src/identity/state_transition/identity_create_transition/identity_create_transition.rs b/packages/wasm-dpp/src/identity/state_transition/identity_create_transition/identity_create_transition.rs index 86681592df3..9b5a402ddd2 100644 --- a/packages/wasm-dpp/src/identity/state_transition/identity_create_transition/identity_create_transition.rs +++ b/packages/wasm-dpp/src/identity/state_transition/identity_create_transition/identity_create_transition.rs @@ -1,6 +1,5 @@ use std::default::Default; -use wasm_bindgen::__rt::Ref; use wasm_bindgen::prelude::*; use crate::bls_adapter::BlsAdapter; @@ -101,11 +100,10 @@ impl IdentityCreateTransitionWasm { let public_keys = public_keys .iter() .map(|value| { - let public_key: Ref = - generic_of_js_val::( - value, - "IdentityPublicKeyWithWitness", - )?; + let public_key = generic_of_js_val::( + value, + "IdentityPublicKeyWithWitness", + )?; Ok(public_key.clone().into()) }) .collect::, JsValue>>()?; @@ -120,11 +118,10 @@ impl IdentityCreateTransitionWasm { let mut public_keys = public_keys .iter() .map(|value| { - let public_key: Ref = - generic_of_js_val::( - value, - "IdentityPublicKeyWithWitness", - )?; + let public_key = generic_of_js_val::( + value, + "IdentityPublicKeyWithWitness", + )?; Ok(public_key.clone().into()) }) .collect::, JsValue>>()?; diff --git a/packages/wasm-dpp/src/identity/state_transition/identity_update_transition/identity_update_transition.rs b/packages/wasm-dpp/src/identity/state_transition/identity_update_transition/identity_update_transition.rs index 1d8988ba6f9..5692dd63d3f 100644 --- a/packages/wasm-dpp/src/identity/state_transition/identity_update_transition/identity_update_transition.rs +++ b/packages/wasm-dpp/src/identity/state_transition/identity_update_transition/identity_update_transition.rs @@ -1,24 +1,12 @@ -use std::convert::TryInto; -use std::default::Default; - -use serde::{Deserialize, Serialize}; - -use wasm_bindgen::__rt::Ref; -use wasm_bindgen::prelude::*; - +use crate::bls_adapter::{BlsAdapter, JsBlsAdapter}; +use crate::errors::from_dpp_err; use crate::identifier::IdentifierWrapper; - +use crate::utils::{generic_of_js_val, WithJsError}; use crate::{ buffer::Buffer, identity::state_transition::identity_public_key_transitions::IdentityPublicKeyWithWitnessWasm, identity::IdentityPublicKeyWasm, with_js_error, }; - -use crate::bls_adapter::{BlsAdapter, JsBlsAdapter}; - -use crate::utils::{generic_of_js_val, WithJsError}; - -use crate::errors::from_dpp_err; use dpp::errors::consensus::signature::SignatureError; use dpp::errors::consensus::ConsensusError; use dpp::errors::ProtocolError; @@ -34,6 +22,10 @@ use dpp::state_transition::StateTransition; use dpp::state_transition::StateTransitionIdentitySigned; use dpp::version::PlatformVersion; use dpp::{identifier::Identifier, state_transition::StateTransitionLike}; +use serde::{Deserialize, Serialize}; +use std::convert::TryInto; +use std::default::Default; +use wasm_bindgen::prelude::*; #[wasm_bindgen(js_name=IdentityUpdateTransition)] #[derive(Clone)] @@ -93,11 +85,10 @@ impl IdentityUpdateTransitionWasm { keys_to_add = keys .iter() .map(|value| { - let public_key: Ref = - generic_of_js_val::( - value, - "IdentityPublicKeyWithWitness", - )?; + let public_key = generic_of_js_val::( + value, + "IdentityPublicKeyWithWitness", + )?; Ok(public_key.clone().into()) }) .collect::, JsValue>>()?;