Skip to content

test(BeraChef): implement TODO fuzz and invariant tests for reward allocation #27

@sailorpepe

Description

@sailorpepe

Summary

BeraChef.t.sol has explicit TODOs for missing fuzz and invariant tests:

  • Line 506: // TODO: Fuzz test — empty testFuzz_QueueANewRewardAllocation
  • Line 509: // TODO: Invariant test — commented-out invariant test
  • Line 352: Misleading TODO comment on test_FallbackToDefaultRAWhenLoweringMaxWeightPerVault

Additionally, Staking.t.sol has 3 vague // TODO: total supply is limited by PRECISION comments (lines 131, 149, 165) that don't explain the actual constraint.

Proposal

  1. Implement testFuzz_QueueANewRewardAllocation — generates random valid weight distributions across 1-2 vaults, queues them, and verifies stored state
  2. Add testFuzz_QueueActivateRewardAllocation_Invariants — exercises the full queue→activate→verify lifecycle with invariant checks
  3. Fix the misleading TODO comment
  4. Replace vague PRECISION TODOs with precise explanations of the rewardPerToken truncation boundary

I have a PR ready.

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