Skip to content

Commit

Permalink
chore: remove duplicated commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov committed Feb 27, 2025
1 parent 05d0085 commit 8160ccd
Showing 1 changed file with 0 additions and 63 deletions.
63 changes: 0 additions & 63 deletions packages/wasm-dpp/src/document/factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,69 +251,6 @@ impl DocumentFactoryWASM {
// Ok(document.into())
// }
//
// #[wasm_bindgen(js_name=createFromObject)]
// pub async fn create_from_object(
// &self,
// raw_document_js: JsValue,
// options: JsValue,
// ) -> Result<ExtendedDocumentWasm, JsValue> {
// let mut raw_document = raw_document_js.with_serde_to_platform_value()?;
// let options: FactoryOptions = if !options.is_undefined() && options.is_object() {
// let raw_options = options.with_serde_to_json_value()?;
// serde_json::from_value(raw_options).with_js_error()?
// } else {
// Default::default()
// };
// raw_document
// .replace_at_paths(
// extended_document::IDENTIFIER_FIELDS,
// ReplacementType::Identifier,
// )
// .map_err(ProtocolError::ValueError)
// .with_js_error()?;
//
// let mut document = self
// .0
// .create_from_object(raw_document, options)
// .await
// .with_js_error()?;
// let (identifier_paths, binary_paths): (Vec<_>, Vec<_>) = document
// .get_identifiers_and_binary_paths_owned()
// .with_js_error()?;
// // When data contract is available, replace remaining dynamic paths
// let document_data = document.properties_as_mut();
// document_data
// .replace_at_paths(identifier_paths, ReplacementType::Identifier)
// .map_err(ProtocolError::ValueError)
// .with_js_error()?;
// document_data
// .replace_at_paths(binary_paths, ReplacementType::BinaryBytes)
// .map_err(ProtocolError::ValueError)
// .with_js_error()?;
// Ok(document.into())
// }
//
// #[wasm_bindgen(js_name=createFromBuffer)]
// pub async fn create_from_buffer(
// &self,
// buffer: Vec<u8>,
// options: &JsValue,
// ) -> Result<ExtendedDocumentWasm, JsValue> {
// // let options: FactoryOptions = if !options.is_undefined() && options.is_object() {
// // let raw_options = options.with_serde_to_json_value()?;
// // serde_json::from_value(raw_options).with_js_error()?
// // } else {
// // Default::default()
// // };
//
// let document = self
// .0
// .create_from_buffer(buffer, options)
// .await
// .with_js_error()?;
//
// Ok(document.into())
// }

#[wasm_bindgen(js_name=createExtendedDocumentFromDocumentBuffer)]
pub fn create_extended_from_document_buffer(
Expand Down

0 comments on commit 8160ccd

Please sign in to comment.