Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/fast-forward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
# never post a comment. (In all cases the information is
# still available in the step's summary.)
comment: on-error
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} ## This allows to trigger push action from within this workflow. Read more - https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
GITHUB_TOKEN: ${{ secrets.ASSOCIATION_RELEASE_TOKEN }} ## This allows to trigger push action from within this workflow. Read more - https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
11 changes: 4 additions & 7 deletions src/sdk/identities/claims.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Polymesh } from '@polymeshassociation/polymesh-sdk';
import { ClaimType, ScopeType } from '@polymeshassociation/polymesh-sdk/types';
import assert from 'node:assert';

import { awaitMiddlewareSynced } from '~/util';

/*
This function showcases Claim related functionality. It:
- Add a claim
Expand Down Expand Up @@ -41,13 +43,10 @@ export const manageClaims = async (
{ signingAccount }
);

let middlewareSynced = () =>
new Promise((resolve) => addClaimTx.onProcessedByMiddleware(resolve));

await addClaimTx.run();
assert(addClaimTx.isSuccess);

await middlewareSynced();
await awaitMiddlewareSynced(addClaimTx, sdk, 15, 2000);

// Get issued claims
const issuedClaims = await sdk.claims.getIssuedClaims({
Expand All @@ -67,12 +66,10 @@ export const manageClaims = async (
{ signingAccount }
);

middlewareSynced = () => new Promise((resolve) => revokeClaimTx.onProcessedByMiddleware(resolve));

await revokeClaimTx.run();
assert(revokeClaimTx.isSuccess);

await middlewareSynced();
await awaitMiddlewareSynced(revokeClaimTx, sdk, 15, 2000);

// This following portion demonstrates different ways to fetch claims

Expand Down
Loading