Skip to content

Refactor tests to use per-call vm.prank() for consistency #187

@coderabbitai

Description

@coderabbitai

Context

Several test files in the codebase use a mix of prank patterns:

  • Some tests use vm.startPrank(relayer) / vm.stopPrank() blocks
  • Other structurally similar tests use per-call vm.prank(relayer) before each interaction

For consistency and clarity, we should standardize on the per-call pattern throughout the test suite. Per-call pranks make it explicit which exact calls are executed under which identity, improving test readability and reducing the risk of unintended side effects from lingering prank contexts.

Example

In test/mainnet-fork/Farm.t.sol, the test_withdrawFromFarm_rateLimitsBoundary test uses a prank block, while the structurally similar test_depositToFarm_rateLimitsBoundary uses per-call pranks.

Scope

Review all test files and refactor prank blocks to per-call pranks where appropriate for consistency.

References

Metadata

Metadata

Assignees

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