Add FIXED_POINTS error codes#1559
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 74ef76c The changes in this PR will be included in the next version bump. This PR includes changesets to release 47 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Member
Author
This was referenced Apr 24, 2026
Merged
Merged
BundleMonFiles updated (7)
Unchanged files (140)
Total files change +4.39KB +0.88% Final result: ✅ View report in BundleMon website ➡️ |
Contributor
|
Documentation Preview: https://kit-docs-cup4m3c2h-anza-tech.vercel.app |
ce87d8d to
f73fabb
Compare
mcintyre94
approved these changes
Apr 28, 2026
a949987 to
e482616
Compare
f73fabb to
f35860d
Compare
e482616 to
de697e2
Compare
f35860d to
ab0548b
Compare
de697e2 to
9e6104d
Compare
6817c52 to
e7bf82c
Compare
9e6104d to
9388f75
Compare
Member
Author
Merge activity
|
This PR is part of the stack implementing the fixed-point number types proposed in #1545. It lands every error code, context shape, and message that the new package will throw, so later PRs in the stack can just reference them. Reserves the range `[8090000-8090999]` for the `FIXED_POINTS` domain and allocates 12 codes covering invalid shape parameters (total bits, fractional bits, decimals, and the binary-only "fractional bits exceed total bits" check), out-of-range raw values, malformed raw values, malformed strings, zero-denominator ratios, division by zero, arithmetic overflow (shared by add/subtract/multiply/divide/negate/absolute/rescale/signedness conversion), strict shape mismatches in operations and codecs, and strict-mode precision loss when factories and operations cannot produce an exact result without rounding. Here is an example message for each new code: - `SOLANA_ERROR__FIXED_POINTS__INVALID_TOTAL_BITS`: ``` Invalid `totalBits`. Expected a positive integer, got foo. ``` - `SOLANA_ERROR__FIXED_POINTS__INVALID_FRACTIONAL_BITS`: ``` Invalid `fractionalBits`. Expected a non-negative integer, got -1. ``` - `SOLANA_ERROR__FIXED_POINTS__INVALID_DECIMALS`: ``` Invalid `decimals`. Expected a non-negative integer, got 1.5. ``` - `SOLANA_ERROR__FIXED_POINTS__FRACTIONAL_BITS_EXCEED_TOTAL_BITS`: ``` `fractionalBits` (64) must not exceed `totalBits` (16). ``` - `SOLANA_ERROR__FIXED_POINTS__VALUE_OUT_OF_RANGE`: ``` Fixed-point value of kind `decimalFixedPoint` is out of range for unsigned 8-bit storage. Expected a raw bigint in [0, 255], got 999. ``` - `SOLANA_ERROR__FIXED_POINTS__INVALID_STRING`: ``` Invalid string `abc` for fixed-point value of kind `binaryFixedPoint`. ``` - `SOLANA_ERROR__FIXED_POINTS__INVALID_ZERO_DENOMINATOR_RATIO`: ``` Invalid ratio 3/0 for fixed-point value of kind `decimalFixedPoint`. Denominator must be non-zero. ``` - `SOLANA_ERROR__FIXED_POINTS__ARITHMETIC_OVERFLOW`: ``` Fixed-point operation `add` of kind `binaryFixedPoint` overflowed. Expected a raw bigint in [-128, 127], got 256. ``` - `SOLANA_ERROR__FIXED_POINTS__SHAPE_MISMATCH`: ``` Fixed-point `add` operation expected binaryFixedPoint (signed, 16 bits, 8 fractional bits); got decimalFixedPoint (unsigned, 64 bits, 6 decimals). ``` - `SOLANA_ERROR__FIXED_POINTS__DIVISION_BY_ZERO`: ``` Fixed-point division by zero for value of kind `decimalFixedPoint` (unsigned, 64 bits). ``` - `SOLANA_ERROR__FIXED_POINTS__STRICT_MODE_PRECISION_LOSS`: ``` Fixed-point operation `fromRatio` of kind `decimalFixedPoint` cannot be performed exactly; pass a rounding mode other than `strict` to allow a rounded result. ``` - `SOLANA_ERROR__FIXED_POINTS__MALFORMED_RAW_VALUE`: ``` Fixed-point value of kind `binaryFixedPoint` has a malformed `raw` field. Expected a bigint, got `42`. ```
e7bf82c to
74ef76c
Compare
Contributor
|
🔎💬 Inkeep AI search and chat service is syncing content for source 'Solana Kit Docs' |
This was referenced May 5, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR is part of the stack implementing the fixed-point number types proposed in #1545. It lands every error code, context shape, and message that the new package will throw, so later PRs in the stack can just reference them.
Reserves the range
[8090000-8090999]for theFIXED_POINTSdomain and allocates 12 codes covering invalid shape parameters (total bits, fractional bits, decimals, and the binary-only "fractional bits exceed total bits" check), out-of-range raw values, malformed raw values, malformed strings, zero-denominator ratios, division by zero, arithmetic overflow (shared by add/subtract/multiply/divide/negate/absolute/rescale/signedness conversion), strict shape mismatches in operations and codecs, and strict-mode precision loss when factories and operations cannot produce an exact result without rounding.Here is an example message for each new code:
SOLANA_ERROR__FIXED_POINTS__INVALID_TOTAL_BITS:SOLANA_ERROR__FIXED_POINTS__INVALID_FRACTIONAL_BITS:SOLANA_ERROR__FIXED_POINTS__INVALID_DECIMALS:SOLANA_ERROR__FIXED_POINTS__FRACTIONAL_BITS_EXCEED_TOTAL_BITS:SOLANA_ERROR__FIXED_POINTS__VALUE_OUT_OF_RANGE:SOLANA_ERROR__FIXED_POINTS__INVALID_STRING:SOLANA_ERROR__FIXED_POINTS__INVALID_ZERO_DENOMINATOR_RATIO:SOLANA_ERROR__FIXED_POINTS__ARITHMETIC_OVERFLOW:SOLANA_ERROR__FIXED_POINTS__SHAPE_MISMATCH:SOLANA_ERROR__FIXED_POINTS__DIVISION_BY_ZERO:SOLANA_ERROR__FIXED_POINTS__STRICT_MODE_PRECISION_LOSS:SOLANA_ERROR__FIXED_POINTS__MALFORMED_RAW_VALUE: