📌 Description
README_CANCEL_VAULT.md still describes cancel_vault as refunding a simulated
per-vault balance stored under ("vault_balance", vault_id), but the current
src/lib.rs performs a real Soroban token::Client::transfer from the
contract back to the creator. The tests should assert the real on-ledger refund,
and the doc should be corrected to match.
Goal: add tests asserting cancel_vault credits the creator by exactly
vault.amount and zeroes the contract's escrow, and update the cancel doc.
🎯 Requirements and Context
- Must be deterministic and isolated.
- Assert creator balance increases by
vault.amount and contract balance returns
to its pre-create value.
- Confirm the
vault_cancelled event is emitted.
- Confirm cancel is rejected on non-
Active vaults (Error::VaultNotActive).
🛠️ Suggested Execution
1. Fork the repo and create a branch
git checkout -b feature/cancel-vault-refund-tests
2. Implement changes
- Tests: extend
tests/lifecycle.rs with refund balance-delta assertions using
TokenClient::balance.
- Docs: rewrite
README_CANCEL_VAULT.md to describe the real token transfer
(remove the "simulated balance" language) and add a docs/CANCEL.md if helpful.
3. Test and commit
- Run
cargo test and regenerate coverage.
- Cover edge cases: cancel right after create, cancel on completed/failed/cancelled
(reject), non-creator cancel (reject), double cancel (reject).
Example commit message
test+docs: real-transfer refund coverage for cancel_vault
✅ Guidelines
- Minimum 95% test coverage on
cancel_vault lines.
- Clear, corrected documentation in
README_CANCEL_VAULT.md.
- All tests deterministic and passing.
- Timeframe: 96 hours.
🏷️ Labels
type-testing · area-contracts · type-documentation · MAYBE REWARDED ·
GRANTFOX OSS · OFFICIAL CAMPAIGN
💬 Community & Support
- Join the Disciplr contributor Discord to coordinate, ask questions, and get
unblocked fast: https://discord.gg/xvNAvMJf
- Please introduce yourself before you start so we can avoid duplicate work,
pair you with a reviewer, and merge your PR quickly.
📌 Description
README_CANCEL_VAULT.mdstill describescancel_vaultas refunding a simulatedper-vault balance stored under
("vault_balance", vault_id), but the currentsrc/lib.rsperforms a real Sorobantoken::Client::transferfrom thecontract back to the creator. The tests should assert the real on-ledger refund,
and the doc should be corrected to match.
🎯 Requirements and Context
vault.amountand contract balance returnsto its pre-create value.
vault_cancelledevent is emitted.Activevaults (Error::VaultNotActive).🛠️ Suggested Execution
1. Fork the repo and create a branch
2. Implement changes
tests/lifecycle.rswith refund balance-delta assertions usingTokenClient::balance.README_CANCEL_VAULT.mdto describe the real token transfer(remove the "simulated balance" language) and add a
docs/CANCEL.mdif helpful.3. Test and commit
cargo testand regenerate coverage.(reject), non-creator cancel (reject), double cancel (reject).
Example commit message
✅ Guidelines
cancel_vaultlines.README_CANCEL_VAULT.md.🏷️ Labels
type-testing·area-contracts·type-documentation·MAYBE REWARDED·GRANTFOX OSS·OFFICIAL CAMPAIGN💬 Community & Support
unblocked fast: https://discord.gg/xvNAvMJf
pair you with a reviewer, and merge your PR quickly.