Description
The admin panel needs a quick count of escrow states without iterating all escrows. A simple stats view gives this in one call.
What to do
Confirm escrow_stats(e: Env) exists and returns { total_count, active_count, settled_count }. If missing or incomplete, implement it reading from DataKey::EscrowCount and the active escrow index.
Add a test: 3 created, 1 released, 1 refunded → { total: 3, active: 1, settled: 2 }.
Files touched
src/contract.rs
src/escrow_test.rs
PR requirement
Closes #[issue_id] — Timeframe: 24 hours
Description
The admin panel needs a quick count of escrow states without iterating all escrows. A simple stats view gives this in one call.
What to do
Confirm
escrow_stats(e: Env)exists and returns{ total_count, active_count, settled_count }. If missing or incomplete, implement it reading fromDataKey::EscrowCountand the active escrow index.Add a test: 3 created, 1 released, 1 refunded →
{ total: 3, active: 1, settled: 2 }.Files touched
src/contract.rssrc/escrow_test.rsPR requirement
Closes #[issue_id]— Timeframe: 24 hours