Skip to content

Commit 0e5b04e

Browse files
PAPI upgrade
1 parent 441acc7 commit 0e5b04e

File tree

6 files changed

+762
-534
lines changed

6 files changed

+762
-534
lines changed

.papi/descriptors/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"version": "0.1.0-autogenerated.14257783844949306470",
2+
"version": "0.1.0-autogenerated.9533819768557819421",
33
"name": "@polkadot-api/descriptors",
44
"files": [
55
"dist"
66
],
77
"exports": {
88
".": {
9+
"types": "./dist/index.d.ts",
910
"module": "./dist/index.mjs",
1011
"import": "./dist/index.mjs",
11-
"require": "./dist/index.js",
12-
"default": "./dist/index.js"
12+
"require": "./dist/index.js"
1313
},
1414
"./package.json": "./package.json"
1515
},

.papi/metadata/collectives.scale

69.2 KB
Binary file not shown.

.papi/metadata/people.scale

45.4 KB
Binary file not shown.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@
3939
"@actions/core": "^1.10.1",
4040
"@actions/github": "^6.0.0",
4141
"@eng-automation/js": "^2.2.0",
42-
"@polkadot-api/descriptors": "file:.papi/descriptors",
42+
"@polkadot-api/descriptors": "portal:.papi/descriptors",
4343
"joi": "^17.13.1",
44-
"polkadot-api": "^0.12.0",
45-
"smoldot": "^2.0.29",
44+
"polkadot-api": "^1.8.2",
45+
"smoldot": "^2.0.34",
4646
"yaml": "^2.3.4"
4747
},
4848
"packageManager": "yarn@4.3.0",

src/polkadot/fellows.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { collectives, people } from "@polkadot-api/descriptors";
2-
import { createClient, SS58String, TypedApi } from "polkadot-api";
1+
import { collectives, people, IdentityData } from "@polkadot-api/descriptors";
2+
import { createClient, SS58String, TypedApi, Binary } from "polkadot-api";
33
import { chainSpec as polkadotChainSpec } from "polkadot-api/chains/polkadot";
44
import { chainSpec as collectivesChainSpec } from "polkadot-api/chains/polkadot_collectives";
55
import { chainSpec as peopleChainSpec } from "polkadot-api/chains/polkadot_people";
@@ -26,7 +26,7 @@ export class PolkadotFellows implements TeamApi {
2626

2727
if (identityOf) {
2828
const [identity] = identityOf;
29-
const github = identity.info.github.value;
29+
const github = readIdentityData(identity.info.github);
3030

3131
if (!github) {
3232
logger.debug(`'${address}' does not have an additional field named 'github'`);
@@ -174,3 +174,9 @@ export class PolkadotFellows implements TeamApi {
174174
return users;
175175
}
176176
}
177+
178+
function readIdentityData(identityData: IdentityData): Binary | null {
179+
if (identityData.type === "None" || identityData.type === "Raw0") return null;
180+
if (identityData.type === "Raw1") return Binary.fromBytes(new Uint8Array(identityData.value));
181+
return identityData.value;
182+
}

0 commit comments

Comments
 (0)