From 7c46410dd380050a72dfce7fb4b7186f75e7cf44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Tue, 14 Jan 2025 13:57:26 +0000 Subject: [PATCH] chore: update indexed_db_futures --- Cargo.lock | 107 ++++++-- Cargo.toml | 7 +- common/wasm/client-core/src/lib.rs | 6 - common/wasm/client-core/src/storage/mod.rs | 33 +-- common/wasm/storage/Cargo.toml | 2 +- common/wasm/storage/src/error.rs | 33 +-- common/wasm/storage/src/lib.rs | 121 +++++---- common/wasm/storage/src/traits.rs | 27 +- contracts/Cargo.lock | 22 +- nym-browser-extension/storage/src/storage.rs | 13 +- nym-wallet/Cargo.lock | 259 ++++++++++--------- 11 files changed, 362 insertions(+), 268 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ef06593a993..26d1bd33266 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "accessory" -version = "1.3.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87537f9ae7cfa78d5b8ebd1a1db25959f5e737126be4d8eb44a5452fc4b63cde" +checksum = "bb3791c4beae5b827e93558ac83a88e63a841aad61759a05d9b577ef16030470" dependencies = [ "macroific", "proc-macro2", @@ -1989,10 +1989,12 @@ dependencies = [ [[package]] name = "delegate-display" -version = "2.1.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98a85201f233142ac819bbf6226e36d0b5e129a47bd325084674261c82d4cd66" +checksum = "9926686c832494164c33a36bf65118f4bd6e704000b58c94681bf62e9ad67a74" dependencies = [ + "impartial-ord", + "itoa", "macroific", "proc-macro2", "quote", @@ -2042,6 +2044,27 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", + "unicode-xid", +] + [[package]] name = "devise" version = "0.4.1" @@ -2483,9 +2506,9 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fancy_constructor" -version = "1.2.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f71f317e4af73b2f8f608fac190c52eac4b1879d2145df1db2fe48881ca69435" +checksum = "fac0fd7f4636276b4bd7b3148d0ba2c1c3fbede2b5214e47e7fedb70b02cde44" dependencies = [ "macroific", "proc-macro2", @@ -3541,6 +3564,17 @@ dependencies = [ "icu_properties", ] +[[package]] +name = "impartial-ord" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ab604ee7085efba6efc65e4ebca0e9533e3aff6cb501d7d77b211e3a781c6d5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "importer-cli" version = "0.1.0" @@ -3579,20 +3613,38 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexed_db_futures" -version = "0.4.2" -source = "git+https://github.com/TiemenSch/rust-indexed-db?branch=update-uuid#9745d015707008b0c410115d787014a6d1af2efb" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56078e9bfed55e1d3c0cebad5be921d32f062be8f1e4bf3750b487bc6e7d13e" dependencies = [ "accessory", "cfg-if", "delegate-display", + "derive_more", "fancy_constructor", + "indexed_db_futures_macros_internal", "js-sys", - "uuid", + "sealed", + "smallvec", + "thiserror 1.0.69", + "tokio", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", ] +[[package]] +name = "indexed_db_futures_macros_internal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caeba94923b68f254abef921cea7e7698bf4675fdd89d7c58bf1ed885b49a27d" +dependencies = [ + "macroific", + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -4033,9 +4085,9 @@ dependencies = [ [[package]] name = "macroific" -version = "1.3.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f05c00ac596022625d01047c421a0d97d7f09a18e429187b341c201cb631b9dd" +checksum = "89f276537b4b8f981bf1c13d79470980f71134b7bdcc5e6e911e910e556b0285" dependencies = [ "macroific_attr_parse", "macroific_core", @@ -4044,32 +4096,33 @@ dependencies = [ [[package]] name = "macroific_attr_parse" -version = "1.3.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd94d5da95b30ae6e10621ad02340909346ad91661f3f8c0f2b62345e46a2f67" +checksum = "ad4023761b45fcd36abed8fb7ae6a80456b0a38102d55e89a57d9a594a236be9" dependencies = [ - "cfg-if", "proc-macro2", "quote", + "sealed", "syn 2.0.90", ] [[package]] name = "macroific_core" -version = "1.0.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13198c120864097a565ccb3ff947672d969932b7975ebd4085732c9f09435e55" +checksum = "d0a7594d3c14916fa55bef7e9d18c5daa9ed410dd37504251e4b75bbdeec33e3" dependencies = [ "proc-macro2", "quote", + "sealed", "syn 2.0.90", ] [[package]] name = "macroific_macro" -version = "1.1.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c9853143cbed7f1e41dc39fee95f9b361bec65c8dc2a01bf609be01b61f5ae" +checksum = "4da6f2ed796261b0a74e2b52b42c693bb6dee1effba3a482c49592659f824b3b" dependencies = [ "macroific_attr_parse", "macroific_core", @@ -8567,6 +8620,17 @@ dependencies = [ "untrusted", ] +[[package]] +name = "sealed" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22f968c5ea23d555e670b449c1c5e7b2fc399fdaec1d304a17cd48e288abc107" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "sec1" version = "0.7.3" @@ -10846,7 +10910,6 @@ checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" dependencies = [ "getrandom", "serde", - "wasm-bindgen", ] [[package]] @@ -11049,7 +11112,7 @@ name = "wasm-storage" version = "0.1.0" dependencies = [ "async-trait", - "futures", + "getrandom", "indexed_db_futures", "js-sys", "nym-store-cipher", @@ -11091,9 +11154,9 @@ dependencies = [ [[package]] name = "wasmtimer" -version = "0.2.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f656cd8858a5164932d8a90f936700860976ec21eb00e0fe2aa8cab13f6b4cf" +checksum = "0048ad49a55b9deb3953841fa1fc5858f0efbcb7a18868c899a360269fac1b23" dependencies = [ "futures", "js-sys", diff --git a/Cargo.toml b/Cargo.toml index 687cc86b2fc..05400f607f4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -398,16 +398,13 @@ prost = { version = "0.12", default-features = false } gloo-utils = "0.2.0" gloo-net = "0.5.0" -# use a separate branch due to feature unification failures -# this is blocked until the upstream removes outdates `wasm_bindgen` feature usage -# indexed_db_futures = "0.4.1" -indexed_db_futures = { git = "https://github.com/TiemenSch/rust-indexed-db", branch = "update-uuid" } +indexed_db_futures = "0.6.0" js-sys = "0.3.76" serde-wasm-bindgen = "0.6.5" tsify = "0.4.5" wasm-bindgen = "0.2.99" wasm-bindgen-futures = "0.4.49" -wasmtimer = "0.2.0" +wasmtimer = "0.4.1" web-sys = "0.3.72" # Profile settings for individual crates diff --git a/common/wasm/client-core/src/lib.rs b/common/wasm/client-core/src/lib.rs index 8569dd7ad97..ae3a5a0b136 100644 --- a/common/wasm/client-core/src/lib.rs +++ b/common/wasm/client-core/src/lib.rs @@ -1,15 +1,10 @@ // Copyright 2023 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -#[cfg(target_arch = "wasm32")] pub mod config; -#[cfg(target_arch = "wasm32")] pub mod error; -#[cfg(target_arch = "wasm32")] pub mod helpers; -#[cfg(target_arch = "wasm32")] pub mod storage; -#[cfg(target_arch = "wasm32")] pub mod topology; // re-export types for ease of use @@ -34,5 +29,4 @@ pub use nym_validator_client::{DirectSigningReqwestRpcNyxdClient, QueryReqwestRp // TODO: that's a very nasty import path. it should come from contracts instead! pub use nym_validator_client::client::IdentityKey; -#[cfg(target_arch = "wasm32")] pub use wasm_utils::set_panic_hook; diff --git a/common/wasm/client-core/src/storage/mod.rs b/common/wasm/client-core/src/storage/mod.rs index c210dc1dcc7..1cd54e79a39 100644 --- a/common/wasm/client-core/src/storage/mod.rs +++ b/common/wasm/client-core/src/storage/mod.rs @@ -4,13 +4,15 @@ use crate::error::WasmCoreError; use crate::storage::wasm_client_traits::{v1, v2, WasmClientStorage}; use async_trait::async_trait; -use js_sys::{Array, Promise}; +use js_sys::Promise; use serde::de::DeserializeOwned; use serde::Serialize; use wasm_bindgen::prelude::*; use wasm_bindgen_futures::future_to_promise; use wasm_storage::traits::BaseWasmStorage; -use wasm_storage::{IdbVersionChangeEvent, WasmStorage}; +use wasm_storage::{ + Build, Database, RawDbResult, TryFromJs, TryToJs, VersionChangeEvent, WasmStorage, +}; use wasm_utils::error::{simple_js_error, PromisableResult}; use zeroize::Zeroizing; @@ -44,26 +46,27 @@ impl ClientStorage { // special care must be taken on JS side to ensure it's correctly used there. let passphrase = Zeroizing::new(passphrase); - let migrate_fn = Some(|evt: &IdbVersionChangeEvent| -> Result<(), JsValue> { + let migrate_fn = Some(|evt: VersionChangeEvent, db: Database| -> RawDbResult<()> { // Even if the web-sys bindings expose the version as a f64, the IndexedDB API // works with an unsigned integer. // See let old_version = evt.old_version() as u32; - let db = evt.db(); if old_version < 1 { // migrating to version 2 - db.create_object_store(v1::KEYS_STORE)?; - db.create_object_store(v1::CORE_STORE)?; + db.create_object_store(v1::KEYS_STORE).build()?; + db.create_object_store(v1::CORE_STORE).build()?; - db.create_object_store(v2::GATEWAY_REGISTRATIONS_ACTIVE_GATEWAY_STORE)?; - db.create_object_store(v2::GATEWAY_REGISTRATIONS_REGISTERED_GATEWAYS_STORE)?; + db.create_object_store(v2::GATEWAY_REGISTRATIONS_ACTIVE_GATEWAY_STORE) + .build()?; + db.create_object_store(v2::GATEWAY_REGISTRATIONS_REGISTERED_GATEWAYS_STORE) + .build()?; } // version 1 -> unimplemented migration if old_version < 2 { - return Err(simple_js_error("this client is incompatible with existing storage. please initialise it again.")); + return Err(simple_js_error("this client is incompatible with existing storage. please initialise it again.").into()); } Ok(()) @@ -110,7 +113,7 @@ impl BaseWasmStorage for ClientStorage { async fn read_value(&self, store: &str, key: K) -> Result, Self::StorageError> where T: DeserializeOwned, - K: JsCast, + K: TryToJs, { Ok(self.inner.read_value(store, key).await?) } @@ -123,33 +126,33 @@ impl BaseWasmStorage for ClientStorage { ) -> Result<(), Self::StorageError> where T: Serialize, - K: JsCast, + K: TryToJs + TryFromJs, { Ok(self.inner.store_value(store, key, value).await?) } async fn remove_value(&self, store: &str, key: K) -> Result<(), Self::StorageError> where - K: JsCast, + K: TryToJs, { Ok(self.inner.remove_value(store, key).await?) } async fn has_value(&self, store: &str, key: K) -> Result where - K: JsCast, + K: TryToJs, { Ok(self.inner.has_value(store, key).await?) } async fn key_count(&self, store: &str, key: K) -> Result where - K: JsCast, + K: TryToJs, { Ok(self.inner.key_count(store, key).await?) } - async fn get_all_keys(&self, store: &str) -> Result { + async fn get_all_keys(&self, store: &str) -> Result, Self::StorageError> { Ok(self.inner.get_all_keys(store).await?) } } diff --git a/common/wasm/storage/Cargo.toml b/common/wasm/storage/Cargo.toml index 5ceb437953f..71364c0c57c 100644 --- a/common/wasm/storage/Cargo.toml +++ b/common/wasm/storage/Cargo.toml @@ -9,7 +9,7 @@ license.workspace = true [dependencies] async-trait = { workspace = true } -futures = { workspace = true } +getrandom = { workspace = true, features = ["js"] } js-sys = { workspace = true } wasm-bindgen = { workspace = true } serde = { workspace = true, features = ["derive"] } diff --git a/common/wasm/storage/src/error.rs b/common/wasm/storage/src/error.rs index e4da9497f12..3ca74adee43 100644 --- a/common/wasm/storage/src/error.rs +++ b/common/wasm/storage/src/error.rs @@ -1,7 +1,6 @@ // Copyright 2023 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use indexed_db_futures::web_sys::DomException; use serde_wasm_bindgen::Error; use thiserror::Error; use wasm_bindgen::JsValue; @@ -12,15 +11,11 @@ pub enum StorageError { #[error("{0}")] Json(String), - #[error("DomException {name} ({code}): {message}")] - DomException { - /// DomException code - code: u16, - /// Specific name of the DomException - name: String, - /// Message given to the DomException - message: String, - }, + #[error("storage failure: {message}")] + InternalStorageFailure { message: String }, + + #[error("failed to open the db file: {message}")] + DbOpenFailure { message: String }, #[error("FATAL ERROR: storage key is somehow present {count} times in the table!")] DuplicateKey { count: u32 }, @@ -46,12 +41,18 @@ impl From for JsValue { } } -impl From for StorageError { - fn from(value: DomException) -> StorageError { - StorageError::DomException { - name: value.name(), - message: value.message(), - code: value.code(), +impl From for StorageError { + fn from(value: indexed_db_futures::error::Error) -> Self { + StorageError::InternalStorageFailure { + message: value.to_string(), + } + } +} + +impl From for StorageError { + fn from(value: indexed_db_futures::error::OpenDbError) -> Self { + StorageError::DbOpenFailure { + message: value.to_string(), } } } diff --git a/common/wasm/storage/src/lib.rs b/common/wasm/storage/src/lib.rs index 96bffa7ff3f..8d9e7952708 100644 --- a/common/wasm/storage/src/lib.rs +++ b/common/wasm/storage/src/lib.rs @@ -1,8 +1,9 @@ -// Copyright 2023 - Nym Technologies SA +// Copyright 2023-2025 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 use crate::cipher_export::StoredExportedStoreCipher; use crate::error::StorageError; +use indexed_db_futures::transaction::TransactionMode; use nym_store_cipher::{ Aes256Gcm, Algorithm, EncryptedData, KdfInfo, KeySizeUser, Params, StoreCipher, Unsigned, Version, @@ -13,7 +14,10 @@ use std::future::IntoFuture; use wasm_bindgen::JsValue; use wasm_utils::console_log; +pub use indexed_db_futures::database::{Database, VersionChangeEvent}; pub use indexed_db_futures::prelude::*; +pub use indexed_db_futures::primitive::{TryFromJs, TryToJs}; +pub use indexed_db_futures::Result as RawDbResult; mod cipher_export; pub mod error; @@ -54,31 +58,29 @@ impl WasmStorage { passphrase: Option<&[u8]>, ) -> Result where - F: Fn(&IdbVersionChangeEvent) -> Result<(), JsValue> + 'static, + F: Fn(VersionChangeEvent, Database) -> RawDbResult<()> + 'static, { - let mut db_req: OpenDbRequest = IdbDatabase::open_u32(db_name, version)?; - // we must always ensure the cipher table is present - db_req.set_on_upgrade_needed(Some( - move |evt: &IdbVersionChangeEvent| -> Result<(), JsValue> { + let db = Database::open(db_name) + .with_version(version) + .with_on_upgrade_needed(move |event, db| { // Even if the web-sys bindings expose the version as a f64, the IndexedDB API // works with an unsigned integer. // See - let old_version = evt.old_version() as u32; + let old_version = event.old_version() as u32; if old_version < 1 { - evt.db().create_object_store(CIPHER_INFO_STORE)?; + db.create_object_store(CIPHER_INFO_STORE).build()?; } if let Some(migrate) = migrate_fn.as_ref() { - migrate(evt) + migrate(event, db) } else { Ok(()) } - }, - )); + }) + .await?; - let db: IdbDatabase = db_req.into_future().await?; let inner = IdbWrapper(db); let store_cipher = inner.setup_store_cipher(passphrase).await?; @@ -94,13 +96,12 @@ impl WasmStorage { } pub async fn remove(db_name: &str) -> Result<(), StorageError> { - IdbDatabase::delete_by_name(db_name)?.into_future().await?; + Database::delete_by_name(db_name)?.into_future().await?; Ok(()) } pub async fn exists(db_name: &str) -> Result { - let db_req: OpenDbRequest = IdbDatabase::open(db_name)?; - let db: IdbDatabase = db_req.into_future().await?; + let db = Database::open(db_name).await?; // if the db was already created before, at the very least cipher info store should exist, // thus the iterator should return at least one value @@ -139,7 +140,7 @@ impl WasmStorage { pub async fn read_value(&self, store: &str, key: K) -> Result, StorageError> where T: DeserializeOwned, - K: wasm_bindgen::JsCast, + K: TryToJs, { self.inner .read_value_raw(store, key) @@ -156,7 +157,7 @@ impl WasmStorage { ) -> Result<(), StorageError> where T: Serialize, - K: wasm_bindgen::JsCast, + K: TryToJs + TryFromJs, { self.inner .store_value_raw(store, key, &self.serialize_value(&value)?) @@ -165,14 +166,14 @@ impl WasmStorage { pub async fn remove_value(&self, store: &str, key: K) -> Result<(), StorageError> where - K: wasm_bindgen::JsCast, + K: TryToJs, { self.inner.remove_value_raw(store, key).await } pub async fn has_value(&self, store: &str, key: K) -> Result where - K: wasm_bindgen::JsCast, + K: TryToJs, { match self.key_count(store, key).await? { 0 => Ok(false), @@ -183,82 +184,98 @@ impl WasmStorage { pub async fn key_count(&self, store: &str, key: K) -> Result where - K: wasm_bindgen::JsCast, + K: TryToJs, { self.inner.get_key_count(store, key).await } - pub async fn get_all_keys(&self, store: &str) -> Result { + pub async fn get_all_keys(&self, store: &str) -> Result, StorageError> { self.inner.get_all_keys(store).await } } -struct IdbWrapper(IdbDatabase); +struct IdbWrapper(Database); impl IdbWrapper { async fn read_value_raw(&self, store: &str, key: K) -> Result, StorageError> where - K: wasm_bindgen::JsCast, + K: TryToJs, { self.0 - .transaction_on_one_with_mode(store, IdbTransactionMode::Readonly)? + .transaction(store) + .with_mode(TransactionMode::Readonly) + .build()? .object_store(store)? - .get(&key)? + .get(&key) + .primitive()? .await .map_err(Into::into) } - async fn store_value_raw( + async fn store_value_raw( &self, store: &str, key: K, - value: &JsValue, + value: &T, ) -> Result<(), StorageError> where - K: wasm_bindgen::JsCast, + K: TryToJs + TryFromJs, + T: TryToJs, { - self.0 - .transaction_on_one_with_mode(store, IdbTransactionMode::Readwrite)? - .object_store(store)? - .put_key_val_owned(key, value)? - .into_future() - .await - .map_err(Into::into) + let tx = self + .0 + .transaction(store) + .with_mode(TransactionMode::Readwrite) + .build()?; + + let store = tx.object_store(store)?; + store.put(value).with_key(key).primitive()?.await?; + + tx.commit().await.map_err(Into::into) } async fn remove_value_raw(&self, store: &str, key: K) -> Result<(), StorageError> where - K: wasm_bindgen::JsCast, + K: TryToJs, { - self.0 - .transaction_on_one_with_mode(store, IdbTransactionMode::Readwrite)? - .object_store(store)? - .delete_owned(key)? - .into_future() - .await - .map_err(Into::into) + let tx = self + .0 + .transaction(store) + .with_mode(TransactionMode::Readwrite) + .build()?; + + let store = tx.object_store(store)?; + store.delete(key).primitive()?.await?; + + tx.commit().await.map_err(Into::into) } async fn get_key_count(&self, store: &str, key: K) -> Result where - K: wasm_bindgen::JsCast, + K: TryToJs, { self.0 - .transaction_on_one_with_mode(store, IdbTransactionMode::Readwrite)? + .transaction(store) + .with_mode(TransactionMode::Readonly) + .build()? .object_store(store)? - .count_with_key_owned(key)? - .into_future() + .count() + .with_query(key) + .primitive()? .await .map_err(Into::into) } - async fn get_all_keys(&self, store: &str) -> Result { + async fn get_all_keys(&self, store: &str) -> Result, StorageError> { self.0 - .transaction_on_one_with_mode(store, IdbTransactionMode::Readonly)? + .transaction(store) + .with_mode(TransactionMode::Readonly) + .build()? .object_store(store)? - .get_all_keys()? - .into_future() - .await + .get_all_keys() + .primitive()? + .await? + .collect::, _>>() .map_err(Into::into) } diff --git a/common/wasm/storage/src/traits.rs b/common/wasm/storage/src/traits.rs index b9c124fe07a..7d63de95b6a 100644 --- a/common/wasm/storage/src/traits.rs +++ b/common/wasm/storage/src/traits.rs @@ -3,10 +3,11 @@ use crate::WasmStorage; use async_trait::async_trait; -use js_sys::Array; +use indexed_db_futures::primitive::{TryFromJs, TryToJs}; use serde::de::DeserializeOwned; use serde::Serialize; use std::error::Error; +use wasm_bindgen::JsValue; #[async_trait(?Send)] pub trait BaseWasmStorage { @@ -17,7 +18,7 @@ pub trait BaseWasmStorage { async fn read_value(&self, store: &str, key: K) -> Result, Self::StorageError> where T: DeserializeOwned, - K: wasm_bindgen::JsCast; + K: TryToJs; async fn store_value( &self, @@ -27,21 +28,21 @@ pub trait BaseWasmStorage { ) -> Result<(), Self::StorageError> where T: Serialize, - K: wasm_bindgen::JsCast; + K: TryToJs + TryFromJs; async fn remove_value(&self, store: &str, key: K) -> Result<(), Self::StorageError> where - K: wasm_bindgen::JsCast; + K: TryToJs; async fn has_value(&self, store: &str, key: K) -> Result where - K: wasm_bindgen::JsCast; + K: TryToJs; async fn key_count(&self, store: &str, key: K) -> Result where - K: wasm_bindgen::JsCast; + K: TryToJs; - async fn get_all_keys(&self, store: &str) -> Result; + async fn get_all_keys(&self, store: &str) -> Result, Self::StorageError>; } #[async_trait(?Send)] @@ -55,7 +56,7 @@ impl BaseWasmStorage for WasmStorage { async fn read_value(&self, store: &str, key: K) -> Result, Self::StorageError> where T: DeserializeOwned, - K: wasm_bindgen::JsCast, + K: TryToJs, { self.read_value(store, key).await } @@ -68,33 +69,33 @@ impl BaseWasmStorage for WasmStorage { ) -> Result<(), Self::StorageError> where T: Serialize, - K: wasm_bindgen::JsCast, + K: TryToJs + TryFromJs, { self.store_value(store, key, value).await } async fn remove_value(&self, store: &str, key: K) -> Result<(), Self::StorageError> where - K: wasm_bindgen::JsCast, + K: TryToJs, { self.remove_value(store, key).await } async fn has_value(&self, store: &str, key: K) -> Result where - K: wasm_bindgen::JsCast, + K: TryToJs, { self.has_value(store, key).await } async fn key_count(&self, store: &str, key: K) -> Result where - K: wasm_bindgen::JsCast, + K: TryToJs, { self.key_count(store, key).await } - async fn get_all_keys(&self, store: &str) -> Result { + async fn get_all_keys(&self, store: &str) -> Result, Self::StorageError> { self.get_all_keys(store).await } } diff --git a/contracts/Cargo.lock b/contracts/Cargo.lock index c5c269645bb..674d0b78c93 100644 --- a/contracts/Cargo.lock +++ b/contracts/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 = "aes" @@ -1699,18 +1699,18 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.214" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] @@ -1735,9 +1735,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", @@ -1965,9 +1965,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.36" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" dependencies = [ "deranged", "itoa", @@ -1988,9 +1988,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" dependencies = [ "num-conv", "time-core", diff --git a/nym-browser-extension/storage/src/storage.rs b/nym-browser-extension/storage/src/storage.rs index 41389c8602b..190105816a0 100644 --- a/nym-browser-extension/storage/src/storage.rs +++ b/nym-browser-extension/storage/src/storage.rs @@ -12,7 +12,8 @@ use js_sys::Promise; use std::sync::Arc; use wasm_bindgen::prelude::*; use wasm_bindgen_futures::future_to_promise; -use wasm_storage::{IdbVersionChangeEvent, WasmStorage}; +use wasm_storage::RawDbResult; +use wasm_storage::{Build, Database, VersionChangeEvent, WasmStorage}; use wasm_utils::check_promise_result; use wasm_utils::error::{PromisableResult, PromisableResultError}; use zeroize::Zeroizing; @@ -33,8 +34,8 @@ pub struct ExtensionStorage { } #[allow(clippy::type_complexity)] -fn db_migration() -> Box Result<(), JsValue>> { - Box::new(|evt: &IdbVersionChangeEvent| -> Result<(), JsValue> { +fn db_migration() -> Box RawDbResult<()>> { + Box::new(|evt: VersionChangeEvent, db: Database| -> RawDbResult<()> { // Even if the web-sys bindings expose the version as a f64, the IndexedDB API // works with an unsigned integer. // See @@ -42,9 +43,7 @@ fn db_migration() -> Box Result<(), JsValue>> if old_version < 1 { // migrating to version 1 - let db = evt.db(); - - db.create_object_store(v1::MNEMONICS_STORE)?; + db.create_object_store(v1::MNEMONICS_STORE).build()?; } Ok(()) @@ -122,7 +121,7 @@ impl ExtensionStorage { .map_err(Into::into) } - async fn get_all_mnemonic_keys_async(&self) -> Result { + async fn get_all_mnemonic_keys_async(&self) -> Result, ExtensionStorageError> { self.inner .get_all_keys(v1::MNEMONICS_STORE) .await diff --git a/nym-wallet/Cargo.lock b/nym-wallet/Cargo.lock index a477ed953f1..f5a8574b0e4 100644 --- a/nym-wallet/Cargo.lock +++ b/nym-wallet/Cargo.lock @@ -167,13 +167,13 @@ checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" [[package]] name = "async-trait" -version = "0.1.83" +version = "0.1.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.96", ] [[package]] @@ -492,7 +492,7 @@ dependencies = [ "cairo-sys-rs", "glib", "libc", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -535,7 +535,7 @@ dependencies = [ "semver", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -658,7 +658,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.96", ] [[package]] @@ -838,7 +838,7 @@ dependencies = [ "signature", "subtle-encoding", "tendermint 0.34.0", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -858,7 +858,7 @@ dependencies = [ "subtle-encoding", "tendermint 0.37.0", "tendermint-rpc", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -872,7 +872,7 @@ dependencies = [ "ed25519-zebra", "k256", "rand_core 0.6.4", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -894,7 +894,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -925,7 +925,7 @@ dependencies = [ "serde", "serde-json-wasm", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -1022,7 +1022,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.85", + "syn 2.0.96", ] [[package]] @@ -1083,7 +1083,7 @@ checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.96", ] [[package]] @@ -1111,7 +1111,7 @@ dependencies = [ "cw-utils", "schemars", "serde", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -1137,7 +1137,7 @@ dependencies = [ "schemars", "semver", "serde", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -1152,7 +1152,7 @@ dependencies = [ "schemars", "semver", "serde", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -1180,7 +1180,7 @@ dependencies = [ "cw20", "schemars", "serde", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -1631,9 +1631,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "miniz_oxide 0.8.0", @@ -1697,9 +1697,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -1712,9 +1712,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -1722,15 +1722,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -1739,38 +1739,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.96", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -1931,7 +1931,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.96", ] [[package]] @@ -1964,7 +1964,7 @@ dependencies = [ "glib", "libc", "once_cell", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -1997,7 +1997,7 @@ dependencies = [ "libc", "once_cell", "smallvec", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -2678,7 +2678,7 @@ dependencies = [ "combine", "jni-sys", "log", - "thiserror", + "thiserror 1.0.64", "walkdir", ] @@ -2949,7 +2949,7 @@ dependencies = [ "jni-sys", "ndk-sys", "num_enum", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -3091,7 +3091,7 @@ dependencies = [ "serde_json", "sha2 0.10.8", "tendermint 0.37.0", - "thiserror", + "thiserror 1.0.64", "time", "utoipa", ] @@ -3149,7 +3149,7 @@ dependencies = [ "serde", "sha2 0.9.9", "subtle 2.5.0", - "thiserror", + "thiserror 1.0.64", "zeroize", ] @@ -3162,7 +3162,7 @@ dependencies = [ "log", "nym-network-defaults", "serde", - "thiserror", + "thiserror 1.0.64", "toml 0.8.19", "url", ] @@ -3177,7 +3177,7 @@ dependencies = [ "cw-storage-plus", "schemars", "serde", - "thiserror", + "thiserror 1.0.64", "vergen", ] @@ -3192,7 +3192,7 @@ dependencies = [ "rand 0.8.5", "serde", "strum 0.26.3", - "thiserror", + "thiserror 1.0.64", "time", "utoipa", ] @@ -3209,7 +3209,7 @@ dependencies = [ "serde", "serde_bytes", "subtle-encoding", - "thiserror", + "thiserror 1.0.64", "x25519-dalek", "zeroize", ] @@ -3224,7 +3224,7 @@ dependencies = [ "cw-controllers", "cw-utils", "nym-multisig-contract-common", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -3240,7 +3240,7 @@ version = "0.1.0" dependencies = [ "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "tracing", "utoipa", ] @@ -3266,7 +3266,7 @@ dependencies = [ "reqwest 0.12.4", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "tracing", "url", "wasmtimer", @@ -3288,7 +3288,7 @@ dependencies = [ "serde", "serde-json-wasm", "serde_repr", - "thiserror", + "thiserror 1.0.64", "time", "ts-rs", "utoipa", @@ -3306,7 +3306,7 @@ dependencies = [ "cw4", "schemars", "serde", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -3340,7 +3340,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "time", "utoipa", ] @@ -3368,7 +3368,7 @@ name = "nym-sphinx-types" version = "0.2.0" dependencies = [ "sphinx-packet", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -3382,7 +3382,7 @@ dependencies = [ "rand 0.8.5", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "zeroize", ] @@ -3422,7 +3422,7 @@ dependencies = [ "serde_json", "sha2 0.10.8", "strum 0.26.3", - "thiserror", + "thiserror 1.0.64", "ts-rs", "url", "utoipa", @@ -3469,7 +3469,7 @@ dependencies = [ "serde_json", "sha2 0.9.9", "tendermint-rpc", - "thiserror", + "thiserror 1.0.64", "time", "tokio", "tracing", @@ -3487,7 +3487,7 @@ dependencies = [ "nym-contracts-common", "nym-mixnet-contract-common", "serde", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -3533,7 +3533,7 @@ dependencies = [ "nym-config", "nym-network-defaults", "serde", - "thiserror", + "thiserror 1.0.64", "x25519-dalek", ] @@ -3580,7 +3580,7 @@ dependencies = [ "tauri-codegen", "tauri-macros", "tempfile", - "thiserror", + "thiserror 1.0.64", "time", "tokio", "toml 0.5.11", @@ -3688,7 +3688,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.96", ] [[package]] @@ -3851,7 +3851,7 @@ version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a" dependencies = [ - "thiserror", + "thiserror 1.0.64", "ucd-trie", ] @@ -3875,7 +3875,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.96", ] [[package]] @@ -4004,7 +4004,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.96", ] [[package]] @@ -4161,7 +4161,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.96", ] [[package]] @@ -4172,9 +4172,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -4199,7 +4199,7 @@ dependencies = [ "itertools 0.11.0", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.96", ] [[package]] @@ -4364,7 +4364,7 @@ checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ "getrandom 0.2.10", "redox_syscall 0.2.16", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -4734,7 +4734,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.85", + "syn 2.0.96", ] [[package]] @@ -4819,18 +4819,18 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.214" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] @@ -4855,13 +4855,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.96", ] [[package]] @@ -4872,14 +4872,14 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.96", ] [[package]] name = "serde_json" -version = "1.0.132" +version = "1.0.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" +checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" dependencies = [ "itoa 1.0.9", "memchr", @@ -4895,7 +4895,7 @@ checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.96", ] [[package]] @@ -5249,7 +5249,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.85", + "syn 2.0.96", ] [[package]] @@ -5292,9 +5292,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.85" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -5465,7 +5465,7 @@ dependencies = [ "tauri-runtime-wry", "tauri-utils", "tempfile", - "thiserror", + "thiserror 1.0.64", "time", "tokio", "url", @@ -5512,7 +5512,7 @@ dependencies = [ "serde_json", "sha2 0.10.8", "tauri-utils", - "thiserror", + "thiserror 1.0.64", "time", "uuid 1.10.0", "walkdir", @@ -5546,7 +5546,7 @@ dependencies = [ "serde", "serde_json", "tauri-utils", - "thiserror", + "thiserror 1.0.64", "uuid 1.10.0", "webview2-com", "windows 0.39.0", @@ -5594,7 +5594,7 @@ dependencies = [ "serde", "serde_json", "serde_with", - "thiserror", + "thiserror 1.0.64", "url", "walkdir", "windows 0.39.0", @@ -5747,7 +5747,7 @@ dependencies = [ "tendermint 0.37.0", "tendermint-config", "tendermint-proto 0.37.0", - "thiserror", + "thiserror 1.0.64", "time", "tokio", "tracing", @@ -5788,7 +5788,16 @@ version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.64", +] + +[[package]] +name = "thiserror" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +dependencies = [ + "thiserror-impl 2.0.11", ] [[package]] @@ -5799,7 +5808,18 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.96", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", ] [[package]] @@ -5814,9 +5834,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.36" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" dependencies = [ "deranged", "itoa 1.0.9", @@ -5837,9 +5857,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" dependencies = [ "num-conv", "time-core", @@ -5886,7 +5906,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.96", ] [[package]] @@ -6032,11 +6052,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ - "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -6045,20 +6064,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.96", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", "valuable", @@ -6110,24 +6129,24 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "ts-rs" -version = "10.0.0" +version = "10.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a2f31991cee3dce1ca4f929a8a04fdd11fd8801aac0f2030b0fa8a0a3fef6b9" +checksum = "e640d9b0964e9d39df633548591090ab92f7a4567bc31d3891af23471a3365c6" dependencies = [ "lazy_static", - "thiserror", + "thiserror 2.0.11", "ts-rs-macros", ] [[package]] name = "ts-rs-macros" -version = "10.0.0" +version = "10.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea0b99e8ec44abd6f94a18f28f7934437809dd062820797c52401298116f70e" +checksum = "0e9d8656589772eeec2cf7a8264d9cda40fb28b9bc53118ceb9e8c07f8f38730" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.96", "termcolor", ] @@ -6230,7 +6249,7 @@ checksum = "a77d306bc75294fd52f3e99b13ece67c02c1a2789190a6f31d32f736624326f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.96", ] [[package]] @@ -6345,7 +6364,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.96", "wasm-bindgen-shared", ] @@ -6379,7 +6398,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.96", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6392,9 +6411,9 @@ checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasmtimer" -version = "0.2.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f656cd8858a5164932d8a90f936700860976ec21eb00e0fe2aa8cab13f6b4cf" +checksum = "0048ad49a55b9deb3953841fa1fc5858f0efbcb7a18868c899a360269fac1b23" dependencies = [ "futures", "js-sys", @@ -6502,7 +6521,7 @@ dependencies = [ "regex", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "windows 0.39.0", "windows-bindgen", "windows-metadata", @@ -6939,7 +6958,7 @@ dependencies = [ "sha2 0.10.8", "soup2", "tao", - "thiserror", + "thiserror 1.0.64", "url", "webkit2gtk", "webkit2gtk-sys", @@ -7008,7 +7027,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.96", ] [[package]]