File tree Expand file tree Collapse file tree 6 files changed +865
-563
lines changed
Expand file tree Collapse file tree 6 files changed +865
-563
lines changed Original file line number Diff line number Diff line change 11{
2- "version" : " 0.1.0-autogenerated.14257783844949306470 " ,
2+ "version" : " 0.1.0-autogenerated.16713261255167333264 " ,
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 },
Original file line number Diff line number Diff line change @@ -12,4 +12,4 @@ outputs:
1212
1313runs :
1414 using : ' docker'
15- image : ' docker://ghcr.io/paritytech/get-fellows-action/action:1.2 .0'
15+ image : ' docker://ghcr.io/paritytech/get-fellows-action/action:1.3 .0'
Original file line number Diff line number Diff line change 11{
22 "name" : " get-fellows-action" ,
3- "version" : " 1.2 .0" ,
3+ "version" : " 1.3 .0" ,
44 "description" : " Fetch all the GitHub handles from the Fellows" ,
55 "main" : " src/index.ts" ,
66 "scripts" : {
2525 "dependencies" : {
2626 "@actions/core" : " ^1.10.1" ,
2727 "@actions/github" : " ^5.1.1" ,
28- "@polkadot-api/descriptors" : " file :.papi/descriptors" ,
29- "polkadot-api" : " ^0.12.0 " ,
30- "smoldot" : " 2.0.29 "
28+ "@polkadot-api/descriptors" : " portal :.papi/descriptors" ,
29+ "polkadot-api" : " ^1.8.2 " ,
30+ "smoldot" : " ^ 2.0.34 "
3131 },
3232 "devDependencies" : {
3333 "@eng-automation/js-style" : " ^3.1.0" ,
Original file line number Diff line number Diff line change 1- import { collectives , people } from "@polkadot-api/descriptors" ;
2- import { createClient , SS58String } from "polkadot-api" ;
1+ import { collectives , IdentityData , people } from "@polkadot-api/descriptors" ;
2+ import { Binary , createClient , SS58String } from "polkadot-api" ;
33import { chainSpec as polkadotChainSpec } from "polkadot-api/chains/polkadot" ;
44import { chainSpec as collectivesChainSpec } from "polkadot-api/chains/polkadot_collectives" ;
55import { chainSpec as peopleChainSpec } from "polkadot-api/chains/polkadot_people" ;
@@ -51,7 +51,7 @@ export const fetchAllFellows = async (
5151
5252 if ( identityOf ) {
5353 const [ identity ] = identityOf ;
54- const github = identity . info . github . value ;
54+ const github = readIdentityData ( identity . info . github ) ;
5555
5656 if ( ! github ) {
5757 logger . debug (
@@ -139,3 +139,10 @@ export const fetchAllFellows = async (
139139 await smoldot . terminate ( ) ;
140140 }
141141} ;
142+
143+ function readIdentityData ( identityData : IdentityData ) : Binary | null {
144+ if ( identityData . type === "None" || identityData . type === "Raw0" ) return null ;
145+ if ( identityData . type === "Raw1" )
146+ return Binary . fromBytes ( new Uint8Array ( identityData . value ) ) ;
147+ return identityData . value ;
148+ }
Original file line number Diff line number Diff line change @@ -14,5 +14,11 @@ describe("Fellows test", () => {
1414 test ( "Should fetch fellows" , async ( ) => {
1515 const members = await fetchAllFellows ( logger ) ;
1616 expect ( members . length ) . toBeGreaterThan ( 0 ) ;
17+ expect ( members ) . toContainEqual (
18+ expect . objectContaining ( {
19+ rank : 7 ,
20+ githubHandle : "gavofyork" ,
21+ } ) ,
22+ ) ;
1723 } , 60_000 ) ;
1824} ) ;
You can’t perform that action at this time.
0 commit comments