Skip to content

Add authorization rejection tests for harvest_yield and emergency_pause #18

Description

@Code-Paragon

Problem

While harvest_yield and emergency_pause use require_auth(), the test suite never explicitly verifies that an unauthorized actor calling these functions is successfully rejected by the environment.

Expected behavior

The test suite utilizes the env.mock_auths or expected panic attributes to simulate a random user calling admin/keeper functions, verifying the transaction reverts.

Files to update

  • src/test.rs

Project relevance

Cryptographically guarantees the Vault's access control modifiers are functioning correctly, preventing malicious LPs from pausing the contract or spoofing yields.

Acceptance criteria

  • Feature works as described
  • Tests are added or updated where needed
  • Documentation is updated where needed
  • Test asserts failure when a non-admin Address attempts to invoke emergency_pause
  • No TypeScript, lint, test, or build errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions