Skip to content

feat(escrow): validate config bounds and reject unconfigured deposits (Closes #179) - #244

Merged
k-deejah merged 1 commit into
Stellar-Deejah:mainfrom
stayzappy:fix/issue-179-escrow-config-validation
Sep 3, 2026
Merged

feat(escrow): validate config bounds and reject unconfigured deposits (Closes #179)#244
k-deejah merged 1 commit into
Stellar-Deejah:mainfrom
stayzappy:fix/issue-179-escrow-config-validation

Conversation

@stayzappy

@stayzappy stayzappy commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Closes #179

Summary of Changes (Closes #179)

1. Config Bounds Validation

  • Updated set_config in contracts/lineproof-escrow/src/lib.rs to enforce config.min_deposit <= config.max_deposit (panics with "min_deposit_exceeds_max").
  • Enforced config.hold_period_days > 0 (panics with "hold_period_must_be_positive").

2. Explicit Escrow Initialization Guard

  • Removed implicit self-admin default fallback in deposit(). Calling deposit() on an uninitialized queue escrow now explicitly panics with "escrow_not_configured".

3. Test Suite

  • Added comprehensive unit tests in contracts/lineproof-escrow/src/test.rs covering:
    • set_config validation of min_deposit > max_deposit
    • set_config validation of hold_period_days == 0
    • deposit rejection when escrow is not configured
    • Positive hold period and ledger timestamp advancement for expiration tests.

Verification

  • Ran cargo test -p lineproof-escrow: 18 passed, 0 failed.
  • Ran all contracts tests in workspace (cargo test): 93 passed, 0 failed.

@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

@stayzappy is attempting to deploy a commit to the Deejah Team on Vercel.

A member of the Team first needs to authorize it.

@stayzappy
stayzappy force-pushed the fix/issue-179-escrow-config-validation branch from 7417108 to 84ab92c Compare August 31, 2026 17:42
@k-deejah
k-deejah merged commit c833424 into Stellar-Deejah:main Sep 3, 2026
11 of 19 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.

Contracts: EscrowConfig allows min_deposit > max_deposit and hold_period_days = 0 — no validation in set_config()

2 participants