Skip to content

smartcontract: preserve case for location codes#3080

Merged
martinsander00 merged 3 commits intomainfrom
ms/2717
Mar 5, 2026
Merged

smartcontract: preserve case for location codes#3080
martinsander00 merged 3 commits intomainfrom
ms/2717

Conversation

@martinsander00
Copy link
Contributor

@martinsander00 martinsander00 commented Feb 23, 2026

Resolves: #2717

Summary

  • Fix validate_account_code unintentionally forcing lowercase on all entity types, including locations whose codes have historically been uppercase in mainnet-beta
  • Revert validate_account_code to its original case-preserving behavior (pre-refactor: enforce lowercase for dzd and link naming #2383) and apply make_ascii_lowercase() inline at device and link call sites only

Testing Verification

  • Unit tests verify validate_account_code preserves case
  • All existing tests across doublezero-program-common, doublezero-serviceability, doublezero_sdk, and doublezero_cli pass

Copy link
Contributor

@juan-malbeclabs juan-malbeclabs left a comment

Choose a reason for hiding this comment

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

Please add a unit test to verify that device searches are case-insensitive and that the SDK at least attempts to prevent duplicate entries.

Use uppercase codes in existing tests to verify that locations, exchanges,
and contributors preserve case, while devices and links are lowercased.
@martinsander00 martinsander00 merged commit 749c15a into main Mar 5, 2026
30 checks passed
@martinsander00 martinsander00 deleted the ms/2717 branch March 5, 2026 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli forces new locations to be lowercase

2 participants