Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix IdentityOf tuple introduced in v1.2.0 #119

Merged
merged 4 commits into from
Apr 23, 2024
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 action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ outputs:

runs:
using: 'docker'
image: 'docker://ghcr.io/paritytech/review-bot/action:2.4.0'
image: 'docker://ghcr.io/paritytech/review-bot/action:2.4.1'
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "review-bot",
"version": "2.4.0",
"version": "2.4.1",
"description": "Have custom review rules for PRs with auto assignment",
"main": "src/index.ts",
"scripts": {
Expand Down Expand Up @@ -38,7 +38,7 @@
"@actions/core": "^1.10.1",
"@actions/github": "^6.0.0",
"@eng-automation/js": "^1.0.2",
"@polkadot/api": "^10.11.2",
"@polkadot/api": "^10.13.1",
"joi": "^17.6.4",
"yaml": "^2.3.4"
}
Expand Down
9 changes: 4 additions & 5 deletions src/polkadot/fellows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,9 @@ export class PolkadotFellows implements TeamApi {
const users: Map<string, number> = new Map<string, number>();
for (const fellow of fellows) {
this.logger.debug(`Fetching identity of '${fellow.address}', rank: ${fellow.rank}`);
const fellowData = (await api.query.identity.identityOf(fellow.address)).toHuman() as
| Record<string, unknown>
| undefined;

const identityQuery = await api.query.identity.identityOf(fellow.address);
// If the identity is null, we check if there is a super identity.
if (!fellowData) {
if (identityQuery.isEmpty) {
this.logger.debug("Identity is null. Checking for super identity");
const superIdentity = (await api.query.identity.superOf(fellow.address)).toHuman() as
| [string, { Raw: string }]
Expand All @@ -59,6 +56,8 @@ export class PolkadotFellows implements TeamApi {
continue;
}

const [fellowData] = identityQuery.toHuman() as [Record<string, unknown>, unknown];

// @ts-ignore
const additional = fellowData.info?.additional as [{ Raw: string }, { Raw: string }][] | undefined;

Expand Down
Loading
Loading