Skip to content

Conversation

@bgm-malbeclabs
Copy link
Contributor

@bgm-malbeclabs bgm-malbeclabs commented Feb 7, 2026

Summary of Changes

I noticed that AccessPassInUse wasn't present in the test. strum automatically generates the error variants.

Closes #2852

Testing Verification

  • Tests pass

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors the smart contract error conversion test to iterate over DoubleZeroError variants automatically via strum, reducing the chance of missing variants in manual lists.

Changes:

  • Derive EnumIter for DoubleZeroError in test builds and iterate over variants in the conversion test.
  • Add strum / strum_macros workspace dependencies and include them in the program crate.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
smartcontract/programs/doublezero-serviceability/src/error.rs Switches the error conversion test from a manual variant list to strum-driven iteration.
smartcontract/programs/doublezero-serviceability/Cargo.toml Adds strum dependencies for the program crate to support test-only iteration.
Cargo.toml Pins workspace versions for strum and strum_macros.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bgm-malbeclabs bgm-malbeclabs enabled auto-merge (squash) February 7, 2026 19:13
@bgm-malbeclabs bgm-malbeclabs merged commit 5338e27 into main Feb 7, 2026
28 checks passed
@bgm-malbeclabs bgm-malbeclabs deleted the bgm/error_exhaust branch February 7, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use strum to enumerate over all error variants

3 participants