Skip to content

feat: signed int and or support#202

Merged
vr16x merged 7 commits into
developfrom
feat/usigned-int-and-or-support
May 22, 2026
Merged

feat: signed int and or support#202
vr16x merged 7 commits into
developfrom
feat/usigned-int-and-or-support

Conversation

@vr16x
Copy link
Copy Markdown
Collaborator

@vr16x vr16x commented Apr 30, 2026

PR-Codex overview

This PR introduces support for signed integer constraints and OR conditions in the composability framework, specifically for ComposabilityVersion.V1_1_1. It updates various parts of the codebase to accommodate these new features, ensuring compatibility with version checks.

Detailed summary

  • Updated version in scripts/fund:nexus.ts to V2_2_2.
  • Added greaterThanOrEqualToSigned and lessThanOrEqualToSigned constraints in src/sdk/modules/utils/conditions.ts.
  • Introduced GTE_SIGNED and LTE_SIGNED types in ConditionType enum.
  • Enhanced createCondition to handle signed constraints.
  • Updated setupMultiVersion.ts to recognize V2_2_2 with new features.
  • Added new constants for V2_2_2 and ComposabilityVersion.V1_1_1 in src/sdk/constants/index.ts.
  • Implemented checks for signed constraints in buildComposable.ts.
  • Added tests for signed constraints and OR conditions in src/sdk/modules/utils/conditions.test.ts and src/sdk/account/decorators/instructions/buildComposable.test.ts.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 30, 2026

size-limit report 📦

Path Size
core (esm) 71.95 KB (+0.74% 🔺)
core (cjs) 87.02 KB (+0.59% 🔺)
bundler (tree-shaking) 7.14 KB (+2% 🔺)
paymaster (tree-shaking) 543 B (0%)

@vr16x vr16x requested a review from fichiokaku May 12, 2026 13:21
Copy link
Copy Markdown

@eternaut1 eternaut1 left a comment

Choose a reason for hiding this comment

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

//

Copy link
Copy Markdown
Contributor

@fichiokaku fichiokaku left a comment

Choose a reason for hiding this comment

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

Looks good overall — version guards are solid and the OR/signed encoding lines up with the contract decode side. One inline note on a docstring mix-up, and one open question about test coverage:

Open question — OR containing signed sub-constraints. validateAndProcessChildConstraint allows GTE_SIGNED/LTE_SIGNED inside orConstraint(...), and the e2e tests cover OR (with unsigned subs) and GTE_SIGNED/LTE_SIGNED standalone, but I didn't see a test for the combined shape, e.g.:

orConstraint([
  greaterThanOrEqualToSigned(-1n),
  lessThanOrEqualToSigned(parseUnits("100", 6))
])

Is that intentionally out of scope for this PR, or worth adding a unit test (and maybe one integration test) before merging? It's the most likely place for a quiet encoding mismatch with the contract, since the signed sub-constraint's referenceData gets wrapped inside the OR's abi.encode(Constraint[]).

Comment thread src/sdk/constants/index.ts Outdated
@vr16x
Copy link
Copy Markdown
Collaborator Author

vr16x commented May 22, 2026

Looks good overall — version guards are solid and the OR/signed encoding lines up with the contract decode side. One inline note on a docstring mix-up, and one open question about test coverage:

Open question — OR containing signed sub-constraints. validateAndProcessChildConstraint allows GTE_SIGNED/LTE_SIGNED inside orConstraint(...), and the e2e tests cover OR (with unsigned subs) and GTE_SIGNED/LTE_SIGNED standalone, but I didn't see a test for the combined shape, e.g.:

orConstraint([
  greaterThanOrEqualToSigned(-1n),
  lessThanOrEqualToSigned(parseUnits("100", 6))
])

Is that intentionally out of scope for this PR, or worth adding a unit test (and maybe one integration test) before merging? It's the most likely place for a quiet encoding mismatch with the contract, since the signed sub-constraint's referenceData gets wrapped inside the OR's abi.encode(Constraint[]).

Added additional test coverage as requested

@vr16x vr16x requested a review from fichiokaku May 22, 2026 11:25
@vr16x
Copy link
Copy Markdown
Collaborator Author

vr16x commented May 22, 2026

@fichiokaku Those 8 test cases failing in both paid and unit test cases are known and not related to the current scope. So optimistically skipping that as discussed

@vr16x vr16x merged commit 33e94ea into develop May 22, 2026
5 of 7 checks passed
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.

3 participants