Skip to content

Sync ContractError bindings with contract errors and add error-code parity guard#95

Open
Josue19-08 wants to merge 2 commits into
TevaLabs:mainfrom
Josue19-08:feat/issue-73-sync-contract-error-bindings
Open

Sync ContractError bindings with contract errors and add error-code parity guard#95
Josue19-08 wants to merge 2 commits into
TevaLabs:mainfrom
Josue19-08:feat/issue-73-sync-contract-error-bindings

Conversation

@Josue19-08

Copy link
Copy Markdown
Contributor

Summary

  • Add FutureOracleData (24) and PayoutOverflow (25) to the ContractError map in bindings/src/index.ts, bringing bindings fully in sync with all 25 on-chain error codes defined in errors.rs.
  • Extend parity.js to parse the ContractError enum from errors.rs and compare it against the bindings map, so CI fails whenever a new contract error is added without a matching bindings entry — preventing future drift.
  • Update bindings/CHANGELOG.md with a [1.2.0] entry documenting both changes.

Linked issues

Validation

  • cargo test --workspace — pre-existing compile error in contract.rs:116 (assert_no_active_round → unrelated to this PR, present on main before this branch)
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • cd bindings && npm ci && npm run build
  • cd bindings && node src/parity.js — ✅ passes with all 25 error codes synced

Governance checklist

  • I reviewed CONTRIBUTING.md for workflow expectations
  • I checked CODEOWNERS impact for touched paths
  • I followed SUPPORT.md disclosure guidance for any security-sensitive change

… guard

Add FutureOracleData (24) and PayoutOverflow (25) to the ContractError map
in bindings/src/index.ts, completing coverage of all 25 on-chain error codes.

Extend parity.js to parse and compare the errors.rs enum against the
ContractError map, failing CI whenever a new contract error is added without
a matching bindings entry.
Add the assert_no_active_round private helper that was called in
create_round but never defined, returning RoundAlreadyActive when
a round is already live. Remove the redundant checked_add assignment
immediately shadowed by payout_add on the same binding. Fix
inconsistent digit grouping flagged by clippy in overflow_tests.
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.

Improvement: Sync bindings ContractError map with contract errors 18/19

1 participant