update serde_with

This commit is contained in:
wiesche
2026-09-08 11:00:02 +02:00
parent 0177b49b05
commit 88e1e3b50a
4 changed files with 18 additions and 73 deletions
Generated
+8 -66
View File
@@ -1140,16 +1140,6 @@ dependencies = [
"syn 2.0.118", "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]] [[package]]
name = "darling" name = "darling"
version = "0.14.4" version = "0.14.4"
@@ -1180,20 +1170,6 @@ dependencies = [
"darling_macro 0.23.0", "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]] [[package]]
name = "darling_core" name = "darling_core"
version = "0.14.4" version = "0.14.4"
@@ -1234,17 +1210,6 @@ dependencies = [
"syn 2.0.118", "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]] [[package]]
name = "darling_macro" name = "darling_macro"
version = "0.14.4" version = "0.14.4"
@@ -2632,7 +2597,7 @@ dependencies = [
"serde", "serde",
"serde_derive", "serde_derive",
"serde_json", "serde_json",
"serde_with 1.14.0", "serde_with",
"sha2 0.10.9", "sha2 0.10.9",
"strum 0.18.0", "strum 0.18.0",
"strum_macros 0.18.0", "strum_macros 0.18.0",
@@ -5638,17 +5603,6 @@ dependencies = [
"serde_core", "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]] [[package]]
name = "serde_with" name = "serde_with"
version = "3.21.0" version = "3.21.0"
@@ -5665,22 +5619,10 @@ dependencies = [
"schemars 1.2.1", "schemars 1.2.1",
"serde_core", "serde_core",
"serde_json", "serde_json",
"serde_with_macros 3.21.0", "serde_with_macros",
"time", "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]] [[package]]
name = "serde_with_macros" name = "serde_with_macros"
version = "3.21.0" version = "3.21.0"
@@ -6658,7 +6600,7 @@ dependencies = [
"rand 0.10.2", "rand 0.10.2",
"safelog", "safelog",
"serde", "serde",
"serde_with 3.21.0", "serde_with",
"thiserror 2.0.18", "thiserror 2.0.18",
"tor-async-utils", "tor-async-utils",
"tor-basic-utils", "tor-basic-utils",
@@ -7081,7 +7023,7 @@ dependencies = [
"rangemap", "rangemap",
"safelog", "safelog",
"serde", "serde",
"serde_with 3.21.0", "serde_with",
"strum 0.28.0", "strum 0.28.0",
"thiserror 2.0.18", "thiserror 2.0.18",
"tor-async-utils", "tor-async-utils",
@@ -7126,7 +7068,7 @@ dependencies = [
"retry-error", "retry-error",
"safelog", "safelog",
"serde", "serde",
"serde_with 3.21.0", "serde_with",
"strum 0.28.0", "strum 0.28.0",
"thiserror 2.0.18", "thiserror 2.0.18",
"tor-async-utils", "tor-async-utils",
@@ -7234,7 +7176,7 @@ dependencies = [
"itertools 0.14.0", "itertools 0.14.0",
"safelog", "safelog",
"serde", "serde",
"serde_with 3.21.0", "serde_with",
"strum 0.28.0", "strum 0.28.0",
"thiserror 2.0.18", "thiserror 2.0.18",
"tor-basic-utils", "tor-basic-utils",
@@ -7406,7 +7348,7 @@ dependencies = [
"rand 0.10.2", "rand 0.10.2",
"saturating-time", "saturating-time",
"serde", "serde",
"serde_with 3.21.0", "serde_with",
"signature", "signature",
"smallvec", "smallvec",
"strum 0.28.0", "strum 0.28.0",
@@ -7533,7 +7475,7 @@ checksum = "6ef84569d020c36eb322976f9a5dec1d3fa992db9739237ad1ae923b0ddeb298"
dependencies = [ dependencies = [
"caret", "caret",
"paste", "paste",
"serde_with 3.21.0", "serde_with",
"thiserror 2.0.18", "thiserror 2.0.18",
"tor-basic-utils", "tor-basic-utils",
"tor-bytes", "tor-bytes",
+1 -1
View File
@@ -18,7 +18,7 @@ rand = "0.6"
rayon = "1.12" rayon = "1.12"
serde = "1" serde = "1"
serde_derive = "1" serde_derive = "1"
serde_with = { version = "1", features = ["chrono"] } serde_with = { version = "3", features = ["chrono"] }
serde_json = "1" serde_json = "1"
log = "0.4" log = "0.4"
uuid = { version = "1.23.4", features = ["serde", "v4"] } uuid = { version = "1.23.4", features = ["serde", "v4"] }
-1
View File
@@ -55,7 +55,6 @@ without a user confirmation step.
- Revisit `remove_other_sigdata` before allowing more than two participants. - Revisit `remove_other_sigdata` before allowing more than two participants.
- Stop relying on TxLog offsets in contract tests. - Stop relying on TxLog offsets in contract tests.
- Finish the account-switching tests in `contract_accounts.rs`. - Finish the account-switching tests in `contract_accounts.rs`.
- Reuse the workspace `serde_with` version.
### Side-effects ### Side-effects
+9 -5
View File
@@ -299,12 +299,16 @@ pub mod tests {
} }
#[test] #[test]
fn v5_proof_requires_type() -> Result<(), Error> { fn v5_proof_json() -> Result<(), Error> {
let v5 = SlateV5::from(populate_test_slate()?); 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 mut value = serde_json::to_value(v5).unwrap();
let proof = value["proof"].as_object_mut().unwrap(); assert_eq!(value["proof"]["ptype"].as_u64(), Some(1));
assert_eq!(proof["ptype"].as_u64(), Some(1)); assert_eq!(value["proof"]["ts"].as_i64(), Some(timestamp));
proof.remove("ptype"); 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::<SlateV5>(value.clone()).is_err()); assert!(serde_json::from_value::<SlateV5>(value.clone()).is_err());
value["proof"]["ptype"] = serde_json::json!(3); value["proof"]["ptype"] = serde_json::json!(3);