Skip to content

test: add should_panic regressions for escrow error paths#451

Merged
Junman140 merged 1 commit into
Pi-Defi-world:devfrom
Abolax123:fix/issue-398-should-panic-tests
Jun 29, 2026
Merged

test: add should_panic regressions for escrow error paths#451
Junman140 merged 1 commit into
Pi-Defi-world:devfrom
Abolax123:fix/issue-398-should-panic-tests

Conversation

@Abolax123

@Abolax123 Abolax123 commented Jun 27, 2026

Copy link
Copy Markdown

Summary

  • add explicit #[should_panic] regression tests for escrow error conditions
  • cover invalid amount, self-escrow, and missing escrow release paths

Why

This addresses issue #398 by ensuring error conditions are exercised directly rather than only validating the success path.

Changes

  • added panic-based tests for zero-amount escrow creation
  • added panic-based tests for self-escrow creation
  • added panic-based tests for releasing a missing escrow

Testing

Summary by CodeRabbit

  • Tests
    • Added edge-case coverage for escrow actions to verify expected errors when creating an escrow with a zero amount, attempting self-escrow, or releasing a non-existent escrow.

@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@Abolax123 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4d4cd86e-31bf-47cd-a7bb-a8d28ea5ae91

📥 Commits

Reviewing files that changed from the base of the PR and between 4cdb675 and 7c076ac.

📒 Files selected for processing (1)
  • acbu_escrow/tests/test_edge_cases.rs

📝 Walkthrough

Walkthrough

Adds panic-based edge-case tests for escrow creation and release, covering zero-amount creation, self-escrow creation, and release of a missing escrow.

Changes

Escrow edge-case coverage

Layer / File(s) Summary
Panic error assertions
acbu_escrow/tests/test_edge_cases.rs
Adds three tests that invoke client.create and client.release directly and assert contract panic codes for zero amount, payer-equals-payee, and missing escrow release.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

Poem

I hopped through the escrow meadow bright,
and sniffed out errors in the light.
Zero, self, and missing too—
thump! the tests now tell us true.
🐰

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the added panic-based regression tests for escrow error paths.
Linked Issues check ✅ Passed The new tests cover the requested failure cases by asserting panic paths for zero amount, self-escrow, and missing escrow releases.
Out of Scope Changes check ✅ Passed The changes stay within test coverage for escrow error paths and do not introduce unrelated code changes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Junman140 Junman140 merged commit 744e44a into Pi-Defi-world:dev Jun 29, 2026
1 of 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.

No #[should_panic] tests for error conditions

2 participants