Skip to content

Commit 29e944c

Browse files
authored
Fix IdentityOf tuple introduced in v1.2.0 (#119)
Fixed `Identity` object now being a tuple of type `[IdentityOf, BoundedVec]` introduced as as breaking change in v1.2.0 Fixes #118
1 parent 6134083 commit 29e944c

File tree

4 files changed

+206
-124
lines changed

4 files changed

+206
-124
lines changed

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ outputs:
3232

3333
runs:
3434
using: 'docker'
35-
image: 'docker://ghcr.io/paritytech/review-bot/action:2.4.0'
35+
image: 'docker://ghcr.io/paritytech/review-bot/action:2.4.1'

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "review-bot",
3-
"version": "2.4.0",
3+
"version": "2.4.1",
44
"description": "Have custom review rules for PRs with auto assignment",
55
"main": "src/index.ts",
66
"scripts": {
@@ -38,7 +38,7 @@
3838
"@actions/core": "^1.10.1",
3939
"@actions/github": "^6.0.0",
4040
"@eng-automation/js": "^1.0.2",
41-
"@polkadot/api": "^10.11.2",
41+
"@polkadot/api": "^10.13.1",
4242
"joi": "^17.6.4",
4343
"yaml": "^2.3.4"
4444
}

src/polkadot/fellows.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,9 @@ export class PolkadotFellows implements TeamApi {
4040
const users: Map<string, number> = new Map<string, number>();
4141
for (const fellow of fellows) {
4242
this.logger.debug(`Fetching identity of '${fellow.address}', rank: ${fellow.rank}`);
43-
const fellowData = (await api.query.identity.identityOf(fellow.address)).toHuman() as
44-
| Record<string, unknown>
45-
| undefined;
46-
43+
const identityQuery = await api.query.identity.identityOf(fellow.address);
4744
// If the identity is null, we check if there is a super identity.
48-
if (!fellowData) {
45+
if (identityQuery.isEmpty) {
4946
this.logger.debug("Identity is null. Checking for super identity");
5047
const superIdentity = (await api.query.identity.superOf(fellow.address)).toHuman() as
5148
| [string, { Raw: string }]
@@ -59,6 +56,8 @@ export class PolkadotFellows implements TeamApi {
5956
continue;
6057
}
6158

59+
const [fellowData] = identityQuery.toHuman() as [Record<string, unknown>, unknown];
60+
6261
// @ts-ignore
6362
const additional = fellowData.info?.additional as [{ Raw: string }, { Raw: string }][] | undefined;
6463

0 commit comments

Comments
 (0)