feat: signed int and or support#202
Conversation
size-limit report 📦
|
fichiokaku
left a comment
There was a problem hiding this comment.
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 |
|
@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 |
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
versioninscripts/fund:nexus.tsto V2_2_2.greaterThanOrEqualToSignedandlessThanOrEqualToSignedconstraints insrc/sdk/modules/utils/conditions.ts.GTE_SIGNEDandLTE_SIGNEDtypes inConditionTypeenum.createConditionto handle signed constraints.setupMultiVersion.tsto recognize V2_2_2 with new features.V2_2_2andComposabilityVersion.V1_1_1insrc/sdk/constants/index.ts.buildComposable.ts.src/sdk/modules/utils/conditions.test.tsandsrc/sdk/account/decorators/instructions/buildComposable.test.ts.