diff --git a/packages/wasm-dpp/src/identity/factory_utils.rs b/packages/wasm-dpp/src/identity/factory_utils.rs index 18e1942842..f14431ac8e 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 861188d0ca..dd4fca03cd 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 86681592df..9b5a402ddd 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 1d8988ba6f..5692dd63d3 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>>()?;