cord icon indicating copy to clipboard operation
cord copied to clipboard

network-score: Add tests for UnauthorizedOperation

Open Vaibhavsahu2810 opened this issue 9 months ago • 1 comments

Fixes #294

Description

This PR adds a test case to verify that rating revocations are properly authorized. The test ensures that a rating can only be revoked using the authorization ID that was used to create it, preventing unauthorized operations.

Implementation

  • Creates two spaces with different authorization IDs
  • Registers a rating using the first authorization ID
  • Attempts to revoke the rating using the second authorization ID
  • Verifies that the operation fails with an UnauthorizedOperation error

Testing

  • All new tests can be executed using cargo test -p pallet-asset
  • Test cases validate proper error handling

Below is the attached screenshot of the test case passing in the local environment:- Screenshot 2025-03-14 at 2 36 53 PM

Vaibhavsahu2810 avatar Mar 14 '25 09:03 Vaibhavsahu2810

Hello @vatsa287 , can you review this pr?

Vaibhavsahu2810 avatar Apr 20 '25 14:04 Vaibhavsahu2810