Skip to content

Conversation

Copy link

Copilot AI commented Jan 16, 2026

Summary of Changes

  • Restored original error code mappings (codes 2-6) in From<DoubleZeroError> for ProgramError and From<u32> for DoubleZeroError implementations
  • The previous implementation reordered these mappings, which would cause deployed clients to misinterpret error codes returned by the smart contract
  • Preserved the new ImmutableField error variant at code 68

Corrected mappings:

// Before (breaking)
2 => InvalidExchangePubkey
3 => InvalidDevicePubkey  
4 => InvalidLocationPubkey
5 => InvalidDeviceAPubkey
6 => InvalidDeviceZPubkey

// After (backward compatible)
2 => InvalidLocationPubkey
3 => InvalidExchangePubkey
4 => InvalidDeviceAPubkey
5 => InvalidDeviceZPubkey
6 => InvalidDevicePubkey

Testing Verification

  • Verified error enum round-trip conversion with test_error_enum_conversions

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

skip-changelog

Co-authored-by: elitegreg <3893730+elitegreg@users.noreply.github.com>
Copilot AI changed the title [WIP] Update account creation/removal based on review feedback Fix error code reordering to maintain backward compatibility Jan 16, 2026
Copilot AI requested a review from elitegreg January 16, 2026 18:46
@elitegreg elitegreg marked this pull request as ready for review January 16, 2026 19:02
@elitegreg elitegreg merged commit 1e1deeb into gm/device_activate Jan 16, 2026
1 of 2 checks passed
@elitegreg elitegreg deleted the copilot/sub-pr-2650 branch January 16, 2026 19:02
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.

2 participants