From 88e1e3b50a3fce3745c9518d0e94a7d5bd8adeb3 Mon Sep 17 00:00:00 2001 From: wiesche Date: Tue, 8 Sep 2026 11:00:02 +0200 Subject: [PATCH] update serde_with --- Cargo.lock | 74 +++--------------------- libwallet/Cargo.toml | 2 +- libwallet/src/contract/actions/README.md | 1 - libwallet/src/slate_versions/mod.rs | 14 +++-- 4 files changed, 18 insertions(+), 73 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 873c248..6819499 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1140,16 +1140,6 @@ dependencies = [ "syn 2.0.118", ] -[[package]] -name = "darling" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" -dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", -] - [[package]] name = "darling" version = "0.14.4" @@ -1180,20 +1170,6 @@ dependencies = [ "darling_macro 0.23.0", ] -[[package]] -name = "darling_core" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2 1.0.106", - "quote 1.0.46", - "strsim 0.10.0", - "syn 1.0.109", -] - [[package]] name = "darling_core" version = "0.14.4" @@ -1234,17 +1210,6 @@ dependencies = [ "syn 2.0.118", ] -[[package]] -name = "darling_macro" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" -dependencies = [ - "darling_core 0.13.4", - "quote 1.0.46", - "syn 1.0.109", -] - [[package]] name = "darling_macro" version = "0.14.4" @@ -2632,7 +2597,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "serde_with 1.14.0", + "serde_with", "sha2 0.10.9", "strum 0.18.0", "strum_macros 0.18.0", @@ -5638,17 +5603,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "serde_with" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" -dependencies = [ - "chrono", - "serde", - "serde_with_macros 1.5.2", -] - [[package]] name = "serde_with" version = "3.21.0" @@ -5665,22 +5619,10 @@ dependencies = [ "schemars 1.2.1", "serde_core", "serde_json", - "serde_with_macros 3.21.0", + "serde_with_macros", "time", ] -[[package]] -name = "serde_with_macros" -version = "1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" -dependencies = [ - "darling 0.13.4", - "proc-macro2 1.0.106", - "quote 1.0.46", - "syn 1.0.109", -] - [[package]] name = "serde_with_macros" version = "3.21.0" @@ -6658,7 +6600,7 @@ dependencies = [ "rand 0.10.2", "safelog", "serde", - "serde_with 3.21.0", + "serde_with", "thiserror 2.0.18", "tor-async-utils", "tor-basic-utils", @@ -7081,7 +7023,7 @@ dependencies = [ "rangemap", "safelog", "serde", - "serde_with 3.21.0", + "serde_with", "strum 0.28.0", "thiserror 2.0.18", "tor-async-utils", @@ -7126,7 +7068,7 @@ dependencies = [ "retry-error", "safelog", "serde", - "serde_with 3.21.0", + "serde_with", "strum 0.28.0", "thiserror 2.0.18", "tor-async-utils", @@ -7234,7 +7176,7 @@ dependencies = [ "itertools 0.14.0", "safelog", "serde", - "serde_with 3.21.0", + "serde_with", "strum 0.28.0", "thiserror 2.0.18", "tor-basic-utils", @@ -7406,7 +7348,7 @@ dependencies = [ "rand 0.10.2", "saturating-time", "serde", - "serde_with 3.21.0", + "serde_with", "signature", "smallvec", "strum 0.28.0", @@ -7533,7 +7475,7 @@ checksum = "6ef84569d020c36eb322976f9a5dec1d3fa992db9739237ad1ae923b0ddeb298" dependencies = [ "caret", "paste", - "serde_with 3.21.0", + "serde_with", "thiserror 2.0.18", "tor-basic-utils", "tor-bytes", diff --git a/libwallet/Cargo.toml b/libwallet/Cargo.toml index 18bd829..09e2b19 100644 --- a/libwallet/Cargo.toml +++ b/libwallet/Cargo.toml @@ -18,7 +18,7 @@ rand = "0.6" rayon = "1.12" serde = "1" serde_derive = "1" -serde_with = { version = "1", features = ["chrono"] } +serde_with = { version = "3", features = ["chrono"] } serde_json = "1" log = "0.4" uuid = { version = "1.23.4", features = ["serde", "v4"] } diff --git a/libwallet/src/contract/actions/README.md b/libwallet/src/contract/actions/README.md index b1bcbad..b04474d 100644 --- a/libwallet/src/contract/actions/README.md +++ b/libwallet/src/contract/actions/README.md @@ -55,7 +55,6 @@ without a user confirmation step. - Revisit `remove_other_sigdata` before allowing more than two participants. - Stop relying on TxLog offsets in contract tests. - Finish the account-switching tests in `contract_accounts.rs`. - - Reuse the workspace `serde_with` version. ### Side-effects diff --git a/libwallet/src/slate_versions/mod.rs b/libwallet/src/slate_versions/mod.rs index 52d6dc1..8c5a92b 100644 --- a/libwallet/src/slate_versions/mod.rs +++ b/libwallet/src/slate_versions/mod.rs @@ -299,12 +299,16 @@ pub mod tests { } #[test] - fn v5_proof_requires_type() -> Result<(), Error> { - let v5 = SlateV5::from(populate_test_slate()?); + fn v5_proof_json() -> Result<(), Error> { + let mut v5 = SlateV5::from(populate_test_slate()?); + let timestamp = 1_234_567_890; + v5.proof.as_mut().unwrap().ts = DateTime::from_timestamp(timestamp, 0); let mut value = serde_json::to_value(v5).unwrap(); - let proof = value["proof"].as_object_mut().unwrap(); - assert_eq!(proof["ptype"].as_u64(), Some(1)); - proof.remove("ptype"); + assert_eq!(value["proof"]["ptype"].as_u64(), Some(1)); + assert_eq!(value["proof"]["ts"].as_i64(), Some(timestamp)); + let decoded: SlateV5 = serde_json::from_value(value.clone()).unwrap(); + assert_eq!(decoded.proof.unwrap().ts.unwrap().timestamp(), timestamp); + value["proof"].as_object_mut().unwrap().remove("ptype"); assert!(serde_json::from_value::(value.clone()).is_err()); value["proof"]["ptype"] = serde_json::json!(3);