From 6e868209eb51a400b11e45dd79ef64116a160b92 Mon Sep 17 00:00:00 2001 From: Eric Woolsey Date: Mon, 5 Feb 2024 09:33:13 -0800 Subject: [PATCH] derives --- Cargo.toml | 1 - src/identity_tree.rs | 6 +++--- src/server/data.rs | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 370e9097..26c64f0c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,6 @@ once_cell = "1.8" oz-api = { path = "crates/oz-api" } prometheus = "0.13.3" # We need upstream PR#465 to fix #272. reqwest = { version = "0.11.18", features = ["json"] } -# ruint has broken semver, specify exact version. ruint = { version = "=1.11.1", features = ["primitive-types", "sqlx"] } semaphore = { git = "https://github.com/worldcoin/semaphore-rs", branch = "main", features = [ "depth_30", diff --git a/src/identity_tree.rs b/src/identity_tree.rs index 6a90e8cf..a95a1208 100644 --- a/src/identity_tree.rs +++ b/src/identity_tree.rs @@ -6,7 +6,7 @@ use semaphore::lazy_merkle_tree::{Derived, LazyMerkleTree}; use semaphore::merkle_tree::Hasher; use semaphore::poseidon_tree::{PoseidonHash, Proof}; use semaphore::{lazy_merkle_tree, Field}; -use serde::Serialize; +use serde::{Deserialize, Serialize}; use sqlx::prelude::FromRow; use tracing::{info, warn}; @@ -40,7 +40,7 @@ pub struct TreeItem { pub leaf_index: usize, } -#[derive(Debug, Serialize, FromRow)] +#[derive(Debug, Serialize, Deserialize, FromRow)] #[serde(rename_all = "camelCase")] pub struct RootItem { pub root: Field, @@ -50,7 +50,7 @@ pub struct RootItem { pub mined_valid_as_of: Option>, } -#[derive(Debug, Serialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct InclusionProof { pub status: Status, diff --git a/src/server/data.rs b/src/server/data.rs index fb02817f..64b73be9 100644 --- a/src/server/data.rs +++ b/src/server/data.rs @@ -8,15 +8,15 @@ use crate::identity_tree::{ }; use crate::prover::{ProverConfig, ProverType}; -#[derive(Serialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(transparent)] pub struct InclusionProofResponse(pub InclusionProof); -#[derive(Serialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(transparent)] pub struct ListBatchSizesResponse(pub Vec); -#[derive(Serialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(transparent)] pub struct VerifySemaphoreProofResponse(pub RootItem);