Skip to content

feat(escrow): introduce typed contracterror codes#291

Merged
mikewheeleer merged 1 commit into
Liquifact:mainfrom
Edoscoba:enhancement/typed-errors
May 28, 2026
Merged

feat(escrow): introduce typed contracterror codes#291
mikewheeleer merged 1 commit into
Liquifact:mainfrom
Edoscoba:enhancement/typed-errors

Conversation

@Edoscoba
Copy link
Copy Markdown
Contributor

@Edoscoba Edoscoba commented May 27, 2026

summary

Adds a typed EscrowError #[contracterror] enum for LiquiFact escrow failures, replacing ad-hoc string assert! / panic! paths with stable numeric contract error codes clients can branch on.

Changes include:

  • Converted funding, settlement, withdrawal, claim, init, dust sweep, attestation, refund, admin, cap, and token-transfer failures to typed errors.
  • Added exact try_* tests for representative ContractError(code) paths.
  • Updated docs/escrow-error-messages.md with the canonical append-only error code table.
  • Preserved auth boundaries, checked arithmetic, refund double-spend protection, claim idempotency, and token balance-delta safety checks.

Validation:

  • cargo fmt -p liquifact_escrow -- --check
  • cargo clippy -p liquifact_escrow -- -D warnings
  • cargo test: 371 passed; 0 failed; 14 ignored
  • cargo build --target wasm32v1-none --release -p liquifact_escrow
  • Coverage: 96.43% line coverage with cargo llvm-cov

close #252

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

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

@mikewheeleer mikewheeleer merged commit f30b464 into Liquifact:main May 28, 2026
1 check 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.

Replace ad-hoc assert!/panic! messages with a typed contracterror enum

2 participants