Skip to content

Commit 65a29b0

Browse files
committed
style: formatting
1 parent c94636c commit 65a29b0

File tree

3 files changed

+31
-12
lines changed

3 files changed

+31
-12
lines changed

packages/wasm-sdk/src/queries/identity.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,11 @@ fn parse_identities_contract_keys_query(
268268
"identities contract keys query",
269269
)?;
270270
Ok(IdentitiesContractKeysQueryParsed {
271-
identity_ids: input.identity_ids.into_iter().map(Identifier::from).collect(),
271+
identity_ids: input
272+
.identity_ids
273+
.into_iter()
274+
.map(Identifier::from)
275+
.collect(),
272276
contract_id: input.contract_id.into(),
273277
purposes: input.purposes,
274278
})
@@ -899,7 +903,6 @@ impl WasmSdk {
899903
let identity_identifiers = params.identity_ids;
900904
let _contract_identifier = params.contract_id;
901905

902-
903906
// Convert purposes if provided
904907
let purposes_opt = params.purposes.map(|p| {
905908
p.into_iter()

packages/wasm-sdk/src/state_transitions/documents/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1296,7 +1296,6 @@ impl WasmSdk {
12961296
("message", JsValue::from_str("Document purchase processed")),
12971297
],
12981298
), // Purchase was processed but document not returned
1299-
13001299
}
13011300
}
13021301

packages/wasm-sdk/src/wallet/extended_derivation.rs

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
//! Implements 256-bit derivation paths for DashPay contact keys
44
55
use crate::error::WasmSdkError;
6+
use crate::queries::utils::deserialize_required_query;
67
use crate::sdk::WasmSdk;
78
use dash_sdk::dpp::dashcore;
89
use dash_sdk::dpp::dashcore::secp256k1::Secp256k1;
910
use dash_sdk::dpp::key_wallet::{bip32, DerivationPath, ExtendedPrivKey};
1011
use std::str::FromStr;
1112
use tracing::debug;
1213
use wasm_bindgen::prelude::*;
13-
use crate::queries::utils::deserialize_required_query;
1414

1515
// TypeScript option bags (module scope) for extended derivation helpers
1616
#[wasm_bindgen(typescript_custom_section)]
@@ -78,9 +78,15 @@ impl WasmSdk {
7878
/// This supports DIP14/DIP15 paths with identity IDs
7979
#[wasm_bindgen(js_name = "deriveKeyFromSeedWithExtendedPath")]
8080
pub fn derive_key_from_seed_with_extended_path(
81-
#[wasm_bindgen(unchecked_param_type = "DeriveKeyFromSeedWithExtendedPathOptions")] opts: JsValue,
81+
#[wasm_bindgen(unchecked_param_type = "DeriveKeyFromSeedWithExtendedPathOptions")]
82+
opts: JsValue,
8283
) -> Result<JsValue, WasmSdkError> {
83-
let DeriveFromExtendedPathInput { mnemonic, passphrase, path, network } = deserialize_required_query(
84+
let DeriveFromExtendedPathInput {
85+
mnemonic,
86+
passphrase,
87+
path,
88+
network,
89+
} = deserialize_required_query(
8490
opts,
8591
"Options object is required",
8692
"deriveKeyFromSeedWithExtendedPath options",
@@ -188,7 +194,15 @@ impl WasmSdk {
188194
pub fn derive_dashpay_contact_key(
189195
#[wasm_bindgen(unchecked_param_type = "DeriveDashpayContactKeyOptions")] opts: JsValue,
190196
) -> Result<JsValue, WasmSdkError> {
191-
let DeriveDashpayContactKeyInput { mnemonic, passphrase, sender_identity_id, receiver_identity_id, account, address_index, network } = deserialize_required_query(
197+
let DeriveDashpayContactKeyInput {
198+
mnemonic,
199+
passphrase,
200+
sender_identity_id,
201+
receiver_identity_id,
202+
account,
203+
address_index,
204+
network,
205+
} = deserialize_required_query(
192206
opts,
193207
"Options object is required",
194208
"deriveDashpayContactKey options",
@@ -210,9 +224,11 @@ impl WasmSdk {
210224
receiver_identity_id.to_string()
211225
} else {
212226
// Decode base58 to bytes, then convert to hex
213-
let bytes = bs58::decode(&receiver_identity_id).into_vec().map_err(|e| {
214-
WasmSdkError::invalid_argument(format!("Invalid receiver identity ID: {}", e))
215-
})?;
227+
let bytes = bs58::decode(&receiver_identity_id)
228+
.into_vec()
229+
.map_err(|e| {
230+
WasmSdkError::invalid_argument(format!("Invalid receiver identity ID: {}", e))
231+
})?;
216232
format!("0x{}", hex::encode(bytes))
217233
};
218234

@@ -238,8 +254,9 @@ impl WasmSdk {
238254
"network": network,
239255
});
240256

241-
let js_opts = serde_wasm_bindgen::to_value(&opts)
242-
.map_err(|e| WasmSdkError::serialization(format!("Failed to serialize options: {}", e)))?;
257+
let js_opts = serde_wasm_bindgen::to_value(&opts).map_err(|e| {
258+
WasmSdkError::serialization(format!("Failed to serialize options: {}", e))
259+
})?;
243260

244261
// Use the extended derivation function
245262
let result = Self::derive_key_from_seed_with_extended_path(js_opts)?;

0 commit comments

Comments
 (0)