Skip to content

[feat] Tests for AllowedSessionsValidator#457

Merged
ly0va merged 31 commits intomatter-labs:mainfrom
GoldenSylph:main
Jul 11, 2025
Merged

[feat] Tests for AllowedSessionsValidator#457
ly0va merged 31 commits intomatter-labs:mainfrom
GoldenSylph:main

Conversation

@GoldenSylph
Copy link
Contributor

@GoldenSylph GoldenSylph commented Jul 8, 2025

This pull request introduces comprehensive tests for the AllowedSessionsValidator module and updates utility functions to support the new contract. Key changes include the addition of test cases for session validation logic and the integration of AllowedSessionsValidator into the contract fixtures.

Tests for AllowedSessionsValidator:

  • test/AllowedSessionsValidatorTest.ts: Added detailed test cases to validate session actions, including hash generation (both on-chain and off-chain), allowing/disallowing session actions, and handling multiple policies. Tests also cover edge cases like rejecting sessions not explicitly allowed and invalidating previously valid sessions.

Updates to utility functions:

  • test/utils.ts:
    • Added AllowedSessionsValidator and AllowedSessionsValidator__factory to imports. [1] [2]
    • Introduced methods getAllowedSessionsContract and getAllowedSessionsContractAddress in ContractFixtures to deploy and retrieve the AllowedSessionsValidator contract.

@jcsec-security
Copy link
Collaborator

Additional "unhappy" path testcases requested

@ly0va ly0va merged commit 2921681 into matter-labs:main Jul 11, 2025
4 checks 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.

3 participants