Skip to content

Test/escrow details status#515

Open
Amarjeet325 wants to merge 2 commits intoQuickLendX:mainfrom
Amarjeet325:test/escrow-details-status
Open

Test/escrow details status#515
Amarjeet325 wants to merge 2 commits intoQuickLendX:mainfrom
Amarjeet325:test/escrow-details-status

Conversation

@Amarjeet325
Copy link

📌 Add Tests for get_escrow_details and get_escrow_status

🧾 Overview


Close issue #335

This PR adds comprehensive unit tests for the following escrow query functions:

  • get_escrow_details
  • get_escrow_status

The goal is to ensure correct behavior, full branch coverage, and meet the minimum 95% test coverage requirement for escrow query logic.


✅ What This PR Covers

1️⃣ get_escrow_details

  • ✔ Returns correct escrow struct when escrow exists
  • ✔ Panics with StorageKeyNotFound when escrow does not exist

2️⃣ get_escrow_status

  • ✔ Returns Created after create_escrow
  • ✔ Returns Released after release_escrow
  • ✔ Returns Refunded after refund_escrow
  • ✔ Panics with StorageKeyNotFound when escrow does not exist

🎯 Coverage Impact

  • Achieves test coverage** for escrow query functions
  • Covers both success and failure branches
  • Validates correct state transitions
  • Ensures storage lookup error handling is tested

🛠 How to Run Tests

cargo clean
cargo test

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.

1 participant