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

upgraded papi to latest #18

Merged
merged 7 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
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
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
Loading