Skip to content

Commit

Permalink
fixed required import from substrate/connect-known-chains
Browse files Browse the repository at this point in the history
Thank you @kratico for providing a fix so quickly!
  • Loading branch information
Bullrich committed Mar 14, 2024
1 parent fde2709 commit 0d516c1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@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",
"@substrate/connect-known-chains": "^1.1.1",
"@substrate/connect-known-chains": "^1.1.2",
"smoldot": "^2.0.22"
},
"devDependencies": {
Expand Down
22 changes: 9 additions & 13 deletions src/fellows.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable @typescript-eslint/ban-ts-comment */
import { createClient } from "@polkadot-api/client";
import { getChain } from "@polkadot-api/node-polkadot-provider";
import { getSmProvider } from "@polkadot-api/sm-provider";
import {
polkadot,
polkadot_collectives,
} from "@substrate/connect-known-chains";
import { start } from "smoldot";

import collectiveDescriptor from "./codegen/collectives";
import relayDescriptor from "./codegen/relay";
import { ActionLogger } from "./github/types";

const collectiveChain =
require("@substrate/connect-known-chains/polkadot_collectives") as {
chainSpec: string;
};
const polkadot = require("@substrate/connect-known-chains/polkadot") as {
chainSpec: string;
};
console.log("chain data", polkadot);

type FellowData = { address: string; rank: number };

Expand All @@ -35,11 +31,11 @@ export const fetchAllFellows = async (

try {
const relayChain = await smoldot.addChain({
chainSpec: polkadot.chainSpec,
chainSpec: polkadot,
});
logger.debug("Connecting to collective parachain");
await smoldot.addChain({
chainSpec: collectiveChain.chainSpec,
chainSpec: polkadot_collectives,
potentialRelayChains: [relayChain],
});

Expand All @@ -48,7 +44,7 @@ export const fetchAllFellows = async (
getChain({
provider: SmProvider({
potentialRelayChains: [relayChain],
chainSpec: collectiveChain.chainSpec,
chainSpec: polkadot_collectives,
}),
keyring: [],
}),
Expand Down Expand Up @@ -77,7 +73,7 @@ export const fetchAllFellows = async (
getChain({
provider: SmProvider({
potentialRelayChains: [relayChain],
chainSpec: polkadot.chainSpec,
chainSpec: polkadot,
}),
keyring: [],
}),
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,11 @@
resolved "https://registry.yarnpkg.com/@substrate/connect-known-chains/-/connect-known-chains-1.1.1.tgz#a3d5fadb72e959447a4b50896293437a78ce6ab7"
integrity sha512-EA3r8lyYKEfVjWqkJnxzE9maVTf14XBzhxfAYJAcdNbaA2aylw/TRL3pLydMs7Dad+oUycGIdmPRDoA/O1cWUg==

"@substrate/connect-known-chains@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@substrate/connect-known-chains/-/connect-known-chains-1.1.2.tgz#987952dd46a87485285b4fd74a3d3051efe90181"
integrity sha512-XvyemTVqon+6EF2G7QL0fEXxjuz3nUNFgFV0TSWhSVpPb+Sfs+vfipbEZxGNouxvjCoJdr6CF0rwgGsrrKOnAA==

"@substrate/connect@^0.7.32":
version "0.7.35"
resolved "https://registry.yarnpkg.com/@substrate/connect/-/connect-0.7.35.tgz#853d8ff50717a8c9ee8f219d11a86e61a54b88b8"
Expand Down

0 comments on commit 0d516c1

Please sign in to comment.