Skip to content

fix(access-control): replace all registration/auth panics with typed …#204

Merged
Emeka000 merged 1 commit intoHealthy-Stellar:mainfrom
Mozez155:fix/167-access-control-edge-case-typed-errors
Mar 30, 2026
Merged

fix(access-control): replace all registration/auth panics with typed …#204
Emeka000 merged 1 commit intoHealthy-Stellar:mainfrom
Mozez155:fix/167-access-control-edge-case-typed-errors

Conversation

@Mozez155
Copy link
Copy Markdown

…ContractError

Closes #167

  • Expand ContractError with: AlreadyInitialized, EntityAlreadyRegistered, GrantorNotRegistered, GranteeNotRegistered, AccessAlreadyGranted, NotAuthorizedToRevoke, AccessPermissionNotFound, ContractNotInitialized, OnlyAdminCanDeactivate, EntityNotFound
  • Convert initialize, register_entity, grant_access, revoke_access, get_entity, update_entity, deactivate_entity to return Result<_, ContractError>
  • Replace all should_panic tests with try_* assertions on exact error variants
  • Add new tests: grantor_not_registered, grantee_not_registered, access_already_granted, permission_not_found, not_authorized_to_revoke

…ContractError

Closes Healthy-Stellar#167

- Expand ContractError with: AlreadyInitialized, EntityAlreadyRegistered,
  GrantorNotRegistered, GranteeNotRegistered, AccessAlreadyGranted,
  NotAuthorizedToRevoke, AccessPermissionNotFound, ContractNotInitialized,
  OnlyAdminCanDeactivate, EntityNotFound
- Convert initialize, register_entity, grant_access, revoke_access,
  get_entity, update_entity, deactivate_entity to return Result<_, ContractError>
- Replace all should_panic tests with try_* assertions on exact error variants
- Add new tests: grantor_not_registered, grantee_not_registered,
  access_already_granted, permission_not_found, not_authorized_to_revoke
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 30, 2026

@Mozez155 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Emeka000 Emeka000 merged commit 0a81279 into Healthy-Stellar:main Mar 30, 2026
1 check passed
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.

Replace panic-based duplicate and authorization failures in access-control

2 participants