Skip to content

Feature/math boundary tests - #1597

Open
AvatarMiiDe wants to merge 5 commits into
CredenceOrg:mainfrom
AvatarMiiDe:feature/math-boundary-tests
Open

AvatarMiiDe wants to merge 5 commits into
CredenceOrg:mainfrom
AvatarMiiDe:feature/math-boundary-tests

Conversation

@AvatarMiiDe

Copy link
Copy Markdown

Description

Closes #(issue-number)

Type of Change

  • feat — new functionality
  • fix — bug fix
  • docs — documentation only
  • refactor — code restructuring with no behaviour change
  • test — test additions or improvements
  • ci — CI configuration changes
  • chore — maintenance, dependencies, tooling

How Has This Been Tested?

  • cargo test --workspace passes
  • cargo fmt --all -- --check passes
  • cargo clippy --workspace --all-targets --all-features -- -D warnings passes
  • Coverage ≥ 95% for affected crates (cargo llvm-cov --package <crate> --fail-under-lines 95)
  • Fuzz harness passes (cargo test -p credence_bond fuzz::test_bond_fuzz -- --nocapture)
  • Error code wire-stability test passes (cargo test -p credence_errors error_codes_wire)
  • Release build passes (cargo build --release)

Checklist

  • Tests added/updated for new or changed functionality
  • Docs updated (if public API, storage layout, error codes, or architecture changed)
  • CHANGELOG.md updated (if contracts/** touched)
  • Branch follows <type>/<short-description> naming convention
  • Commit messages follow conventional commits

Additional Context

Close #1339

Expands test_math.rs with comprehensive coverage for all arithmetic helpers. Includes success, rejection, division-by-zero boundary panics, max-limit bounds, and graceful saturation recovery (sat_mul_bps) to ensure math behaves deterministically and preserves safety invariants.
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.

Add boundary and recovery test coverage for contracts/credence_bond/src/math.rs

1 participant