Skip to content

[#754] Contracts: Add canonical error namespace for all revert and panic conditions#878

Merged
Junirezz merged 2 commits into
Junirezz:mainfrom
esthertitilayo-dev:fix/754-contracts-add-canonical-error-namespace-for-all-revert-and-panic-conditions
Jun 29, 2026
Merged

[#754] Contracts: Add canonical error namespace for all revert and panic conditions#878
Junirezz merged 2 commits into
Junirezz:mainfrom
esthertitilayo-dev:fix/754-contracts-add-canonical-error-namespace-for-all-revert-and-panic-conditions

Conversation

@esthertitilayo-dev

Copy link
Copy Markdown
Contributor

Summary

  • Add contracts/vault/src/errors.rs as the canonical VaultError namespace (stable codes 1–49)
  • Replace user-facing panic! paths in lib.rs with Result<_, VaultError> reverts
  • Update contract tests to use try_* + expected error codes; expand docs/api/ERROR_CODE_CATALOG.md

Closes #754

Test plan

  • cargo test -p vault passes in CI
  • Contract build (cargo build -p vault --target wasm32-unknown-unknown) succeeds
  • ERROR_CODE_CATALOG matches errors.rs enum variants

Introduce contracts/vault/src/errors.rs as the single VaultError source,
replace user-facing panics with structured reverts in lib.rs, update tests
and ERROR_CODE_CATALOG.md. Closes Junirezz#754.
@esthertitilayo-dev esthertitilayo-dev force-pushed the fix/754-contracts-add-canonical-error-namespace-for-all-revert-and-panic-conditions branch from 97e9a33 to d6c3932 Compare June 29, 2026 15:56
@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@esthertitilayo-dev 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

@esthertitilayo-dev esthertitilayo-dev force-pushed the fix/754-contracts-add-canonical-error-namespace-for-all-revert-and-panic-conditions branch from cd9a498 to 210e5d0 Compare June 29, 2026 16:45
@Junirezz Junirezz merged commit 06148bf into Junirezz:main Jun 29, 2026
11 of 15 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: Add canonical error namespace for all revert and panic conditions

2 participants