File tree Expand file tree Collapse file tree 5 files changed +863
-561
lines changed Expand file tree Collapse file tree 5 files changed +863
-561
lines changed Original file line number Diff line number Diff line change 1
1
{
2
- "version" : " 0.1.0-autogenerated.14257783844949306470 " ,
2
+ "version" : " 0.1.0-autogenerated.16713261255167333264 " ,
3
3
"name" : " @polkadot-api/descriptors" ,
4
4
"files" : [
5
5
" dist"
6
6
],
7
7
"exports" : {
8
8
"." : {
9
+ "types" : " ./dist/index.d.ts" ,
9
10
"module" : " ./dist/index.mjs" ,
10
11
"import" : " ./dist/index.mjs" ,
11
- "require" : " ./dist/index.js" ,
12
- "default" : " ./dist/index.js"
12
+ "require" : " ./dist/index.js"
13
13
},
14
14
"./package.json" : " ./package.json"
15
15
},
Original file line number Diff line number Diff line change 25
25
"dependencies" : {
26
26
"@actions/core" : " ^1.10.1" ,
27
27
"@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 "
31
31
},
32
32
"devDependencies" : {
33
33
"@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" ;
3
3
import { chainSpec as polkadotChainSpec } from "polkadot-api/chains/polkadot" ;
4
4
import { chainSpec as collectivesChainSpec } from "polkadot-api/chains/polkadot_collectives" ;
5
5
import { chainSpec as peopleChainSpec } from "polkadot-api/chains/polkadot_people" ;
@@ -51,7 +51,7 @@ export const fetchAllFellows = async (
51
51
52
52
if ( identityOf ) {
53
53
const [ identity ] = identityOf ;
54
- const github = identity . info . github . value ;
54
+ const github = readIdentityData ( identity . info . github ) ;
55
55
56
56
if ( ! github ) {
57
57
logger . debug (
@@ -139,3 +139,10 @@ export const fetchAllFellows = async (
139
139
await smoldot . terminate ( ) ;
140
140
}
141
141
} ;
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", () => {
14
14
test ( "Should fetch fellows" , async ( ) => {
15
15
const members = await fetchAllFellows ( logger ) ;
16
16
expect ( members . length ) . toBeGreaterThan ( 0 ) ;
17
+ expect ( members ) . toContainEqual (
18
+ expect . objectContaining ( {
19
+ rank : 7 ,
20
+ githubHandle : "gavofyork" ,
21
+ } ) ,
22
+ ) ;
17
23
} , 60_000 ) ;
18
24
} ) ;
You can’t perform that action at this time.
0 commit comments