Skip to content

[CT-19] Write Access Control Test Suite (10+ tests) in Rust #1036

@devwums

Description

@devwums

Problem

The access_control contract functions have minimal test coverage. Role granting, revocation, and multi-role scenarios are entirely untested.

Proposed Solution

Create contracts/cntr/tests/access_control_tests.rs. Write at least 10 unit tests covering: grant role to new address, grant same role twice (idempotent — must not duplicate), grant two different roles to the same address, revoke existing role, revoke non-existent role (must not panic), check role for unknown address, get all roles for multi-role holder, has_role with empty registry. All implementation must live inside contracts/cntr/.

Acceptance Criteria

  • File at contracts/cntr/tests/access_control_tests.rs
  • At least 10 test functions with descriptive names
  • Idempotent grant is explicitly tested (same role granted twice does not appear twice in results)
  • Tests import and use role_checker.rs peer module
  • All tests pass with cargo test

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions