Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,49 @@ Closes #<!-- issue number -->

---

## Tests Added or Updated
## Test Evidence

<!-- Describe the tests that cover this change. Include file paths and test names where relevant.
Every logic change requires tests for the happy path and for failure/boundary conditions. -->
<!-- Provide clear evidence of testing for this change. Every logic change requires tests
for the happy path and for failure/boundary conditions. -->

### Tests added or updated

- [ ] Happy-path tests added/updated
- [ ] Failure and boundary-condition tests added/updated
- [ ] Test naming follows the convention in [`docs/testing.md`](docs/testing.md)
- [ ] [`docs/test-coverage.md`](docs/test-coverage.md) updated to reflect new or changed tests

### No-test justification

<!-- If no tests were added, explain why. Examples: documentation-only change,
refactor with no behaviour change, CI-only change. -->

- [ ] N/A — tests added (or)
- [ ] Justification provided below:

**Justification for no tests:**

### Contract-specific test examples

<!-- Review and reference existing contract test patterns relevant to this change.
Common test categories in this repo:

| Category | Example files |
|---|---|
| Balance & accounting invariants | `test/balance_conservation.rs`, `test/total_vault_balance.rs`, `test/property_vault_accounting.rs` |
| Lock operations | `test/lock_amount_validation.rs`, `test/lock_extension.rs`, `test/lock_maturity_boundary.rs`, `test/multi_lock_invariants.rs` |
| Authorization & isolation | `test/unauthorized_access.rs`, `test/cross_user_isolation.rs` |
| Edge cases & boundaries | `test/zero_duration_lock.rs`, `test/maximum_amount_boundary.rs`, `test/independent_lock_creation.rs` |
| Negative paths | `test/negative_paths.rs` |
| Event correctness | `test/event_schema.rs`, `test/event_compatibility.rs`, `test/event_ordering.rs` |
| Pause & admin | `test/pause.rs`, `test/pause_state_read.rs`, `test/pause_transition.rs`, `test/admin_rotation.rs` |
| Replay protection | `test/replay_protection.rs`, `test/lock_maturity_replay.rs` |
| Invariant checklist | `test/invariant_checklist_examples.rs` |

See [`docs/testing.md`](docs/testing.md) for the full testing guide. -->

- [ ] Existing contract test examples reviewed and relevant patterns referenced

---

## Security Considerations
Expand Down
7 changes: 6 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,16 @@ Every pull request must fill in the **[PR template](.github/PULL_REQUEST_TEMPLAT

- **Issue reference** — a `Closes #N` line linking to the issue being resolved.
- **Contract functions changed** — a table listing every function added, modified, or removed (write "none" for documentation-only PRs).
- **Tests added or updated** — names and file paths of new or changed tests, with checkboxes confirming happy-path, failure, and boundary coverage.
- **Test evidence** — a description of tests added or updated with file paths and test names, including:
- Happy-path, failure, and boundary-condition test coverage.
- Justification when no tests are added (documentation-only, refactor with no behaviour change, CI-only).
- Reference to existing contract test patterns relevant to the change (see `docs/testing.md` for test categories and examples).
- **Security considerations** — a plain-language description of security impact plus the per-section security checklist for any PR that touches contract logic (see `docs/security-checklist.md`).
- **Commands run** — confirmation that `make verify` passes (format, Clippy, workspace tests, and release WASM build), or equivalently that `cargo fmt --check`, `cargo clippy --tests -- -D warnings`, and `cargo test --workspace` all pass locally.
- **CI status** — all CI checks green before requesting review.

> **Test evidence requirement:** Every contract PR must provide clear testing evidence. Changes without tests must include a justification explaining why tests are not needed.

Additional guidance:

- Keep each pull request focused on one issue or related change.
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,14 @@ Every pull request must use the **[PR template](.github/PULL_REQUEST_TEMPLATE.md

- A reference to the issue being fixed (`Closes #N`)
- A list of contract functions added, modified, or removed
- A description of tests added or updated
- **Test evidence** — description of tests added, no-test justification, and references to existing contract test patterns
- A **[traceability table](docs/traceability-table.md)** mapping each acceptance criterion to changed functions, tests, and edge cases
- A security considerations section (with checklist for contract changes)
- Confirmation that `make verify` passes (or equivalently `cargo fmt --check`, `cargo clippy --tests -- -D warnings`, and `cargo test --workspace`)
- CI green before requesting review

> **Test evidence requirement:** Every contract PR must include clear testing evidence. Changes without tests require a justification. See the [PR template](.github/PULL_REQUEST_TEMPLATE.md) and [CONTRIBUTING.md](CONTRIBUTING.md#pull-request-expectations) for details.

Before asking about payment status on an issue or PR, read the **[Payment-Period Conduct Guidance](docs/payment-period-conduct.md)** — it explains how to self-review first and how this repository's review process relates to GrantFox's own evaluation process.

Quick start:
Expand Down