Skip to content

Sync ERROR_CODES catalogue with contract enums #1246

Description

@greatest0fallt1me

Summary

ERROR_CODES.md covers vault and some others, but lists vault variants that are never emitted (e.g. InitialBalanceExceedsOnLedger) and omits fee, refund, rescue, batch_claim and registry enums.

Why this matters

Clients map numeric codes to messages from this document; missing or phantom entries produce wrong error messages in the UI.

Scope

Generate the tables from each #[contracterror] enum (small script), mark unused codes as reserved, and add a CI diff check.

Relevant code in CalloraOrg/Callora-Contracts:

  • docs/ERROR_CODES.md
  • contracts/vault/src/errors.rs
  • contracts/settlement/src/errors.rs
  • contracts/refund/src/errors.rs

Priority

Low

Acceptance criteria

  • Every contract error enum represented
  • Unused variants marked reserved
  • CI fails when enums and doc diverge
  • Script used for generation is committed under scripts/

Validation

cargo test --workspace err_stab

Non-goals

  • Typo-only, formatting-only, or cosmetic changes.
  • Unrelated refactors, dependency upgrades, or broad rewrites.
  • Removing safeguards or weakening validation to make tests pass.

Contributor application

Before coding, describe the affected modules, proposed state/invariant changes, test strategy, compatibility considerations, and an estimate. Wait for assignment before starting implementation.

PR requirements

Use a feature branch and include Closes #<issue-number>. Address every criterion, map criteria to code and tests, explain security and failure-mode handling, and ensure CI passes.

Quality review

A maintainer will assess correctness, completeness, test depth, compatibility, observability, and adverse-case handling. A substantive implementation is required; merge or CI status alone does not guarantee reward eligibility.


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveStellar Wave Program issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions