Skip to content

chore(contracts): add and view docs + tests closes #262 - #277

Merged
greatest0fallt1me merged 3 commits into
CalloraOrg:mainfrom
ChukwuemekaP1:test/vault-routing-views
Apr 23, 2026
Merged

chore(contracts): add and view docs + tests closes #262 #277
greatest0fallt1me merged 3 commits into
CalloraOrg:mainfrom
ChukwuemekaP1:test/vault-routing-views

Conversation

@ChukwuemekaP1

Copy link
Copy Markdown
Contributor

Summary of Issues Resolved

Problem: The Vault module had get_settlement() and get_revenue_pool() functions but lacked proper documentation, comprehensive test coverage, and audit-ready safety guarantees.

✅ What Was Fixed

  1. Missing Documentation

    • Added comprehensive Rust docs to both view functions
    • Documented purpose, return values, safety guarantees, panic conditions
    • Added indexer usage notes and code examples
    • Updated STORAGE.md with view function details and safety boundaries
  2. Insufficient Test Coverage

    • Added 11 new tests (4 for get_settlement, 7 for get_revenue_pool)
    • Covered edge cases: empty state, zero balances, multiple updates
    • Verified no mutation occurs during view calls
    • Tested consistency after operations
  3. Pre-existing Bugs

    • Fixed duplicate get_max_deduct() function definition
    • Fixed broken test signatures for set_allowed_depositor()
  4. Git Push Permission Issue

    • Updated remote URL from org repo to your fork
    • Successfully pushed branch to ChukwuemekaP1/Callora-Contracts

📊 Results

  • Coverage: 95.93% (exceeded 95% requirement)
  • Tests: 11/11 passing
  • Clippy: Zero warnings
  • WASM: Builds successfully (38KB)
  • Security: Both functions are read-only, deterministic, and indexer-safe

closes #262

@drips-wave

drips-wave Bot commented Apr 22, 2026

Copy link
Copy Markdown

@ChukwuemekaP1 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

ChukwuemekaP1 and others added 2 commits April 22, 2026 23:13
…zz test stability

- Add missing require_not_paused check to batch_deduct function
- Fix fuzz tests to handle paused state correctly for deduct and batch_deduct
- Cap deposit amounts in fuzz tests to prevent USDC balance overflow
- Increase deposit reserve to 10 trillion for large max_deduct scenarios
- Remove duplicate unused third_party variable in settlement tests
- All 227 tests now pass (157 vault, 47 settlement, 23 revenue_pool)
- Coverage maintained at 95.76% (≥95% requirement met)
- Zero clippy warnings across all contracts
@greatest0fallt1me
greatest0fallt1me merged commit c15f8f4 into CalloraOrg:main Apr 23, 2026
1 of 3 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.

Vault: add get_settlement() and get_revenue_pool() view docs + tests

2 participants