diff --git a/src/identity_tree.rs b/src/identity_tree.rs index 85dd3c35..78d86cba 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 887c7b09..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); @@ -61,7 +61,7 @@ pub enum IdentityHistoryEntryStatus { Bridged, } -#[derive(Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] #[serde(deny_unknown_fields)] pub struct InsertCommitmentRequest { @@ -92,7 +92,7 @@ pub struct RemoveBatchSizeRequest { pub prover_type: ProverType, } -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] #[serde(deny_unknown_fields)] pub struct InclusionProofRequest { @@ -125,7 +125,7 @@ pub struct VerifySemaphoreProofQuery { pub max_root_age_seconds: Option, } -#[derive(Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] #[serde(deny_unknown_fields)] pub struct DeletionRequest { @@ -133,7 +133,7 @@ pub struct DeletionRequest { pub identity_commitment: Hash, } -#[derive(Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] #[serde(deny_unknown_fields)] pub struct RecoveryRequest {