Skip to content

Commit

Permalink
upgraded papi to latest (#18)
Browse files Browse the repository at this point in the history
Relates to #9.

Upgraded `papi` to latest version which implements:
- polkadot-api/polkadot-api#325
- polkadot-api/polkadot-api#328
  • Loading branch information
Bullrich authored Mar 18, 2024
1 parent d1ee5d0 commit eba591d
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 130 deletions.
1 change: 1 addition & 0 deletions .github/workflows/get-fellows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
jobs:
mention-fellows:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: paritytech/get-fellows-action@main
id: fellows
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ on: [push]
jobs:
mention-fellows:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: paritytech/get-fellows-action
id: fellows
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "node dist",
"build": "ncc build --license LICENSE",
"postinstall": "papi",
"test": "jest --forceExit",
"test": "jest",
"fix": "eslint --fix 'src/**/*'",
"lint": "eslint 'src/**/*'"
},
Expand All @@ -25,10 +25,10 @@
"@actions/core": "^1.10.1",
"@actions/github": "^5.1.1",
"@octokit/webhooks-types": "^7.3.1",
"@polkadot-api/cli": "^0.0.1-a88cc12e054d60b3c599baf69bf41b99204e053d.1.0",
"@polkadot-api/client": "^0.0.1-a88cc12e054d60b3c599baf69bf41b99204e053d.1.0",
"@polkadot-api/node-polkadot-provider": "^0.0.1-a88cc12e054d60b3c599baf69bf41b99204e053d.1.0",
"@polkadot-api/sm-provider": "^0.0.1-2ade456e6ac9a1106b115cb8f44eed4f897e6017.1.0",
"@polkadot-api/cli": "^0.0.1-b0f30456ec8e18fce96b1a2a2a9f7418a4f5b837.1.0",
"@polkadot-api/client": "^0.0.1-b0f30456ec8e18fce96b1a2a2a9f7418a4f5b837.1.0",
"@polkadot-api/node-polkadot-provider": "^0.0.1-b0f30456ec8e18fce96b1a2a2a9f7418a4f5b837.1.0",
"@polkadot-api/sm-provider": "^0.0.1-b0f30456ec8e18fce96b1a2a2a9f7418a4f5b837.1.0",
"@substrate/connect-known-chains": "^1.1.2",
"smoldot": "^2.0.22"
},
Expand Down
19 changes: 10 additions & 9 deletions src/fellows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export const fetchAllFellows = async (
): Promise<FellowObject[]> => {
logger.info("Initializing smoldot");
const smoldot = start();
const SmProvider = getSmProvider(smoldot);

// TODO: Replace once https://github.com/paritytech/opstooling/discussions/373 is fixed
let polkadotClient: ReturnType<typeof createClient> | null = null;
Expand All @@ -39,13 +38,14 @@ export const fetchAllFellows = async (
potentialRelayChains: [relayChain],
});

const SmProviderCollectives = getSmProvider(smoldot, {
potentialRelayChains: [relayChain],
chainSpec: polkadot_collectives,
});
logger.info("Initializing PAPI");
polkadotClient = createClient(
getChain({
provider: SmProvider({
potentialRelayChains: [relayChain],
chainSpec: polkadot_collectives,
}),
provider: SmProviderCollectives,
keyring: [],
}),
);
Expand All @@ -72,12 +72,13 @@ export const fetchAllFellows = async (
logger.debug("Connecting to relay parachain.");

// We move into the relay chain
const SmProviderRelay = getSmProvider(smoldot, {
potentialRelayChains: [relayChain],
chainSpec: polkadot,
});
polkadotClient = createClient(
getChain({
provider: SmProvider({
potentialRelayChains: [relayChain],
chainSpec: polkadot,
}),
provider: SmProviderRelay,
keyring: [],
}),
);
Expand Down
12 changes: 2 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,7 @@ const mapFellows = async (fellows: FellowObject[]) => {
}
}

await summary.addHeading("Fellows").addTable(table).write();

// TODO: Remove this once https://github.com/polkadot-api/polkadot-api/issues/327 is fixed
process.exit(0);
return await summary.addHeading("Fellows").addTable(table).write();
};

fetchAllFellows(logger)
.then(mapFellows)
.catch((err) => {
setFailed(err as Error);
process.exit(1);
});
fetchAllFellows(logger).then(mapFellows).catch(setFailed);
Loading

0 comments on commit eba591d

Please sign in to comment.