Skip to content

Add reward claim tests and update TODO - #128

Merged
Abd-Standard merged 1 commit into
Core-Foundry:mainfrom
Achievers-sketch:main
Jul 28, 2026
Merged

Add reward claim tests and update TODO#128
Abd-Standard merged 1 commit into
Core-Foundry:mainfrom
Achievers-sketch:main

Conversation

@Achievers-sketch

Copy link
Copy Markdown
Contributor

Add unit tests covering reward claim scenarios: test_successful_reward_claim (validates escrow, payout, and final balances/statuses), test_double_claim_prevention (expects Contract Error #6 on second approval), test_unauthorized_claim_rejection (expects Contract Error #3 for non-poster approval), and test_contract_balance_validation (verifies escrow, payout, and cancel refund behavior). Update TODO.md to replace the previous deployment task with a checklist for implementing and running these tests.

What

Why

Closes #30

How

Testing

Breaking Changes


Checklist

General

  • Branch is up to date with main
  • PR title follows Conventional Commits format (e.g. feat: add reputation system)
  • PR description is complete with issue reference (Closes #<issue-number>)
  • One logical change per PR (no unrelated changes bundled in)

Testing

  • Tests added or updated to cover the changes
  • All tests pass (cargo test for contracts, npm run build for frontend)
  • No compiler warnings (cargo clippy -- -D warnings)

Documentation

  • Public API changes are documented with /// doc comments (Rust) or JSDoc (TypeScript)
  • CONTRIBUTING.md, README.md, or other docs updated if needed
  • CONTRACT_API.md updated if contract interface changed

Code Quality

  • Code follows the project style (cargo fmt / ESLint)
  • No any types introduced in TypeScript
  • No hardcoded secrets, keys, or environment-specific values

Smart Contract (if applicable)

  • require_auth() called on all state-changing operations
  • Events emitted for all state changes
  • Storage keys don't collide with existing keys
  • Deadline and input validation is complete
  • No unintended token transfer paths introduced

Frontend (if applicable)

  • Components are under 150 lines
  • UI is responsive and accessible
  • Screenshots or recordings included for visual changes

Add unit tests covering reward claim scenarios: test_successful_reward_claim (validates escrow, payout, and final balances/statuses), test_double_claim_prevention (expects Contract Error Core-Foundry#6 on second approval), test_unauthorized_claim_rejection (expects Contract Error Core-Foundry#3 for non-poster approval), and test_contract_balance_validation (verifies escrow, payout, and cancel refund behavior). Update TODO.md to replace the previous deployment task with a checklist for implementing and running these tests.
@Abd-Standard
Abd-Standard merged commit 5af7709 into Core-Foundry:main Jul 28, 2026
2 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.

test: cover reward claim scenarios with automated tests

2 participants