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

PAPI upgrade #141

Merged
merged 1 commit into from
Jan 16, 2025
Merged
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
6 changes: 3 additions & 3 deletions .papi/descriptors/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"version": "0.1.0-autogenerated.14257783844949306470",
"version": "0.1.0-autogenerated.9533819768557819421",
"name": "@polkadot-api/descriptors",
"files": [
"dist"
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"module": "./dist/index.mjs",
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"default": "./dist/index.js"
"require": "./dist/index.js"
},
"./package.json": "./package.json"
},
Binary file modified .papi/metadata/collectives.scale
Binary file not shown.
Binary file modified .papi/metadata/people.scale
Binary file not shown.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -39,10 +39,10 @@
"@actions/core": "^1.10.1",
"@actions/github": "^6.0.0",
"@eng-automation/js": "^2.2.0",
"@polkadot-api/descriptors": "file:.papi/descriptors",
"@polkadot-api/descriptors": "portal:.papi/descriptors",
"joi": "^17.13.1",
"polkadot-api": "^0.12.0",
"smoldot": "^2.0.29",
"polkadot-api": "^1.8.2",
"smoldot": "^2.0.34",
"yaml": "^2.3.4"
},
"packageManager": "yarn@4.3.0",
12 changes: 9 additions & 3 deletions src/polkadot/fellows.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { collectives, people } from "@polkadot-api/descriptors";
import { createClient, SS58String, TypedApi } from "polkadot-api";
import { collectives, IdentityData, people } from "@polkadot-api/descriptors";
import { Binary, createClient, SS58String, TypedApi } from "polkadot-api";
import { chainSpec as polkadotChainSpec } from "polkadot-api/chains/polkadot";
import { chainSpec as collectivesChainSpec } from "polkadot-api/chains/polkadot_collectives";
import { chainSpec as peopleChainSpec } from "polkadot-api/chains/polkadot_people";
@@ -26,7 +26,7 @@ export class PolkadotFellows implements TeamApi {

if (identityOf) {
const [identity] = identityOf;
const github = identity.info.github.value;
const github = readIdentityData(identity.info.github);

if (!github) {
logger.debug(`'${address}' does not have an additional field named 'github'`);
@@ -174,3 +174,9 @@ export class PolkadotFellows implements TeamApi {
return users;
}
}

function readIdentityData(identityData: IdentityData): Binary | null {
if (identityData.type === "None" || identityData.type === "Raw0") return null;
if (identityData.type === "Raw1") return Binary.fromBytes(new Uint8Array(identityData.value));
return identityData.value;
}
1,272 changes: 747 additions & 525 deletions yarn.lock

Large diffs are not rendered by default.