Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pkgs/primitives/src/support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ enum_map! {
pub enum RevocationReason, u16, Unknown {
/// No specific reason.
NotSpecified = 0 => "not_specified",
/// The operator is ending its service.
TerminationOfService = 1 => "termination_of_service",
/// Key material has been compromised.
KeyCompromise = 1 => "key_compromise",
/// Operator is changing keys.
ChangeOfKeys = 2 => "change_of_keys",
/// Service level violation.
ViolationOfService = 3 => "violation_of_service",
CompromisedKeys = 2 => "compromised_keys",
/// The operator is changing keys.
ChangeOfKeys = 3 => "change_of_keys",
Comment on lines +24 to +28

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Suggestion: Add explicit tests for the corrected reason names

The mapping is correct, but the current corpus exercises only the numeric reason values and round trips. It would still pass if a future edit associated a wire value with the wrong public variant or display label. Add a focused test covering RevocationReason::new(1), new(2), and new(3) against TerminationOfService, CompromisedKeys, and ChangeOfKeys, including their display strings, to protect the semantic mapping this change fixes.

source: gpt-6.1-sol (phase2-reviewer: general)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not adding this. A test that asserts each code's Display text would restate the enum_map! table line for line, so it can only fail when someone edits the table and the test together. That is the kind of tautological test this repo avoids. The names are checked against the reference in the description instead: https://github.com/dashpay/dash/blob/938fba502824b9d850b7c710601456dc3d71603e/src/evo/providertx.h#L396-L401


🤖 Posted autonomously by Claude on behalf of pasta.

}
}

Expand Down
Loading