feat: Implement merchant escrow receipt functionality with tests#270
feat: Implement merchant escrow receipt functionality with tests#270steph-crown wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughAdds a new ChangesMerchantEscrowReceipt getter and test coverage
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
contracts/escrow/src/integration_tests.rs (1)
564-576: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a timed-out funded case for
release_eligible.This suite only proves
release_eligible = falseafter status transitions. The new getter also returnsfalsefor escrows that are stillFundedoncetimeout_ledgeris reached, so the timeout branch behindrelease_block_reason(...)is still untested.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@contracts/escrow/src/integration_tests.rs` around lines 564 - 576, The funded receipt test does not cover the timeout-driven false case for release eligibility. Update test_merchant_escrow_receipt_funded in integration_tests.rs to advance the ledger/time past timeout_ledger before calling EscrowContractClient::get_merchant_escrow_receipt, then assert that receipt.status remains EscrowStatus::Funded while receipt.release_eligible becomes false. This should exercise the release_block_reason timeout branch without changing the existing status-transition coverage.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@contracts/escrow/src/integration_tests.rs`:
- Around line 564-576: The funded receipt test does not cover the timeout-driven
false case for release eligibility. Update test_merchant_escrow_receipt_funded
in integration_tests.rs to advance the ledger/time past timeout_ledger before
calling EscrowContractClient::get_merchant_escrow_receipt, then assert that
receipt.status remains EscrowStatus::Funded while receipt.release_eligible
becomes false. This should exercise the release_block_reason timeout branch
without changing the existing status-transition coverage.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 5aa2a3d2-7fb0-4163-8f64-af41a0848776
📒 Files selected for processing (19)
contracts/escrow/src/integration_tests.rscontracts/escrow/src/lib.rscontracts/escrow/test_snapshots/integration_tests/test_merchant_escrow_receipt_disputed.1.jsoncontracts/escrow/test_snapshots/integration_tests/test_merchant_escrow_receipt_funded.1.jsoncontracts/escrow/test_snapshots/integration_tests/test_merchant_escrow_receipt_not_found.1.jsoncontracts/escrow/test_snapshots/integration_tests/test_merchant_escrow_receipt_refunded.1.jsoncontracts/escrow/test_snapshots/integration_tests/test_merchant_escrow_receipt_released.1.jsoncontracts/escrow/test_snapshots/integration_tests/test_refund_eligibility_admin_always_eligible.1.jsoncontracts/escrow/test_snapshots/integration_tests/test_refund_eligibility_already_refunded.1.jsoncontracts/escrow/test_snapshots/integration_tests/test_refund_eligibility_already_released.1.jsoncontracts/escrow/test_snapshots/integration_tests/test_refund_eligibility_buyer_after_timeout.1.jsoncontracts/escrow/test_snapshots/integration_tests/test_refund_eligibility_buyer_before_timeout.1.jsoncontracts/escrow/test_snapshots/integration_tests/test_refund_eligibility_disputed.1.jsoncontracts/escrow/test_snapshots/integration_tests/test_refund_eligibility_not_found.1.jsoncontracts/escrow/test_snapshots/integration_tests/test_refund_eligibility_seller_always_eligible.1.jsoncontracts/escrow/test_snapshots/integration_tests/test_refund_eligibility_unauthorized_stranger.1.jsoncontracts/escrow/test_snapshots/test/test/test_get_token_not_found.1.jsoncontracts/escrow/test_snapshots/test/test/test_set_create_paused_success.1.jsoncontracts/escrow/test_snapshots/test/test/test_set_create_paused_unauthorized.1.json
|
@steph-crown 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! 🚀 |
|
Please resolve conflicts |
Summary by CodeRabbit
New Features
Tests
Resolves #171