Skip to content

test: restore the dividend distribution self-claim step - #45

Open
prashantasdeveloper wants to merge 1 commit into
mainfrom
test/restore-dividend-self-claim
Open

test: restore the dividend distribution self-claim step#45
prashantasdeveloper wants to merge 1 commit into
mainfrom
test/restore-dividend-self-claim

Conversation

@prashantasdeveloper

Copy link
Copy Markdown
Collaborator

Summary

Restores the claimant should be able to claim the distribution step in dividend-distributions.ts, removed in #44 pending SDK-level investigation of capitalDistribution.claim consistently rejecting with 'The signing Identity is not included in this Distribution' for a genuine, funded participant.

Root cause (found and fixed upstream)

prepareClaimDividends called distribution.getParticipant() with no args, letting it default the identity to check via distribution.context.getSigningIdentity(). The DividendDistribution entity carries whatever Context it happened to be fetched with, which for a long-lived, multi-account consumer like polymesh-rest-api is a different object than the Procedure's own per-call Context (scoped to that call's signingAccount). So the check ran against whatever Identity the shared Context's signingAddress last pointed to, not the Identity actually signing the claim.

Confirmed live against a real chain v8 node + polymesh-rest-api, with temporary debug instrumentation in the running REST API's SDK copy — it was resolving a completely unrelated Identity with a 0 balance, hence the deterministic "not included" rejection.

Fixed upstream in PolymeshAssociation/polymesh-sdk#1663.

⚠️ This PR will fail CI until the SDK fix ships

This restores the test as it should be once the fix lands, but polymesh-rest-api:v9.0.0-alpha.1 (used by envs/local/envs/8.0) still bundles the unfixed SDK 31.0.0. Do not merge until polymesh-rest-api has bumped to a SDK release containing #1663, at which point this suite should go green as-is.

Test plan

Blocked on PolymeshAssociation/polymesh-sdk#1663, which fixes the actual
bug: prepareClaimDividends checked participation against whatever
Identity distribution.context's signingAddress last pointed to instead
of the Identity actually signing the claim, since the DividendDistribution
entity is fetched off a Context that isn't necessarily this Procedure's
own per-call one. Confirmed live against a real chain v8 node with a
temporary patch of a running polymesh-rest-api container's SDK copy:
13/13 passing, including this step, once the fix is applied.

This will fail in CI until polymesh-rest-api bumps its SDK dependency to
a release containing that fix.
@prashantasdeveloper
prashantasdeveloper requested review from a team as code owners August 27, 2026 08:59
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.

1 participant