Skip to content

Commit

Permalink
Renumber ReportError values. (#3488)
Browse files Browse the repository at this point in the history
Also, add a "reserved" value to match other similar enumerated values.
  • Loading branch information
branlwyd authored Nov 19, 2024
1 parent 1baf6ca commit 0ac1c9c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions messages/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2135,13 +2135,13 @@ impl Decode for PrepareStepResult {
#[derive(Clone, Copy, Debug, PartialEq, Eq, TryFromPrimitive)]
#[repr(u8)]
pub enum ReportError {
BatchCollected = 0,
ReportReplayed = 1,
ReportDropped = 2,
HpkeUnknownConfigId = 3,
HpkeDecryptError = 4,
VdafPrepError = 5,
BatchSaturated = 6,
Reserved = 0,
BatchCollected = 1,
ReportReplayed = 2,
ReportDropped = 3,
HpkeUnknownConfigId = 4,
HpkeDecryptError = 5,
VdafPrepError = 6,
TaskExpired = 7,
InvalidMessage = 8,
ReportTooEarly = 9,
Expand Down
16 changes: 8 additions & 8 deletions messages/src/tests/aggregation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ fn roundtrip_prepare_resp() {
concat!(
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", // report_id
"02", // prepare_step_result
"05", // report_share_error
"06", // report_share_error
),
),
])
Expand All @@ -270,13 +270,13 @@ fn roundtrip_prepare_resp() {
#[test]
fn roundtrip_report_share_error() {
roundtrip_encoding(&[
(ReportError::BatchCollected, "00"),
(ReportError::ReportReplayed, "01"),
(ReportError::ReportDropped, "02"),
(ReportError::HpkeUnknownConfigId, "03"),
(ReportError::HpkeDecryptError, "04"),
(ReportError::VdafPrepError, "05"),
(ReportError::BatchSaturated, "06"),
(ReportError::Reserved, "00"),
(ReportError::BatchCollected, "01"),
(ReportError::ReportReplayed, "02"),
(ReportError::ReportDropped, "03"),
(ReportError::HpkeUnknownConfigId, "04"),
(ReportError::HpkeDecryptError, "05"),
(ReportError::VdafPrepError, "06"),
(ReportError::TaskExpired, "07"),
(ReportError::InvalidMessage, "08"),
(ReportError::ReportTooEarly, "09"),
Expand Down

0 comments on commit 0ac1c9c

Please sign in to comment.