Skip to content

feat: role management API & integration tests#131

Merged
MicBun merged 4 commits intomainfrom
chore/role-tests
Jun 11, 2025
Merged

feat: role management API & integration tests#131
MicBun merged 4 commits intomainfrom
chore/role-tests

Conversation

@outerlook
Copy link
Copy Markdown
Contributor

@outerlook outerlook commented Jun 11, 2025

Description

  • Add AreMembersOf and ListRoleMembers contract calls, input/output structs, and interface updates.
  • Introduce EthereumAddressesToStrings helper for safe slice conversion.
  • Extend docs (docs/stream-permissions.md) with missing ListRoleMembers bullet.
  • Refactor integration tests to use role-gated stream deployment and new wallet handling.
  • Add new role_management_test.go covering grant / revoke / membership checks and permission gates.

Related Problem

How Has This Been Tested?

  • New test asserts:
    • grant → membership true
    • revoke → membership false
    • stream deployment allowed / denied accordingly.
  • Existing test suites remain green.

- Updated GrantRole and RevokeRole methods to utilize EthereumAddresses for better type safety.
- Introduced AreMembersOf and ListRoleMembers methods for checking role membership and listing members with pagination.
- Added EthereumAddressesToStrings utility function for converting EthereumAddress slices to string representations.
- Updated documentation to reflect the new method names and functionalities.
- Introduced a new integration test for verifying the granting and revoking of the `system:network_writer` role.
- Enhanced the ServerFixture to manage private keys for the manager and database owner.
- Updated utility functions to improve transaction handling and assertions.
- Refactored existing test code for better type safety and clarity.
…lient creation

- Refactored integration tests to include the use of `kwilcrypto` for wallet management.
- Updated client creation logic to ensure proper context handling and error checking.
- Enhanced test setup by authorizing wallets for stream deployment across multiple test files.
- Adjusted loop conditions in batch operations tests for inclusive iteration.
- Improved overall type safety and clarity in test implementations.
@outerlook outerlook self-assigned this Jun 11, 2025
@outerlook outerlook marked this pull request as ready for review June 11, 2025 16:02
@outerlook outerlook changed the title chore: node management integration tests & missing methods feat: role management API & integration tests Jun 11, 2025
- Introduced the `IRoleManagement.ListRoleMembers` method to list current members of a role with optional pagination.
- Enhanced integration tests to verify the functionality of the new `ListRoleMembers` method, ensuring correct membership assertions after granting and revoking roles.
- Improved type safety and clarity in test implementations related to role management.
@outerlook outerlook requested a review from MicBun June 11, 2025 16:05
@holdex
Copy link
Copy Markdown

holdex bot commented Jun 11, 2025

Time Submission Status

Member Status Time Action Last Update
@outerlook ❌ Missing - ⚠️ Submit time -
MicBun ✅ Submitted 15min Update time Jun 12, 2025, 12:09 AM

@MicBun MicBun merged commit e760d3b into main Jun 11, 2025
1 of 2 checks passed
@MicBun MicBun deleted the chore/role-tests branch June 11, 2025 16:08
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.

Problem: Cannot check if certain wallet can create streams Problem: No integration tests for role management functionality

2 participants