Skip to content

Add min_value and max_value helpers to 256-bit numbers#1823

Merged
mootz12 merged 5 commits intorelease/v26-previewfrom
256-bit-num-min-max
Apr 7, 2026
Merged

Add min_value and max_value helpers to 256-bit numbers#1823
mootz12 merged 5 commits intorelease/v26-previewfrom
256-bit-num-min-max

Conversation

@mootz12
Copy link
Copy Markdown
Contributor

@mootz12 mootz12 commented Apr 6, 2026

What

Adds min_value and max_value helpers to 256-bit numbers.

Why

These functions were missing for 256-bit numbers.

Closes #1740

Known limitations

None

Copilot AI review requested due to automatic review settings April 6, 2026 17:51
@mootz12 mootz12 changed the base branch from main to v26-preview-merge-main April 6, 2026 17:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds missing boundary helpers for the Soroban SDK’s 256-bit numeric wrapper types, improving parity with expectations for integer APIs (per #1740).

Changes:

  • Add U256::{min_value,max_value} helpers.
  • Add I256::max_value helper (and move/normalize min_value placement).
  • Add unit tests covering the new min/max helpers.

Base automatically changed from v26-preview-merge-main to release/v26-preview April 6, 2026 17:59
mootz12 and others added 2 commits April 6, 2026 15:08
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mootz12 mootz12 force-pushed the 256-bit-num-min-max branch from bfbd22f to 51c8eaf Compare April 6, 2026 19:08
@mootz12 mootz12 merged commit 5bcd17c into release/v26-preview Apr 7, 2026
195 checks passed
@mootz12 mootz12 deleted the 256-bit-num-min-max branch April 7, 2026 17:51
github-merge-queue bot pushed a commit that referenced this pull request Apr 7, 2026
### What

* Update soroban-env dependencies to p26
* Add support for CAP-78 host functions to perform limited TTL
extensions on contract data and code entries (#1807)
* Add support for CAP-82 host functions to perform checked math on
256-bit integer types (#1801)
* Add `min_value` and `max_value` functions on 256-bit integer types
(#1823)
* Add support for CAP-79 (muxed address strkey conversion host
functions) and CAP-80 (Additional BN254 and BLS12-381 host functions)
(#1745)
* Add support for CAP-73 Stellar Asset Contract `trust()` function
(#1801)

### Why

Update SDK to support new features in protocol 26.

### Known limitations

None

---------

Co-authored-by: Siddharth Suresh <siddharth@stellar.org>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sisuresh <5050166+sisuresh@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Dmytro Kozhevin <dmytro@stellar.org>
Co-authored-by: Jay Geng <jay@stellar.org>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

I256::MIN is missing from the I256 library

3 participants