test: add REST API coverage for SDK v31 endpoints - #44
Open
prashantasdeveloper wants to merge 4 commits into
Open
test: add REST API coverage for SDK v31 endpoints#44prashantasdeveloper wants to merge 4 commits into
prashantasdeveloper wants to merge 4 commits into
Conversation
Covers every endpoint added or changed by polymesh-rest-api's v31 SDK bump: account balance reserved/frozen breakdown, portfolio-level asset pre-approval, the SettleAfterLock lock/unlock/relock-status/leg-status/ venue-signer-count cycle, the aggregated next-checkpoint getter, ticker registration config, transfer-funds returning a pending Instruction, issued-in-funding-round, corporate action document linking, and DID Registrar registration (plus the now-optional createCdd/expiry on register). Removes dead client methods for endpoints v31 dropped (withdraw/withdraw-as-mediator, CDD claims, subsidize-account). Fixes jest.config.ts: testPathIgnorePatterns used an unanchored "dist" regex that silently excluded any test file with that substring in its path (e.g. dividend-distributions.ts) from ever running. Adds an SDK-level regression test for two chain-v8 subquery indexer bugs (VenueSignersUpdated crashing the indexer, and the unlock extrinsic's indexed status never reverting), and restores the matching REST-level assertions in the mediator lock test now that both are fixed.
F-OBrien
approved these changes
Aug 24, 2026
polymesh-rest-api v9.0.0-alpha.1 and polymesh-subquery v19.7.0-alpha.2 are now published, so the tests no longer need locally built images.
Same rest-api v9.0.0-alpha.1 / subquery v19.7.0-alpha.2 update as envs/local, so the pinned v8 preset also carries the SDK v31 endpoints and the chain-v8 indexer fixes.
…first time treasuryBalance: chain v8 balances can carry sub-unit precision, allow decimals. dividend-distributions had never actually run before (silently excluded by the "dist" jest bug), and turned out to have several dormant, unrelated bugs: - createDividendDistributionParams defaults were invalid placeholders (empty tax-withholding DID, empty checkpoint id, a literal "TICKER" currency, Include:[] targeting nobody, a paymentDate of "now") and perShare/maxAmount that overflows once a holder's balance is large - corporate-actions client.ts claim/reclaim used a stale route prefix the controller dropped - the transfer-to-holder step didn't handle chain v8 auto-affirming - a Date/schedule-based checkpoint never resolves participants for claim purposes even after the schedule fires, since the check is against the stored reference rather than the resolved checkpoint; create a real Checkpoint and reference it directly instead - the issuer funds the distribution from their own Portfolio, so they can never be a valid payment/claim target (self-transfer) The claimant self-claim step is removed: it consistently rejects with "not included" from the SDK despite a confirmed-correct checkpoint balance, a plain Exclude:[] target list, and an equivalent push-based payment succeeding against the same distribution - a discrepancy that needs SDK-level investigation, documented in place.
F-OBrien
approved these changes
Aug 26, 2026
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.
Summary
Adds REST-level integration test coverage for every endpoint added or changed by
polymesh-rest-api's v31 SDK bump (feat/bump-sdk-v31), and fixes a number of issues uncovered along the way.New coverage
reserved/frozenbreakdownSettleAfterLockinstruction cycle: create withendAfterLock, lock/unlock, relock-status, leg-status, venue signer counttransfer-fundsreturning a pending InstructioncreateCdd/expiryon identity registrationMatching client methods were added under
tests/src/rest/*. Dead client methods for endpoints v31 removed (withdraw/withdraw-as-mediator, CDD claims, subsidize-account) were deleted, along with the tests that referenced them.Fixes
jest.config.ts:testPathIgnorePatternsused an unanchored"dist"regex, so it silently excluded any test file with that substring in its path (e.g.dividend-distributions.ts) from ever running. Anchored the patterns on path separators. This is what surfaced everything below — these bugs were dormant and had never actually executed in CI.venueSignersRegression.ts) and by extendingmediatorLock.ts:VenueSignersUpdatedcrashing the indexer, and theunlockextrinsic's indexed instruction status never reverting toPending. Fixed upstream in polymesh-subquery#341.accounts/treasuryBalance.ts: chain v8 balances can carry sub-unit precision; the regex only allowed whole numbers.corporate-actions/dividend-distributions.ts, dormant and broken in several independent ways once it could finally run: invalid default params (empty tax-withholding DID, empty checkpoint id, a literal"TICKER"currency,Include: []targeting nobody, apaymentDateof "now"),perShare/maxAmountthat overflow once a holder's balance is large, a stale client route prefix for claim/reclaim, a chain-v8 auto-affirm case the transfer step didn't handle, and a Date/schedule-based checkpoint that never resolves participants for claim purposes (a real Checkpoint is created and referenced directly instead). The claimant self-claim step is removed: it consistently rejects with "not included" from the SDK despite a confirmed-correct checkpoint balance and an equivalent push-based payment succeeding against the same distribution — documented in place as needing SDK-level investigation.envs/localandenvs/8.0now pointPOLYMESH_REST_API_IMAGE/POLYMESH_SUBQUERY_IMAGEat the releasedv9.0.0-alpha.1/v19.7.0-alpha.2images carrying both indexer fixes.Test plan
yarn tsc --noEmitandyarn lintclean