Skip to content

fix: bug fix for precision handling - #328

Merged
squirer merged 7 commits into
mainfrom
feature/COR-2315-precision-number-handling-verifier
Mar 2, 2026
Merged

fix: bug fix for precision handling#328
squirer merged 7 commits into
mainfrom
feature/COR-2315-precision-number-handling-verifier

Conversation

@squirer

@squirer squirer commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Purpose

Integer parsing between CBOR Positive(u64) and CBOR negative(u64) - added float check for finite numbers and documented api that 15-16 significant digit floats are advised to use Json string representation.

Changes

Added unit tests and further documentation for boundary number processing

Checklist

  • My code follows the style of this project.
  • The code compiles without warnings.
  • I have performed a self-review of the changes.
  • I have documented my code, in particular the intent of the
    hard-to-understand areas.
  • (If necessary) I have updated the CHANGELOG.

Comment thread credential-verification-service/src/api/util.rs
Comment thread credential-verification-service/Cargo.toml Outdated
@squirer

squirer commented Mar 1, 2026

Copy link
Copy Markdown
Contributor Author

@allanbrondum @andynelson

i have now updated the solution with the agreement of treating the numbers as u64, i64 and f64 based on our discussions. Also updated the tests now to show that we support i64 MIN > u64 max for literals, everything else falls back to f64 and the only ever produced is if a float is provided with a way too large exponent for example: 1e400.

So our documented range now is:

  • we support literals between i64 and u64 range: -9223372036854775808 and 18446744073709551615
  • we support f64 with out of the box behaviour of precision to 15 or 16 significant digits.

Here is the transaction proof for tesnet for how these values are respected:

image

So i believe we are all good here with the changes now contained in this PR.

@squirer
squirer requested a review from allanbrondum March 1, 2026 12:43
Comment thread credential-verification-service/src/api/util.rs
Comment thread credential-verification-service/src/api/util.rs
Comment thread credential-verification-service/src/api/util.rs
@squirer
squirer requested a review from allanbrondum March 2, 2026 12:39
@squirer
squirer merged commit 548cd67 into main Mar 2, 2026
4 checks passed
@squirer
squirer deleted the feature/COR-2315-precision-number-handling-verifier branch March 2, 2026 17:16
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.

2 participants