Skip to content

Commit

Permalink
added handling of new tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
Bullrich committed Apr 23, 2024
1 parent a4aca2d commit 833bd31
Showing 1 changed file with 4 additions and 5 deletions.
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.toHuman() == null) {
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

0 comments on commit 833bd31

Please sign in to comment.