Repository navigation
fix: sync ERROR_CODES catalogue with contract enums - #1309
AkpakaProsper wants to merge 4 commits into
Conversation
|
@AkpakaProsper 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! 🚀 |
|
Thanks for the contribution! We reviewed this PR while merging the open queue and couldn't merge it yet. Here's what needs fixing:
This branch also has merge conflicts with |
…ue-with-contract-enums Resolves merge conflicts against CalloraOrg/Callora-Contracts@2730f2d (90 commit(s) behind) so the PR is mergeable.
- scripts/gen_error_codes.py: fix syntax errors (pathlib import, regex groups,
duplicate/broken parse_errors_file, rstrip) so the generator runs.
- contracts/fee/src/errors.rs: restore the /// prefix on the uncommented doc line
so the crate compiles, and fix the "noints" typo.
- contracts/settlement/src/errors.rs, contracts/batch_claim/src/errors.rs: restore
CrossTenantBatch/BatchEmpty (still emitted; renaming broke callers).
- .github/workflows/ci.yml: repair mangled ${{ }} expressions and the column-0
lines, and wire the error-codes job to scripts/gen_error_codes.py --check.
- docs/ERROR_CODES.md: regenerated from the fixed generator.
|
@greatest0fallt1me Thanks for the review — all three points are fixed, conflicts are resolved, and the fixes are pushed to this branch.
No conflicts remain against |
|
@greatest0fallt1me regenerated The catalogue had drifted: the Fee Verification (local, real toolchain):
The other review points are also addressed at head: the |
Overview
This PR syncs
docs/ERROR_CODES.mdwith the actual#[contracterror]enums across the workspace. Previously the catalogue listed vault variants that are never emitted (e.g.InitialBalanceExceedsOnLedger) and omitted the fee, refund, rescue, batch_claim and registry enums, causing clients to render wrong error messages. A generator script now produces the tables from the enums, unused variants are marked reserved, and CI fails when the doc and enums diverge.Related Issue
Changes
🧾 Error Catalogue Generation
[ADD]
scripts/gen_error_codes.py#[contracterror]enum and emits thedocs/ERROR_CODES.mdtables (code, name, message, reserved flag).reservedso clients can skip them safely.[MODIFY]
docs/ERROR_CODES.md🛠 Contract Error Enums
contracts/vault/src/errors.rs,contracts/settlement/src/errors.rs,contracts/refund/src/errors.rs,contracts/fee/src/errors.rs,contracts/batch_claim/src/errors.rs🔁 CI Diff Check
.github/workflows/ci.ymlscripts/gen_error_codes.pyand fails the build ifdocs/ERROR_CODES.mdis out of date relative to the enums.Verification Results
reserved--checkmode wired into.github/workflows/ci.ymlscripts/gen_error_codes.pySecurity and Failure Modes
docs/ERROR_CODES.md; CI uses--checkso no files are mutated during verification.Compatibility
Closes #1246