Skip to content

Give ChallengeManager and ReputationAnchor their own test files - #18

Open
sharmis-tp wants to merge 1 commit into
mergit-io:mainfrom
sharmis-tp:refactor/split-test-files-11
Open

sharmis-tp wants to merge 1 commit into
mergit-io:mainfrom
sharmis-tp:refactor/split-test-files-11

Conversation

@sharmis-tp

Copy link
Copy Markdown

Summary

Closes #11. Extracts shared setup into StakeBase, moves ChallengeManager and ReputationAnchor tests into dedicated files.

  • test/StakeBase.t.sol — abstract base with full wiring and helpers (lock, commit, verdict, available)
  • test/Stake.t.sol — StakeVault tests only, inherits StakeBase
  • test/ChallengeManager.t.sol — all challenge tests, inherits StakeBase
  • test/ReputationAnchor.t.sol — all anchor tests plus new coverage:
    • test_outcomeRecordedEmitsAllFields — asserts every OutcomeRecorded event field
    • test_sameTaskRecordedUnderBothSources — records the same task under source 0 (audit) and source 1 (ruling)
    • test_duplicateUnderSameSourceReverts — confirms duplicate guard per source

No contract changes. Test count increases by 3.

Test plan

  • forge test count >= original (was 27, now 30)
  • No test lost — every original test name is present in one of the three files

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.

Give ChallengeManager and ReputationAnchor their own test files

1 participant