Skip to content

Commit

Permalink
Add debug implementations to some structs
Browse files Browse the repository at this point in the history
  • Loading branch information
mendess committed Aug 7, 2023
1 parent 8017041 commit 42d119a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions daphne/src/vdaf/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub(crate) enum VdafError {
}

/// A VDAF verification key.
#[derive(Clone, Deserialize, Serialize)]
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum VdafVerifyKey {
Prio3(#[serde(with = "hex")] [u8; 16]),
Expand All @@ -89,7 +89,7 @@ pub trait EarlyReportState {

/// Report state during aggregation initialization after consuming the report share. This involves
/// decryption as well a few validation steps.
#[derive(Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum EarlyReportStateConsumed<'req> {
Ready {
Expand Down
5 changes: 2 additions & 3 deletions daphne_worker/src/durable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ fn durable_name_bucket(bucket: &DapBatchBucket<'_>) -> String {
}

/// Reference to a DO instance, used by the garbage collector.
#[derive(Deserialize, Serialize)]
#[derive(Debug, Deserialize, Serialize)]
pub(crate) struct DurableReference {
/// The DO binding, e.g., "DAP_REPORT_STORE".
pub(crate) binding: String,
Expand All @@ -445,12 +445,11 @@ pub(crate) struct DurableReference {
pub(crate) id_hex: String,

/// If applicable, the DAP task ID to which the DO instance is associated.
#[serde(skip_serializing_if = "Option::is_none")]
pub(crate) task_id: Option<TaskId>,
}

/// An element of a queue stored in a DO instance.
#[derive(Deserialize, Serialize)]
#[derive(Debug, Deserialize, Serialize)]
pub(crate) struct DurableOrdered<T> {
item: T,
prefix: String,
Expand Down
2 changes: 1 addition & 1 deletion daphne_worker/src/durable/reports_pending.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub(crate) enum ReportsPendingResult {
ErrReportExists,
}

#[derive(Deserialize, Serialize)]
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "snake_case")]
pub(crate) struct PendingReport {
pub(crate) task_id: TaskId,
Expand Down
2 changes: 1 addition & 1 deletion daphne_worker/src/durable/reports_processed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ impl GarbageCollectable for ReportsProcessed {
}
}

#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub(crate) struct ReportsProcessedReq<'req> {
pub(crate) is_leader: bool,
pub(crate) vdaf_verify_key: VdafVerifyKey,
Expand Down

0 comments on commit 42d119a

Please sign in to comment.