From 04735183b4fd0397483e1d05c1474e6d7e55e515 Mon Sep 17 00:00:00 2001 From: Sosthene Date: Tue, 24 Jun 2025 15:17:27 +0200 Subject: [PATCH] Replace ciborium with zstd --- Cargo.toml | 6 +++--- src/lib.rs | 2 +- src/serialization.rs | 11 ----------- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 38e75e8..fde7122 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,6 @@ crate-type = ["cdylib", "rlib"] [dependencies] aes-gcm = "0.10.3" anyhow = "1.0" -ciborium = "0.2.2" js-sys = "0.3.69" env_logger = "0.9" log = "0.4.6" @@ -17,8 +16,9 @@ rand = "0.8.5" serde = { version = "1.0.193", features = ["derive"] } serde_json = { version = "1.0.108" } serde-wasm-bindgen = "0.6.5" -# sp_client = { path = "../sp-client" } -sp_client = { git = "https://github.com/Sosthene00/sp-client.git", branch = "dev" } +# sp_client = { path = "../sp-client", features = ["blindbit-backend"] } +sp_client = { git = "https://github.com/cygnet3/sp-client.git", branch = "wasm_compatibility" ,features = ["blindbit-backend"]} tsify = { git = "https://github.com/Sosthene00/tsify", branch = "next" } wasm-bindgen = "0.2.91" rs_merkle = "1.4.2" +zstd = "0.13.3" diff --git a/src/lib.rs b/src/lib.rs index f88cf11..3bd6036 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,7 +3,6 @@ use std::str::FromStr; use std::sync::{Mutex, MutexGuard}; pub use aes_gcm; -pub use ciborium; pub use env_logger; pub use log; pub use rand; @@ -14,6 +13,7 @@ pub use serde_wasm_bindgen; pub use tsify; pub use wasm_bindgen; pub use js_sys; +pub use zstd; pub mod crypto; pub mod device; diff --git a/src/serialization.rs b/src/serialization.rs index ab15cf4..db11b34 100644 --- a/src/serialization.rs +++ b/src/serialization.rs @@ -37,17 +37,6 @@ where Ok(arr) } -pub fn ciborium_serialize(value: &T) -> anyhow::Result> { - let mut writer = vec![]; - ciborium::into_writer(value, &mut writer)?; - Ok(writer) -} - -pub fn ciborium_deserialize(serialized_value: &[u8]) -> anyhow::Result { - let res = ciborium::from_reader(serialized_value)?; - Ok(res) -} - pub mod members_map { use super::*; use crate::pcd::Member;