Skip to content

test(vault): min_deposit boundary coverage (#151)#220

Merged
greatest0fallt1me merged 5 commits intoCalloraOrg:mainfrom
Sam-Rytech:test/vault-min-deposit-boundary
Mar 31, 2026
Merged

test(vault): min_deposit boundary coverage (#151)#220
greatest0fallt1me merged 5 commits intoCalloraOrg:mainfrom
Sam-Rytech:test/vault-min-deposit-boundary

Conversation

@Sam-Rytech
Copy link
Copy Markdown
Contributor

Summary

Table-driven boundary tests for min_deposit enforcement in the Callora Vault contract.

Changes

  • contracts/vault/src/test.rs — 8 new tests covering:
    • Exact min_deposit amount → succeeds
    • One below min_deposit → panics with "deposit below minimum"
    • Above min_deposit → succeeds
    • Zero min_deposit (default) → allows any positive amount
    • min_deposit stored correctly in meta after init
    • Default min_deposit is 0 when not specified
    • One below a large min_deposit (1_000_000) → fails
    • Exact large min_deposit → succeeds

Test Output

120 passed; 0 failed

Security Notes

  • Panic messages expose actual vs required values (deposit below minimum: X < Y), aiding debuggability without leaking sensitive state.
  • Zero min_deposit is explicitly allowed per contract logic (min_d >= 0).

Closes #151

- Audited all privileged entrypoints in vault, revenue_pool, and settlement
- Added negative require_auth tests to each crate's test.rs
- Fixed pre-existing setup_contract missing third_party in settlement tests
- Documented intentional exceptions: settlement::init and vault::require_owner
- Updated SECURITY.md with audit findings and cross-references
- All 180 tests pass

Closes CalloraOrg#160
- Audited all privileged entrypoints in vault, revenue_pool, and settlement
- Added negative require_auth tests to each crate's test.rs
- Fixed pre-existing setup_contract missing third_party in settlement tests
- Documented intentional exceptions: settlement::init and vault::require_owner
- Updated SECURITY.md with audit findings and cross-references
- All 180 tests pass

Closes CalloraOrg#160
- Audited all privileged entrypoints in vault, revenue_pool, and settlement
- Added negative require_auth tests to each crate's test.rs
- Fixed pre-existing setup_contract missing third_party in settlement tests
- Documented intentional exceptions: settlement::init and vault::require_owner
- Updated SECURITY.md with audit findings and cross-references
- All 180 tests pass

Closes CalloraOrg#160
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 30, 2026

@Sam-Rytech 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

@greatest0fallt1me greatest0fallt1me merged commit 4264d16 into CalloraOrg:main Mar 31, 2026
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: min_deposit boundary tests (exact, below, zero-min if allowed)

2 participants