From d550fbf3f2fd06dc9ade71d48a9ee953417736ac Mon Sep 17 00:00:00 2001 From: Javier Bullrich Date: Thu, 14 Mar 2024 10:44:31 +0100 Subject: [PATCH] linted project --- src/fellows.ts | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/src/fellows.ts b/src/fellows.ts index 3ec62c2..b4fc7b7 100644 --- a/src/fellows.ts +++ b/src/fellows.ts @@ -1,3 +1,4 @@ +/* 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"; @@ -9,8 +10,13 @@ import collectiveDescriptor from "./codegen/collectives"; import relayDescriptor from "./codegen/relay"; import { ActionLogger } from "./github/types"; -const collectiveChain = require("@substrate/connect-known-chains/polkadot_collectives"); -const polkadot = require("@substrate/connect-known-chains/polkadot") +const collectiveChain = + require("@substrate/connect-known-chains/polkadot_collectives") as { + chainSpec: string; + }; +const polkadot = require("@substrate/connect-known-chains/polkadot") as { + chainSpec: string; +}; type FellowData = { address: string; rank: number }; @@ -20,26 +26,30 @@ export type FellowObject = { rank: number; }; -export const fetchAllFellows = async (logger: ActionLogger): Promise => { +export const fetchAllFellows = async ( + logger: ActionLogger, +): Promise => { logger.info("Initializing smoldot"); const smoldot = start(); const SmProvider = getSmProvider(smoldot); let polkadotClient: ReturnType | null = null; try { - const relayChain = await smoldot.addChain({ chainSpec: polkadot.chainSpec }) + const relayChain = await smoldot.addChain({ + chainSpec: polkadot.chainSpec, + }); logger.debug("Connecting to collective parachain"); await smoldot.addChain({ chainSpec: collectiveChain.chainSpec, - potentialRelayChains: [relayChain] - }) + potentialRelayChains: [relayChain], + }); logger.info("Initializing PAPI"); polkadotClient = createClient( getChain({ provider: SmProvider({ potentialRelayChains: [relayChain], - chainSpec: collectiveChain.chainSpec + chainSpec: collectiveChain.chainSpec, }), keyring: [], }), @@ -61,25 +71,28 @@ export const fetchAllFellows = async (logger: ActionLogger): Promise