From 0fc4e5ec00304d72250a74049a38b7e7edfadd51 Mon Sep 17 00:00:00 2001 From: Tim B <79199034+timbrinded@users.noreply.github.com> Date: Wed, 31 Jan 2024 17:49:22 +0000 Subject: [PATCH] Replace linters (#368) * replaced fmt for type pkg * Replaced Prettier * fix lockfile * schema formatted * small fixes * new rpc endpoints * lint on util and types * fix solidity contracts * starting CLI pkg linting * cli lint progress * finished delinting internal fns * delinted globalContext * delinted cli * fixed procs * pkg updates * fix create block --- .changeset/gentle-pianos-own.md | 8 + .eslintrc.cjs | 29 - .github/workflows/main.yml | 2 +- CONTRIBUTIONS.md | 2 +- biome.json | 31 + package.json | 14 +- packages/cli/biome.json | 4 + packages/cli/package.json | 32 +- packages/cli/src/cmds/entrypoint.ts | 14 +- .../cmds/interactiveCmds/chopsticksIntCmds.ts | 19 +- .../src/cmds/interactiveCmds/devIntCmds.ts | 16 +- .../src/cmds/interactiveCmds/zombieIntCmds.ts | 33 +- packages/cli/src/cmds/main.ts | 56 +- packages/cli/src/cmds/runNetwork.ts | 119 +- packages/cli/src/cmds/runTests.ts | 53 +- .../src/internal/cmdFunctions/downloader.ts | 4 +- .../internal/cmdFunctions/fetchArtifact.ts | 29 +- .../internal/cmdFunctions/initialisation.ts | 7 +- .../cli/src/internal/cmdFunctions/tempLogs.ts | 9 +- packages/cli/src/internal/commandParsers.ts | 27 +- packages/cli/src/internal/fileCheckers.ts | 19 +- .../internal/foundations/chopsticksHelpers.ts | 54 +- .../internal/foundations/devModeHelpers.ts | 61 +- .../src/internal/foundations/zombieHelpers.ts | 23 +- packages/cli/src/internal/launcherCommon.ts | 16 +- packages/cli/src/internal/localNode.ts | 20 +- packages/cli/src/internal/logging.ts | 3 +- packages/cli/src/internal/nodePool.ts | 18 - .../cli/src/internal/providerFactories.ts | 46 +- packages/cli/src/lib/binariesHelpers.ts | 13 +- packages/cli/src/lib/configReader.ts | 72 +- packages/cli/src/lib/contractFunctions.ts | 66 +- packages/cli/src/lib/globalContext.ts | 108 +- packages/cli/src/lib/governanceProcedures.ts | 97 +- .../cli/src/lib/handlers/chopsticksHandler.ts | 28 +- packages/cli/src/lib/handlers/devHandler.ts | 38 +- .../cli/src/lib/handlers/readOnlyHandler.ts | 5 +- .../cli/src/lib/handlers/zombieHandler.ts | 13 +- .../cli/src/lib/repoDefinitions/tanssi.ts | 5 +- packages/cli/src/lib/rpcFunctions.ts | 5 +- packages/cli/src/lib/runnerContext.ts | 42 +- packages/cli/src/lib/upgradeProcedures.ts | 74 +- packages/types/biome.json | 4 + packages/types/config_schema.json | 1340 +++++++------ packages/types/package.json | 15 +- packages/types/src/config.ts | 2 +- packages/types/src/context.ts | 6 +- packages/types/src/runner.ts | 23 +- packages/util/biome.json | 4 + packages/util/package.json | 22 +- packages/util/src/classes/eth-tester.ts | 82 +- packages/util/src/constants/accounts.ts | 5 +- packages/util/src/constants/chain.ts | 8 +- packages/util/src/constants/smartContract.ts | 28 +- packages/util/src/functions/block.ts | 31 +- packages/util/src/functions/common.ts | 37 +- packages/util/src/functions/contracts.ts | 9 +- packages/util/src/functions/ethers.ts | 37 +- packages/util/src/functions/jumping.ts | 16 +- packages/util/src/functions/logging.ts | 12 +- packages/util/src/functions/providers.ts | 18 +- packages/util/src/functions/viem.ts | 50 +- pnpm-lock.yaml | 1737 ++++++----------- test/biome.json | 7 + test/moonwall.config.json | 17 +- test/package.json | 8 +- test/scripts/compile-contracts.ts | 37 +- .../fast-execute-chopstick-proposal.ts | 4 +- 68 files changed, 2344 insertions(+), 2549 deletions(-) create mode 100644 .changeset/gentle-pianos-own.md delete mode 100644 .eslintrc.cjs create mode 100644 biome.json create mode 100644 packages/cli/biome.json delete mode 100644 packages/cli/src/internal/nodePool.ts create mode 100644 packages/types/biome.json create mode 100644 packages/util/biome.json create mode 100644 test/biome.json diff --git a/.changeset/gentle-pianos-own.md b/.changeset/gentle-pianos-own.md new file mode 100644 index 00000000..b44ccd5c --- /dev/null +++ b/.changeset/gentle-pianos-own.md @@ -0,0 +1,8 @@ +--- +"@moonwall/types": patch +"@moonwall/util": patch +"@moonwall/cli": patch +"@moonwall/tests": patch +--- + +Linter and Pkg Updates diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index cd130b37..00000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,29 +0,0 @@ -module.exports = { - env: { - es2021: true, - node: true, - }, - extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"], - overrides: [ - { - env: { - node: true, - }, - files: [".eslintrc.{js,cjs}"], - parserOptions: { - sourceType: "script", - }, - }, - ], - parser: "@typescript-eslint/parser", - parserOptions: { - ecmaVersion: "latest", - sourceType: "module", - }, - plugins: ["@typescript-eslint"], - rules: { - "@typescript-eslint/ban-ts-comment": "off", - "@typescript-eslint/no-explicit-any": "off", - "no-async-promise-executor": "off", - }, -}; diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 70d701a9..ea338337 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -200,7 +200,7 @@ jobs: - uses: oven-sh/setup-bun@v1 with: bun-version: latest - - name: Run standard ${{matrix.suite}}} + - name: Run standard ${{matrix.suite}} run: | cd test bun moonwall test ${{matrix.suite}} diff --git a/CONTRIBUTIONS.md b/CONTRIBUTIONS.md index 3bb0b29a..5880d5c4 100644 --- a/CONTRIBUTIONS.md +++ b/CONTRIBUTIONS.md @@ -5,7 +5,7 @@ 1. Do all the changes you want on a user-branch 2. Run as many tests until you're happy -3. Run `prettier` +3. Run `fmt:fix` 4. Commit changes and push to GitHub 5. Raise PR with additional details if required diff --git a/biome.json b/biome.json new file mode 100644 index 00000000..69bafe76 --- /dev/null +++ b/biome.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.5.3/schema.json", + "files": { + "include": ["*.js", "*.ts", "*.json", "*.yml", "*.md"], + "ignore": ["./dist/*", "./node_modules/*"] + }, + "organizeImports": { + "enabled": false + }, + "formatter": { + "enabled": true + }, + "javascript": { + "formatter": { + "trailingComma": "es5", + "semicolons": "always", + "indentStyle": "space", + "lineWidth": 100 + } + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "suspicious": { + "noExplicitAny": "off", + "noAsyncPromiseExecutor": "off" + } + } + } +} diff --git a/package.json b/package.json index cc653c22..45f89115 100644 --- a/package.json +++ b/package.json @@ -8,9 +8,8 @@ "scripts": { "build": "pnpm -r --filter='./packages/**' run build", "generate-types": "pnpm -r --filter='./packages/**' run generate-types", - "prettier": "pnpm exec prettier --write --ignore-path .gitignore '**/*.(yml|js|ts|json)'", - "fmt": "pnpm -r --filter='./packages/**' run fmt", - "fmt:fix": "pnpm -r --filter='./packages/**' run fmt:fix", + "fmt": "biome format ./biome.json; pnpm -r --filter='./packages/**' run fmt", + "fmt:fix": "biome format ./biome.json --write; pnpm -r --filter='./packages/**' run fmt:fix", "lint": "pnpm -r --filter='./packages/**' run lint", "lint:fix": "pnpm -r --filter='./packages/**' run lint:fix", "changeset": "changeset", @@ -24,15 +23,8 @@ "typecheck": "pnpm -r --filter='./packages/**' run typecheck" }, "devDependencies": { + "@biomejs/biome": "1.5.3", "@changesets/cli": "2.27.1", - "@pnpm/eslint-config": "1.1.0", - "@typescript-eslint/eslint-plugin": "6.19.0", - "@typescript-eslint/parser": "6.19.0", - "eslint": "8.56.0", - "eslint-config-prettier": "9.1.0", - "eslint-config-xo": "0.43.1", - "eslint-config-xo-typescript": "1.0.1", - "prettier": "3.2.4", "typescript": "5.3.3" } } diff --git a/packages/cli/biome.json b/packages/cli/biome.json new file mode 100644 index 00000000..7b188232 --- /dev/null +++ b/packages/cli/biome.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.5.3/schema.json", + "extends": ["../../biome.json"] +} diff --git a/packages/cli/package.json b/packages/cli/package.json index 2153d652..68b38205 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -52,17 +52,17 @@ "scripts": { "clean": "rm -rf dist && rm -rf node_modules", "build": "pnpm exec rm -rf dist && tsup src --format cjs,esm && pnpm generate-types", - "lint": "eslint ./src/**/*.ts", - "lint:fix": "eslint './src/**/*.ts' --fix", - "fmt": "pnpm prettier --check --ignore-path ../../.prettierignore '**/*.(yml|js|ts|json)'", - "fmt:fix": "pnpm prettier --write --ignore-path ../../.prettierignore '**/*.(yml|js|ts|json)'", + "lint": "pnpm biome lint ./src", + "lint:fix": "pnpm biome lint ./src --apply", + "fmt": "biome format .", + "fmt:fix": "biome format . --write", "generate-types": "tsup src --format cjs,esm --dts ", "watch": "tsup src --format cjs,esm --dts --watch", "typecheck": "pnpm exec tsc --noEmit", "prepublish": "pnpm run build && pnpm run generate-types" }, "dependencies": { - "@acala-network/chopsticks": "0.9.7", + "@acala-network/chopsticks": "0.9.8", "@moonbeam-network/api-augment": "0.2700.0", "@moonwall/types": "workspace:*", "@moonwall/util": "workspace:*", @@ -73,7 +73,7 @@ "@polkadot/types-codec": "10.11.2", "@polkadot/util": "12.6.2", "@polkadot/util-crypto": "12.6.2", - "@vitest/ui": "1.2.1", + "@vitest/ui": "1.2.2", "@zombienet/orchestrator": "0.0.68", "@zombienet/utils": "0.0.24", "bottleneck": "2.19.5", @@ -82,17 +82,17 @@ "cli-progress": "3.12.0", "colors": "1.4.0", "debug": "4.3.4", - "dotenv": "16.3.2", + "dotenv": "16.4.1", "ethers": "6.10.0", "get-port": "^7.0.0", - "inquirer": "9.2.12", + "inquirer": "9.2.13", "inquirer-press-to-continue": "1.2.0", - "jsonc-parser": "3.2.0", + "jsonc-parser": "3.2.1", "minimatch": "9.0.3", "node-fetch": "3.3.2", "semver": "7.5.4", - "viem": "2.4.1", - "vitest": "1.2.1", + "viem": "2.7.1", + "vitest": "1.2.2", "web3": "4.4.0", "web3-providers-ws": "^4.0.7", "ws": "8.16.0", @@ -100,19 +100,19 @@ "yargs": "17.7.2" }, "peerDependencies": { - "@acala-network/chopsticks": "0.9.7", + "@acala-network/chopsticks": "0.9.8", "@polkadot/api": "10.11.2", - "@vitest/ui": "1.2.1", - "vitest": "1.2.1" + "@vitest/ui": "1.2.2", + "vitest": "1.2.2" }, "devDependencies": { + "@biomejs/biome": "1.5.3", "@types/clear": "^0.1.4", "@types/cli-progress": "3.11.5", "@types/debug": "4.1.12", - "@types/node": "20.11.5", + "@types/node": "20.11.13", "@types/ws": "^8.5.10", "@types/yargs": "17.0.32", - "prettier": "3.2.4", "tsup": "8.0.1", "tsx": "4.7.0", "typescript": "5.3.3" diff --git a/packages/cli/src/cmds/entrypoint.ts b/packages/cli/src/cmds/entrypoint.ts index 6957eda4..43092701 100755 --- a/packages/cli/src/cmds/entrypoint.ts +++ b/packages/cli/src/cmds/entrypoint.ts @@ -37,11 +37,11 @@ yargs(hideBin(process.argv)) .middleware((argv) => { process.env.MOON_CONFIG_PATH = argv.configFile; }) - .command(`init`, "Run tests for a given Environment", async () => { + .command("init", "Run tests for a given Environment", async () => { await generateConfig(); }) .command( - `download [ver] [path]`, + "download [ver] [path]", "Download x86 artifact from GitHub", (yargs) => { return yargs @@ -74,7 +74,7 @@ yargs(hideBin(process.argv)) } ) .command( - `test [GrepTest]`, + "test [GrepTest]", "Run tests for a given Environment", (yargs) => { return yargs @@ -91,7 +91,11 @@ yargs(hideBin(process.argv)) async (args) => { if (args.envName) { process.env.MOON_RUN_SCRIPTS = "true"; - if (!(await testCmd(args.envName.toString(), { testNamePattern: args.GrepTest }))) { + if ( + !(await testCmd(args.envName.toString(), { + testNamePattern: args.GrepTest, + })) + ) { process.exitCode = 1; } } else { @@ -102,7 +106,7 @@ yargs(hideBin(process.argv)) } ) .command( - `run [GrepTest]`, + "run [GrepTest]", "Start new network found in global config", (yargs) => { return yargs diff --git a/packages/cli/src/cmds/interactiveCmds/chopsticksIntCmds.ts b/packages/cli/src/cmds/interactiveCmds/chopsticksIntCmds.ts index bcdf0b1a..a46bdf4f 100644 --- a/packages/cli/src/cmds/interactiveCmds/chopsticksIntCmds.ts +++ b/packages/cli/src/cmds/interactiveCmds/chopsticksIntCmds.ts @@ -1,14 +1,13 @@ import { promises as fsPromises } from "fs"; import inquirer from "inquirer"; import { parse } from "yaml"; -import { importJsonConfig } from "../../lib/configReader"; +import { getEnvironmentFromConfig } from "../../lib/configReader"; import { MoonwallContext } from "../../lib/globalContext"; import type { ApiPromise } from "@polkadot/api"; import { jumpBlocksChopsticks, jumpRoundsChopsticks, jumpToRoundChopsticks } from "@moonwall/util"; export async function resolveChopsticksInteractiveCmdChoice() { - const globalConfig = importJsonConfig(); - const config = globalConfig.environments.find(({ name }) => name == process.env.MOON_TEST_ENV)!; + const config = getEnvironmentFromConfig(); if (config.foundation.type !== "chopsticks") { throw new Error("Only chopsticks is supported, this is a bug please raise an issue."); @@ -26,7 +25,7 @@ export async function resolveChopsticksInteractiveCmdChoice() { name: "name", type: "list", choices: nodes, - message: `Which network would you like to interact with? `, + message: "Which network would you like to interact with? ", }); return result.name; @@ -35,7 +34,7 @@ export async function resolveChopsticksInteractiveCmdChoice() { const nodeSelected = isMultiChain ? await promptNode() : config.foundation.launchSpec[0].name; const ctx = await (await MoonwallContext.getContext()).connectEnvironment(); - const provider = ctx.providers.find((a) => a.type == "polkadotJs" && a.name == nodeSelected); + const provider = ctx.providers.find((a) => a.type === "polkadotJs" && a.name === nodeSelected); if (!provider) { throw new Error( @@ -47,7 +46,7 @@ export async function resolveChopsticksInteractiveCmdChoice() { const ports = await Promise.all( config.foundation.launchSpec - .filter(({ name }) => name == nodeSelected) + .filter(({ name }) => name === nodeSelected) .map(async ({ configPath }) => { const yaml = parse((await fsPromises.readFile(configPath)).toString()); return (yaml.port as string) || "8000"; @@ -84,7 +83,7 @@ export async function resolveChopsticksInteractiveCmdChoice() { name: "cmd", type: "list", choices, - message: `What command would you like to run? `, + message: "What command would you like to run? ", default: "createBlock", }); @@ -97,7 +96,7 @@ export async function resolveChopsticksInteractiveCmdChoice() { const result = await new inquirer.prompt({ name: "n", type: "number", - message: `How many blocks? `, + message: "How many blocks? ", }); await jumpBlocksChopsticks(port, result.n); @@ -109,7 +108,7 @@ export async function resolveChopsticksInteractiveCmdChoice() { const result = await new inquirer.prompt({ name: "round", type: "number", - message: `Which round to jump to (in future)? `, + message: "Which round to jump to (in future)? ", }); console.log("💤 This may take a while...."); await jumpToRoundChopsticks(api, port, result.round); @@ -120,7 +119,7 @@ export async function resolveChopsticksInteractiveCmdChoice() { const result = await new inquirer.prompt({ name: "n", type: "number", - message: `How many rounds? `, + message: "How many rounds? ", }); console.log("💤 This may take a while...."); await jumpRoundsChopsticks(api, port, result.n); diff --git a/packages/cli/src/cmds/interactiveCmds/devIntCmds.ts b/packages/cli/src/cmds/interactiveCmds/devIntCmds.ts index 220b456c..ae0432cb 100644 --- a/packages/cli/src/cmds/interactiveCmds/devIntCmds.ts +++ b/packages/cli/src/cmds/interactiveCmds/devIntCmds.ts @@ -5,7 +5,13 @@ import { jumpRoundsDev, jumpToRoundDev } from "@moonwall/util"; export async function resolveDevInteractiveCmdChoice() { const ctx = await (await MoonwallContext.getContext()).connectEnvironment(); - const api = ctx.providers.find((a) => a.type == "polkadotJs")!.api as ApiPromise; + + const prov = ctx.providers.find((a) => a.type === "polkadotJs"); + + if (!prov) { + throw new Error("Provider not found. This is a bug, please raise an issue."); + } + const api = prov.api as ApiPromise; const choices = [ { name: "🆗 Create Block", value: "createblock" }, { name: "🆕 Create Unfinalized Block", value: "createUnfinalizedBlock" }, @@ -36,7 +42,7 @@ export async function resolveDevInteractiveCmdChoice() { name: "cmd", type: "list", choices, - message: `What command would you like to run? `, + message: "What command would you like to run? ", default: "createBlock", }); @@ -53,7 +59,7 @@ export async function resolveDevInteractiveCmdChoice() { const result = await new inquirer.prompt({ name: "n", type: "number", - message: `How many blocks? `, + message: "How many blocks? ", }); const executeSequentially = async (remaining: number) => { @@ -72,7 +78,7 @@ export async function resolveDevInteractiveCmdChoice() { const result = await new inquirer.prompt({ name: "round", type: "number", - message: `Which round to jump to (in future)? `, + message: "Which round to jump to (in future)? ", }); await jumpToRoundDev(api, result.round); @@ -83,7 +89,7 @@ export async function resolveDevInteractiveCmdChoice() { const result = await new inquirer.prompt({ name: "n", type: "number", - message: `How many rounds? `, + message: "How many rounds? ", }); await jumpRoundsDev(api, result.n); diff --git a/packages/cli/src/cmds/interactiveCmds/zombieIntCmds.ts b/packages/cli/src/cmds/interactiveCmds/zombieIntCmds.ts index 4b3a8139..ffbf4e31 100644 --- a/packages/cli/src/cmds/interactiveCmds/zombieIntCmds.ts +++ b/packages/cli/src/cmds/interactiveCmds/zombieIntCmds.ts @@ -15,25 +15,24 @@ export async function resolveZombieInteractiveCmdChoice() { default: "back", }); - if (choice.cmd == "back") { + if (choice.cmd === "back") { return; - } else { - const whichNode = await inquirer.prompt({ - name: "nodeName", - type: "input", - message: `Which node would you like to ${choice.cmd}? `, - }); + } + const whichNode = await inquirer.prompt({ + name: "nodeName", + type: "input", + message: `Which node would you like to ${choice.cmd}? `, + }); - try { - await sendIpcMessage({ - cmd: choice.cmd, - nodeName: whichNode.nodeName, - text: `Running ${choice.cmd} on ${whichNode.nodeName}`, - }); - } catch (e: any) { - console.error("Error: "); - console.error(e.message); - } + try { + await sendIpcMessage({ + cmd: choice.cmd, + nodeName: whichNode.nodeName, + text: `Running ${choice.cmd} on ${whichNode.nodeName}`, + }); + } catch (e: any) { + console.error("Error: "); + console.error(e.message); } return; diff --git a/packages/cli/src/cmds/main.ts b/packages/cli/src/cmds/main.ts index 40e61b52..e673698d 100644 --- a/packages/cli/src/cmds/main.ts +++ b/packages/cli/src/cmds/main.ts @@ -31,12 +31,10 @@ export async function main() { await printIntro(); if (await mainMenu(globalConfig)) { break; - } else { - continue; } } - process.stdout.write(`Goodbye! 👋\n`); + process.stdout.write("Goodbye! 👋\n"); } async function mainMenu(config?: MoonwallConfig) { @@ -44,7 +42,7 @@ async function mainMenu(config?: MoonwallConfig) { const questionList = { name: "MenuChoice", type: "list", - message: `Main Menu - Please select one of the following:`, + message: "Main Menu - Please select one of the following:", default: 0, pageSize: 12, choices: !configPresent @@ -60,17 +58,17 @@ async function mainMenu(config?: MoonwallConfig) { value: "download", }, { - name: `3) Quit Application`, + name: "3) Quit Application", value: "quit", }, ] : [ { - name: `1) Execute Script: Run scripts placed in your config defined script directory`, + name: "1) Execute Script: Run scripts placed in your config defined script directory", value: "exec", }, { - name: `2) Network Launcher & Toolbox: Launch network, access tools: tail logs, interactive tests etc`, + name: "2) Network Launcher & Toolbox: Launch network, access tools: tail logs, interactive tests etc", value: "run", }, { @@ -83,7 +81,7 @@ async function mainMenu(config?: MoonwallConfig) { value: "download", }, { - name: `5) Quit Application`, + name: "5) Quit Application", value: "quit", }, ], @@ -100,7 +98,11 @@ async function mainMenu(config?: MoonwallConfig) { await createFolders(); return false; case "run": { - const chosenRunEnv = await chooseRunEnv(config!); + if (!config) { + throw new Error("Config not defined, this is a defect please raise it."); + } + + const chosenRunEnv = await chooseRunEnv(config); process.env.MOON_RUN_SCRIPTS = "true"; if (chosenRunEnv.envName !== "back") { await runNetworkCmd(chosenRunEnv); @@ -108,7 +110,11 @@ async function mainMenu(config?: MoonwallConfig) { return true; } case "test": { - const chosenTestEnv = await chooseTestEnv(config!); + if (!config) { + throw new Error("Config not defined, this is a defect please raise it."); + } + + const chosenTestEnv = await chooseTestEnv(config); if (chosenTestEnv.envName !== "back") { process.env.MOON_RUN_SCRIPTS = "true"; await testCmd(chosenTestEnv.envName); @@ -130,8 +136,12 @@ async function mainMenu(config?: MoonwallConfig) { case "quit": return await resolveQuitChoice(); - case "exec": - return await resolveExecChoice(config!); + case "exec": { + if (!config) { + throw new Error("Config not defined, this is a defect please raise it."); + } + return await resolveExecChoice(config); + } default: throw new Error("Invalid choice"); @@ -201,9 +211,8 @@ async function resolveExecChoice(config: MoonwallConfig) { if (result["none-selected"]) { return false; - } else { - continue; } + continue; } for (const script of result.selections) { @@ -222,7 +231,7 @@ async function resolveExecChoice(config: MoonwallConfig) { name: "test complete", type: "press-to-continue", anyKey: true, - pressToContinueMessage: `Press any key to continue...\n`, + pressToContinueMessage: "Press any key to continue...\n", }); return false; } @@ -230,7 +239,7 @@ async function resolveExecChoice(config: MoonwallConfig) { async function resolveDownloadChoice() { const binList = (await allReposAsync()).reduce((acc, curr) => { - acc.push(...curr.binaries.map((bin) => bin.name).flat()); + acc.push(...curr.binaries.flatMap((bin) => bin.name)); acc.push(new inquirer.Separator()); acc.push("Back"); acc.push(new inquirer.Separator()); @@ -241,7 +250,7 @@ async function resolveDownloadChoice() { const firstChoice = await inquirer.prompt({ name: "artifact", type: "list", - message: `Download - which artifact?`, + message: "Download - which artifact?", choices: binList, }); if (firstChoice.artifact === "Back") { @@ -257,7 +266,7 @@ async function resolveDownloadChoice() { name: "binVersion", type: "list", default: "latest", - message: `Download - which version?`, + message: "Download - which version?", choices: [...versions, new inquirer.Separator(), "Back", new inquirer.Separator()], }); @@ -267,7 +276,7 @@ async function resolveDownloadChoice() { const chooseLocation = await inquirer.prompt({ name: "path", type: "input", - message: `Download - where would you like it placed?`, + message: "Download - where would you like it placed?", default: "./tmp", }); @@ -295,7 +304,7 @@ async function resolveDownloadChoice() { name: "NetworkStarted", type: "press-to-continue", anyKey: true, - pressToContinueMessage: `✅ Artifact has been downloaded. Press any key to continue...\n`, + pressToContinueMessage: "✅ Artifact has been downloaded. Press any key to continue...\n", }); return; } @@ -304,7 +313,7 @@ async function resolveDownloadChoice() { const chooseTestEnv = async (config: MoonwallConfig) => { const envs = config.environments .map((a) => ({ - name: `[${a.foundation.type}] ${a.name}${a.description ? ": \t\t" + a.description : ""}`, + name: `[${a.foundation.type}] ${a.name}${a.description ? `: \t\t${a.description}` : ""}`, value: a.name, disabled: false, })) @@ -336,7 +345,7 @@ const chooseRunEnv = async (config: MoonwallConfig) => { a.foundation.type === "zombie" ) { result.name = `[${a.foundation.type}] ${a.name}${ - a.description ? ": \t\t" + a.description : "" + a.description ? `: \t\t${a.description}` : "" }`; } else { result.name = chalk.dim(`[${a.foundation.type}] ${a.name} NO NETWORK TO RUN`); @@ -387,7 +396,8 @@ const printIntro = async () => { const url = "https://api.github.com/repos/moonsong-labs/moonwall/releases"; const resp = await fetch(url); const json = (await resp.json()) as GithubResponse[]; - remoteVersion = json.find((a) => a.tag_name.includes("@moonwall/cli@"))!.tag_name.split("@")[2]; + remoteVersion = + json.find((a) => a.tag_name.includes("@moonwall/cli@"))?.tag_name.split("@")[2] || "unknown"; } catch (error) { remoteVersion = "unknown"; console.error(`Fetch Error: ${error}`); diff --git a/packages/cli/src/cmds/runNetwork.ts b/packages/cli/src/cmds/runNetwork.ts index e1f707db..3540f2a7 100644 --- a/packages/cli/src/cmds/runNetwork.ts +++ b/packages/cli/src/cmds/runNetwork.ts @@ -7,7 +7,12 @@ import PressToContinuePrompt from "inquirer-press-to-continue"; import { parse } from "yaml"; import { clearNodeLogs, reportLogLocation } from "../internal/cmdFunctions/tempLogs"; import { commonChecks } from "../internal/launcherCommon"; -import { cacheConfig, importAsyncConfig, loadEnvVars } from "../lib/configReader"; +import { + cacheConfig, + getEnvironmentFromConfig, + importAsyncConfig, + loadEnvVars, +} from "../lib/configReader"; import { MoonwallContext, runNetworkOnly } from "../lib/globalContext"; import { resolveChopsticksInteractiveCmdChoice, @@ -24,7 +29,7 @@ export async function runNetworkCmd(args) { await cacheConfig(); process.env.MOON_TEST_ENV = args.envName; const globalConfig = await importAsyncConfig(); - const env = globalConfig.environments.find(({ name }) => name === args.envName)!; + const env = globalConfig.environments.find(({ name }) => name === args.envName); if (!env) { const envList = globalConfig.environments.map((env) => env.name); @@ -57,8 +62,7 @@ export async function runNetworkCmd(args) { { name: "MenuChoice", type: "list", - message: - `Environment : ${chalk.bgGray.cyanBright(args.envName)}\n` + "Please select a choice: ", + message: `Environment : ${chalk.bgGray.cyanBright(args.envName)}\nPlease select a choice: `, default: () => lastSelected, pageSize: 10, choices: [ @@ -74,7 +78,7 @@ export async function runNetworkCmd(args) { }, { name: - foundation == "dev" || foundation == "chopsticks" || foundation == "zombie" + foundation === "dev" || foundation === "chopsticks" || foundation === "zombie" ? `Command: Run command on network (${chalk.bgGrey.cyanBright(foundation)})` : chalk.dim( `Not applicable for foundation type (${chalk.bgGrey.cyanBright(foundation)})` @@ -86,9 +90,9 @@ export async function runNetworkCmd(args) { { name: testFileDirs.length > 0 - ? "Test: Execute tests registered for this environment (" + - chalk.bgGrey.cyanBright(testFileDirs) + - ")" + ? `Test: Execute tests registered for this environment (${chalk.bgGrey.cyanBright( + testFileDirs + )})` : chalk.dim("Test: NO TESTS SPECIFIED"), value: 4, disabled: testFileDirs.length > 0 ? false : true, @@ -97,9 +101,9 @@ export async function runNetworkCmd(args) { { name: testFileDirs.length > 0 - ? "GrepTest: Execute individual test(s) based on grepping the name / ID (" + - chalk.bgGrey.cyanBright(testFileDirs) + - ")" + ? `GrepTest: Execute individual test(s) based on grepping the name / ID (${chalk.bgGrey.cyanBright( + testFileDirs + )})` : chalk.dim("Test: NO TESTS SPECIFIED"), value: 5, disabled: testFileDirs.length > 0 ? false : true, @@ -125,8 +129,8 @@ export async function runNetworkCmd(args) { ]; if ( - (env.foundation.type == "dev" && !env.foundation.launchSpec[0].retainAllLogs) || - (env.foundation.type == "chopsticks" && !env.foundation.launchSpec[0].retainAllLogs) + (env.foundation.type === "dev" && !env.foundation.launchSpec[0].retainAllLogs) || + (env.foundation.type === "chopsticks" && !env.foundation.launchSpec[0].retainAllLogs) ) { clearNodeLogs(); } @@ -135,12 +139,13 @@ export async function runNetworkCmd(args) { clear(); const portsList = await reportServicePorts(); reportLogLocation(); - portsList.forEach(({ port }) => - console.log(` đŸ–Ĩī¸ https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A${port}`) - ); + + for (const { port } of portsList) { + console.log(` đŸ–Ĩī¸ https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A${port}`); + } if (!args.GrepTest) { - await inquirer.prompt(questions.find(({ name }) => name == "NetworkStarted")); + await inquirer.prompt(questions.find(({ name }) => name === "NetworkStarted")); } else { process.env.MOON_RECYCLE = "true"; process.env.MOON_GREP = await args.GrepTest; @@ -148,8 +153,12 @@ export async function runNetworkCmd(args) { } mainloop: for (;;) { - const choice = await inquirer.prompt(questions.find(({ name }) => name == "MenuChoice")); - const env = globalConfig.environments.find(({ name }) => name === args.envName)!; + const choice = await inquirer.prompt(questions.find(({ name }) => name === "MenuChoice")); + const env = globalConfig.environments.find(({ name }) => name === args.envName); + + if (!env) { + throw new Error("Environment not found in config. This is an error, please raise."); + } switch (choice.MenuChoice) { case 1: @@ -180,7 +189,7 @@ export async function runNetworkCmd(args) { break; case 6: { - const quit = await inquirer.prompt(questions.find(({ name }) => name == "Quit")); + const quit = await inquirer.prompt(questions.find(({ name }) => name === "Quit")); if (quit.Quit === true) { break mainloop; } @@ -197,9 +206,7 @@ export async function runNetworkCmd(args) { const reportServicePorts = async () => { const ctx = await MoonwallContext.getContext(); const portsList: { port: string; name: string }[] = []; - const globalConfig = await importAsyncConfig(); - const config = globalConfig.environments.find(({ name }) => name == process.env.MOON_TEST_ENV)!; - + const config = getEnvironmentFromConfig(); switch (config.foundation.type) { case "dev": { const args = ctx.environment.nodes[0].args; @@ -222,21 +229,27 @@ const reportServicePorts = async () => { } case "zombie": { - ctx.zombieNetwork!.relay.forEach(({ wsUri, name }) => { + const zombieNetwork = ctx.zombieNetwork; + + if (!zombieNetwork) { + throw new Error("Zombie network not found. This is a bug, please raise an issue."); + } + + for (const { wsUri, name } of zombieNetwork.relay) { portsList.push({ name, port: wsUri.split("ws://127.0.0.1:")[1] }); - }); + } - Object.keys(ctx.zombieNetwork!.paras).forEach((paraId) => { - ctx.zombieNetwork!.paras[paraId].nodes.forEach(({ wsUri, name }) => { + for (const paraId of Object.keys(zombieNetwork.paras)) { + for (const { wsUri, name } of zombieNetwork.paras[paraId].nodes) { portsList.push({ name, port: wsUri.split("ws://127.0.0.1:")[1] }); - }); - }); + } + } } } - portsList.forEach(({ name, port }) => - console.log(` 🌐 Node ${name} has started, listening on ports - Websocket: ${port}`) - ); + for (const { port, name } of portsList) { + console.log(` 🌐 Node ${name} has started, listening on ports - Websocket: ${port}`); + } return portsList; }; @@ -261,44 +274,47 @@ const resolveCommandChoice = async () => { const resolveInfoChoice = async (env: Environment) => { console.log(chalk.bgWhite.blackBright("Node Launch args:")); - console.dir((await MoonwallContext.getContext()).environment, { depth: null }); + console.dir((await MoonwallContext.getContext()).environment, { + depth: null, + }); console.log(chalk.bgWhite.blackBright("Launch Spec in Config File:")); console.dir(env, { depth: null }); const portsList = await reportServicePorts(); reportLogLocation(); - portsList.forEach(({ port }) => - console.log(` đŸ–Ĩī¸ https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A${port}`) - ); + + for (const { port } of portsList) { + console.log(` đŸ–Ĩī¸ https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A${port}`); + } }; -const resolveGrepChoice = async (env: Environment, silent: boolean = false) => { +const resolveGrepChoice = async (env: Environment, silent = false) => { const choice = await inquirer.prompt({ name: "grep", type: "input", - message: `What pattern would you like to filter for (ID/Title): `, + message: "What pattern would you like to filter for (ID/Title): ", default: process.env.MOON_GREP || "D01T01", }); process.env.MOON_RECYCLE = "true"; process.env.MOON_GREP = await choice.grep; - const opts = { testNamePattern: await choice.grep, silent }; + const opts: any = { testNamePattern: await choice.grep, silent }; if (silent) { - opts["reporters"] = ["dot"]; + opts.reporters = ["dot"]; } return await executeTests(env, opts); }; -const resolveTestChoice = async (env: Environment, silent: boolean = false) => { +const resolveTestChoice = async (env: Environment, silent = false) => { process.env.MOON_RECYCLE = "true"; - const opts = { silent }; + const opts: any = { silent }; if (silent) { - opts["reporters"] = ["dot"]; + opts.reporters = ["dot"]; } return await executeTests(env, opts); }; const resolveTailChoice = async (env: Environment) => { - let tailing: boolean = true; - let zombieNodePointer: number = 0; + let tailing = true; + let zombieNodePointer = 0; let bottomBarContents = ""; let switchNode: boolean; let zombieContent: string; @@ -316,13 +332,13 @@ const resolveTailChoice = async (env: Environment) => { bottomBarContents = bottomBarBase + resumePauseProse[0]; const ui = new inquirer.ui.BottomBar({ - bottomBar: bottomBarContents + "\n", + bottomBar: `${bottomBarContents}\n`, }); for (;;) { clear(); if (process.env.MOON_ZOMBIE_NODES) { - zombieNodes = process.env.MOON_ZOMBIE_NODES.split("|")!; + zombieNodes = process.env.MOON_ZOMBIE_NODES.split("|"); zombieContent = `, ${chalk.bgWhite.black("[,]")} Next Log, ${chalk.bgWhite.black( "[.]" @@ -346,12 +362,11 @@ const resolveTailChoice = async (env: Environment) => { throw new Error("No log file path resolved, this should not happen. Please raise defect"); } - // eslint-disable-next-line prefer-const let currentReadPosition = 0; - const printLogs = (newReadPosition: number, currentReadPosition: number) => { + const printLogs = (newReadPosition: number, curr: number) => { const stream = fs.createReadStream(logFilePath, { - start: currentReadPosition, + start: curr, end: newReadPosition, }); stream.on("data", onData); @@ -381,8 +396,8 @@ const resolveTailChoice = async (env: Environment) => { const renderBottomBar = (...parts: any[]) => { const content = process.env.MOON_ZOMBIE_NODES - ? bottomBarBase + " " + parts?.join(" ") + zombieContent + "\n" - : bottomBarBase + " " + parts?.join(" ") + "\n"; + ? `${bottomBarBase} ${parts?.join(" ")}${zombieContent}\n` + : `${bottomBarBase} ${parts?.join(" ")}\n`; ui.updateBottomBar(content); }; diff --git a/packages/cli/src/cmds/runTests.ts b/packages/cli/src/cmds/runTests.ts index 56d482a1..1700f892 100644 --- a/packages/cli/src/cmds/runTests.ts +++ b/packages/cli/src/cmds/runTests.ts @@ -11,12 +11,12 @@ import { MoonwallContext, contextCreator, runNetworkOnly } from "../lib/globalCo export async function testCmd(envName: string, additionalArgs?: object): Promise { await cacheConfig(); const globalConfig = await importAsyncConfig(); - const env = globalConfig.environments.find(({ name }) => name === envName)!; + const env = globalConfig.environments.find(({ name }) => name === envName); process.env.MOON_TEST_ENV = envName; if (!env) { const envList = globalConfig.environments.map((env) => env.name); - new Error( + throw new Error( `No environment found in config for: ${chalk.bgWhiteBright.blackBright( envName )}\n Environments defined in config are: ${envList}\n` @@ -27,8 +27,8 @@ export async function testCmd(envName: string, additionalArgs?: object): Promise await commonChecks(env); if ( - (env.foundation.type == "dev" && !env.foundation.launchSpec[0].retainAllLogs) || - (env.foundation.type == "chopsticks" && !env.foundation.launchSpec[0].retainAllLogs) + (env.foundation.type === "dev" && !env.foundation.launchSpec[0].retainAllLogs) || + (env.foundation.type === "chopsticks" && !env.foundation.launchSpec[0].retainAllLogs) ) { clearNodeLogs(); } @@ -38,15 +38,16 @@ export async function testCmd(envName: string, additionalArgs?: object): Promise } const vitest = await executeTests(env, additionalArgs); - const failed = vitest!.state.getFiles().filter((file) => file.result!.state === "fail"); + const failed = vitest.state + .getFiles() + .filter((file) => file.result && file.result.state === "fail"); if (failed.length === 0) { console.log("✅ All tests passed"); return true; - } else { - console.log("❌ Some tests failed"); - return false; } + console.log("❌ Some tests failed"); + return false; } export async function executeTests(env: Environment, additionalArgs?: object) { @@ -60,7 +61,7 @@ export async function executeTests(env: Environment, additionalArgs?: object) { const ctx = await contextCreator(); const chainData = ctx.providers - .filter((provider) => provider.type == "polkadotJs" && provider.name.includes("para")) + .filter((provider) => provider.type === "polkadotJs" && provider.name.includes("para")) .map((provider) => { return { [provider.name]: { @@ -70,6 +71,10 @@ export async function executeTests(env: Environment, additionalArgs?: object) { }; }); // TODO: Extend/develop this feature to respect para/relay chain specifications + if (chainData.length < 1) { + throw "Could not read runtime name or version \nTo fix: ensure moonwall config has a polkadotJs provider with a name containing 'para'"; + } + const { rtVersion, rtName } = Object.values(chainData[0])[0]; process.env.MOON_RTVERSION = rtVersion; process.env.MOON_RTNAME = rtName; @@ -94,7 +99,7 @@ export async function executeTests(env: Environment, additionalArgs?: object) { include: env.include ? env.include : ["**/*{test,spec,test_,test-}*{ts,mts,cts}"], onConsoleLog(log) { if (filterList.includes(log.trim())) return false; - // if (log.trim() == "stdout | unknown test" || log.trim() == "") return false; + // if (log.trim() === "stdout | unknown test" || log.trim() === "") return false; if (log.includes("has multiple versions, ensure that there is only one installed.")) { return false; } @@ -106,7 +111,7 @@ export async function executeTests(env: Environment, additionalArgs?: object) { if ( globalConfig.environments.find((env) => env.name === process.env.MOON_TEST_ENV)?.foundation - .type == "zombie" + .type === "zombie" ) { await runNetworkOnly(); process.env.MOON_RECYCLE = "true"; @@ -114,7 +119,12 @@ export async function executeTests(env: Environment, additionalArgs?: object) { try { const folders = env.testFileDir.map((folder) => path.join(".", folder, "/")); - resolve((await startVitest("test", folders, { ...options, ...additionalArgs })) as Vitest); + resolve( + (await startVitest("test", folders, { + ...options, + ...additionalArgs, + })) as Vitest + ); } catch (e) { console.error(e); reject(e); @@ -143,9 +153,12 @@ function addThreadConfig( }, }; - if (threads == true && process.env.MOON_RECYCLE !== "true") { + if (threads === true && process.env.MOON_RECYCLE !== "true") { + if (!configWithThreads.poolOptions) { + throw new Error("poolOptions not defined in config, this is an error please raise."); + } configWithThreads.fileParallelism = true; - configWithThreads.poolOptions!.threads = { + configWithThreads.poolOptions.threads = { isolate: true, minThreads: 1, maxThreads: 3, @@ -155,9 +168,17 @@ function addThreadConfig( } if (typeof threads === "number" && process.env.MOON_RECYCLE !== "true") { + if (!configWithThreads.poolOptions) { + throw new Error("poolOptions not defined in config, this is an error please raise."); + } + + if (!configWithThreads.poolOptions.threads) { + throw new Error("poolOptions.threads not defined in config, this is an error please raise."); + } + configWithThreads.fileParallelism = true; - configWithThreads.poolOptions!.threads!.maxThreads = threads; - configWithThreads.poolOptions!.threads!.singleThread = false; + configWithThreads.poolOptions.threads.maxThreads = threads; + configWithThreads.poolOptions.threads.singleThread = false; } if (typeof threads === "object" && process.env.MOON_RECYCLE !== "true") { diff --git a/packages/cli/src/internal/cmdFunctions/downloader.ts b/packages/cli/src/internal/cmdFunctions/downloader.ts index 8034f815..e34a1caa 100644 --- a/packages/cli/src/internal/cmdFunctions/downloader.ts +++ b/packages/cli/src/internal/cmdFunctions/downloader.ts @@ -22,11 +22,11 @@ const onProgress = (bytes) => { const onComplete = () => { progressBar.stop(); - process.stdout.write(` 💾 Saving binary artefact...`); + process.stdout.write(" 💾 Saving binary artefact..."); }; export async function downloader(url: string, outputPath: string): Promise { - const tempPath = outputPath + ".tmp"; + const tempPath = `${outputPath}.tmp`; const writeStream = fs.createWriteStream(tempPath); let transferredBytes = 0; diff --git a/packages/cli/src/internal/cmdFunctions/fetchArtifact.ts b/packages/cli/src/internal/cmdFunctions/fetchArtifact.ts index ce5892d9..5953910b 100644 --- a/packages/cli/src/internal/cmdFunctions/fetchArtifact.ts +++ b/packages/cli/src/internal/cmdFunctions/fetchArtifact.ts @@ -32,9 +32,8 @@ export async function fetchArtifact(args) { ? releases.find((release) => { if (args.ver === "latest") { return release.assets.find((asset) => asset.name.includes(binary)); - } else { - return release.assets.find((asset) => asset.name === `${binary}-${args.ver}.wasm`); } + return release.assets.find((asset) => asset.name === `${binary}-${args.ver}.wasm`); }) : args.ver === "latest" ? releases.find((release) => release.assets.find((asset) => asset.name === binary)) @@ -42,7 +41,7 @@ export async function fetchArtifact(args) { .filter((release) => release.tag_name.includes(args.ver)) .find((release) => release.assets.find((asset) => minimatch(asset.name, binary))); - if (release == null) { + if (!release) { throw new Error(`Release not found for ${args.ver}`); } @@ -50,8 +49,12 @@ export async function fetchArtifact(args) { ? release.assets.find((asset) => asset.name.includes(binary) && asset.name.includes("wasm")) : release.assets.find((asset) => minimatch(asset.name, binary)); + if (!asset) { + throw new Error(`Asset not found for ${binary}`); + } + if (!binary.includes("-runtime")) { - const url = asset!.browser_download_url; + const url = asset.browser_download_url; const filename = path.basename(url); const binPath = path.join("./", enteredPath, filename); @@ -64,21 +67,19 @@ export async function fetchArtifact(args) { const version = (await runTask(`./${cleaned} --version`)).trim(); process.stdout.write(` ${chalk.green(version.trim())} ✓\n`); return; - } else { - const version = (await runTask(`./${binPath} --version`)).trim(); - process.stdout.write(` ${chalk.green(version.trim())} ✓\n`); - return; } - } else { - const binaryPath = path.join("./", args.path, `${args.bin}-${args.ver}.wasm`); - await downloader(asset!.browser_download_url, binaryPath); - await fs.chmod(binaryPath, "755"); - process.stdout.write(` ${chalk.green("done")} ✓\n`); + const version = (await runTask(`./${binPath} --version`)).trim(); + process.stdout.write(` ${chalk.green(version.trim())} ✓\n`); return; } + const binaryPath = path.join("./", args.path, `${args.bin}-${args.ver}.wasm`); + await downloader(asset.browser_download_url, binaryPath); + await fs.chmod(binaryPath, "755"); + process.stdout.write(` ${chalk.green("done")} ✓\n`); + return; } -export async function getVersions(name: string, runtime: boolean = false) { +export async function getVersions(name: string, runtime = false) { const repo = (await allReposAsync()).find((network) => network.binaries.find((bin) => bin.name === name) ); diff --git a/packages/cli/src/internal/cmdFunctions/initialisation.ts b/packages/cli/src/internal/cmdFunctions/initialisation.ts index 058cf62e..68168bdc 100644 --- a/packages/cli/src/internal/cmdFunctions/initialisation.ts +++ b/packages/cli/src/internal/cmdFunctions/initialisation.ts @@ -35,12 +35,11 @@ export async function generateConfig() { await fs.writeFile("moonwall.config", textBlob + JSONBlob, "utf-8"); process.env.MOON_CONFIG_PATH = "./moonwall.config"; break; - } else { - console.log("ℹī¸ Config file already exists at this location. Quitting."); - return; } + console.log("ℹī¸ Config file already exists at this location. Quitting."); + return; } - console.log(`Goodbye! 👋`); + console.log("Goodbye! 👋"); } const generateQuestions = [ diff --git a/packages/cli/src/internal/cmdFunctions/tempLogs.ts b/packages/cli/src/internal/cmdFunctions/tempLogs.ts index af64e964..daa03800 100644 --- a/packages/cli/src/internal/cmdFunctions/tempLogs.ts +++ b/packages/cli/src/internal/cmdFunctions/tempLogs.ts @@ -1,7 +1,7 @@ import path from "path"; import fs from "fs"; -export function clearNodeLogs(silent: boolean = true) { +export function clearNodeLogs(silent = true) { const dirPath = path.join(process.cwd(), "tmp", "node_logs"); if (!fs.existsSync(dirPath)) { fs.mkdirSync(dirPath, { recursive: true }); @@ -16,7 +16,7 @@ export function clearNodeLogs(silent: boolean = true) { } } -export function reportLogLocation(silent: boolean = false) { +export function reportLogLocation(silent = false) { const dirPath = path.join(process.cwd(), "tmp", "node_logs"); if (!fs.existsSync(dirPath)) { @@ -31,7 +31,10 @@ export function reportLogLocation(silent: boolean = false) { ? process.env.MOON_ZOMBIE_DIR : process.env.MOON_LOG_LOCATION ? process.env.MOON_LOG_LOCATION - : path.join(dirPath, result.find((file) => path.extname(file) == ".log")!); + : path.join( + dirPath, + result.find((file) => path.extname(file) === ".log") || "no_logs_found" + ); consoleMessage = ` đŸĒĩ Log location: ${filePath}`; } catch (e) { console.error(e); diff --git a/packages/cli/src/internal/commandParsers.ts b/packages/cli/src/internal/commandParsers.ts index 6550ebc7..3b0fe296 100644 --- a/packages/cli/src/internal/commandParsers.ts +++ b/packages/cli/src/internal/commandParsers.ts @@ -7,13 +7,12 @@ import getPort from "get-port"; export function parseZombieCmd(launchSpec: ZombieLaunchSpec) { if (launchSpec) { return { cmd: launchSpec.configPath }; - } else { - throw new Error( - `No ZombieSpec found in config. \n Are you sure your ${chalk.bgWhiteBright.blackBright( - "moonwall.config.json" - )} file has the correct "configPath" in zombieSpec?` - ); } + throw new Error( + `No ZombieSpec found in config. \n Are you sure your ${chalk.bgWhiteBright.blackBright( + "moonwall.config.json" + )} file has the correct "configPath" in zombieSpec?` + ); } function fetchDefaultArgs(binName: string, additionalRepos: RepoSpec[] = []): string[] { @@ -85,7 +84,7 @@ export function parseChopsticksRunCmd(launchSpecs: ChopsticksLaunchSpec[]): { ]; const mode = launchSpecs[0].buildBlockMode ? launchSpecs[0].buildBlockMode : "manual"; - const num = mode == "batch" ? "Batch" : mode == "instant" ? "Instant" : "Manual"; + const num = mode === "batch" ? "Batch" : mode === "instant" ? "Instant" : "Manual"; chopsticksArgs.push(`--build-block-mode=${num}`); if (launchSpecs[0].wsPort) { @@ -110,7 +109,7 @@ export function parseChopsticksRunCmd(launchSpecs: ChopsticksLaunchSpec[]): { const chopsticksCmd = "node"; const chopsticksArgs = ["node_modules/@acala-network/chopsticks/chopsticks.cjs", "xcm"]; - launchSpecs.forEach((spec) => { + for (const spec of launchSpecs) { const type = spec.type ? spec.type : "parachain"; switch (type) { case "parachain": @@ -119,7 +118,17 @@ export function parseChopsticksRunCmd(launchSpecs: ChopsticksLaunchSpec[]): { case "relaychain": chopsticksArgs.push(`--relaychain=${spec.configPath}`); } - }); + } + // launchSpecs.forEach((spec) => { + // const type = spec.type ? spec.type : "parachain"; + // switch (type) { + // case "parachain": + // chopsticksArgs.push(`--parachain=${spec.configPath}`); + // break; + // case "relaychain": + // chopsticksArgs.push(`--relaychain=${spec.configPath}`); + // } + // }); return { cmd: chopsticksCmd, diff --git a/packages/cli/src/internal/fileCheckers.ts b/packages/cli/src/internal/fileCheckers.ts index d24d81ff..8d150c0e 100644 --- a/packages/cli/src/internal/fileCheckers.ts +++ b/packages/cli/src/internal/fileCheckers.ts @@ -78,7 +78,9 @@ export async function downloadBinsIfMissing(binPath: string) { export function checkListeningPorts(processId: number) { try { - const stdOut = execSync(`lsof -p ${processId} | grep LISTEN`, { encoding: "utf-8" }); + const stdOut = execSync(`lsof -p ${processId} | grep LISTEN`, { + encoding: "utf-8", + }); const binName = stdOut.split("\n")[0].split(" ")[0]; const ports = stdOut .split("\n") @@ -140,9 +142,12 @@ export async function promptAlreadyRunning(pids: number[]) { switch (choice.AlreadyRunning) { case "kill": - pids.forEach((pid) => { + for (const pid of pids) { execSync(`kill ${pid}`); - }); + } + // pids.forEach((pid) => { + // execSync(`kill ${pid}`); + // }); break; case "continue": @@ -166,10 +171,10 @@ export function checkAccess(path: string) { async function getBinaryArchitecture(filePath: string) { return new Promise((resolve, reject) => { const architectureMap = { - 0x0: "unknown", - 0x03: "x86", - 0x3e: "x64", - 0xb7: "arm64", + 0: "unknown", + 3: "x86", + 62: "x64", + 183: "arm64", }; fs.open(filePath, "r", (err, fd) => { diff --git a/packages/cli/src/internal/foundations/chopsticksHelpers.ts b/packages/cli/src/internal/foundations/chopsticksHelpers.ts index a287f0bf..c2e68330 100644 --- a/packages/cli/src/internal/foundations/chopsticksHelpers.ts +++ b/packages/cli/src/internal/foundations/chopsticksHelpers.ts @@ -11,10 +11,10 @@ import { MoonwallContext } from "../../lib/globalContext"; export async function getWsFromConfig(providerName?: string): Promise { if (providerName) { const provider = (await MoonwallContext.getContext()).environment.providers.find( - ({ name }) => name == providerName + ({ name }) => name === providerName ); - if (typeof provider == "undefined") { + if (typeof provider === "undefined") { throw new Error(`Cannot find provider ${chalk.bgWhiteBright.blackBright(providerName)}`); } @@ -23,23 +23,22 @@ export async function getWsFromConfig(providerName?: string): Promise type == "polkadotJs" - ); - - if (typeof provider == "undefined") { - throw new Error( - `Cannot find providers of type ${chalk.bgWhiteBright.blackBright("polkadotJs")}` - ); - } + } + const provider = (await MoonwallContext.getContext()).environment.providers.find( + ({ type }) => type === "polkadotJs" + ); - if (!provider.ws) { - throw new Error("Provider does not have an attached ws() property "); - } + if (typeof provider === "undefined") { + throw new Error( + `Cannot find providers of type ${chalk.bgWhiteBright.blackBright("polkadotJs")}` + ); + } - return provider.ws(); + if (!provider.ws) { + throw new Error("Provider does not have an attached ws() property "); } + + return provider.ws(); } export async function sendNewBlockAndCheck( @@ -78,7 +77,7 @@ export async function createChopsticksBlock( const apiAt = await context.polkadotJs(options.providerName).at(result); const actualEvents: any = await apiAt.query.system.events(); - if (options && options.expectEvents) { + if (options?.expectEvents) { const match = options.expectEvents.every((eEvt) => { const found = actualEvents .map((aEvt) => eEvt.is(aEvt.event)) @@ -100,12 +99,13 @@ export async function createChopsticksBlock( if (options && options.allowFailures === true) { // Skip ExtrinsicFailure Asserts } else { - actualEvents.forEach((event) => { - assert( - !context.polkadotJs().events.system.ExtrinsicFailed.is(event.event), - "ExtrinsicFailed event detected, enable 'allowFailures' if this is expected." - ); - }); + for (const event of actualEvents) { + if (context.polkadotJs().events.system.ExtrinsicFailed.is(event.event)) { + throw new Error( + `ExtrinsicFailed event detected, enable 'allowFailures' if this is expected.` + ); + } + } } return { result }; } @@ -135,7 +135,7 @@ export async function sendNewBlockRequest(params?: { while (!ws.isConnected) { await setTimeout(100); } - if ((params && params.count) || (params && params.to)) { + if (params?.count || params?.to) { result = await ws.send("dev_newBlock", [{ count: params.count, to: params.to }]); } else { result = await ws.send("dev_newBlock", [{ count: 1 }]); @@ -144,7 +144,7 @@ export async function sendNewBlockRequest(params?: { return result; } -export async function sendSetStorageRequest(params?: { +export async function sendSetStorageRequest(params: { providerName?: string; module: string; method: string; @@ -156,8 +156,6 @@ export async function sendSetStorageRequest(params?: { await setTimeout(100); } - await ws.send("dev_setStorage", [ - { [params!.module]: { [params!.method]: params!.methodParams } }, - ]); + await ws.send("dev_setStorage", [{ [params.module]: { [params.method]: params.methodParams } }]); await ws.disconnect(); } diff --git a/packages/cli/src/internal/foundations/devModeHelpers.ts b/packages/cli/src/internal/foundations/devModeHelpers.ts index 6438e289..7ba2eb67 100644 --- a/packages/cli/src/internal/foundations/devModeHelpers.ts +++ b/packages/cli/src/internal/foundations/devModeHelpers.ts @@ -14,15 +14,18 @@ import chalk from "chalk"; import Debug from "debug"; import { setTimeout } from "timers/promises"; import { assert } from "vitest"; -import { importAsyncConfig, isEthereumDevConfig } from "../../lib/configReader"; +import { + getEnvironmentFromConfig, + importAsyncConfig, + isEthereumDevConfig, +} from "../../lib/configReader"; import { extractError } from "../../lib/contextHelpers"; import { MoonwallContext } from "../../lib/globalContext"; import { vitestAutoUrl } from "../providerFactories"; const debug = Debug("DevTest"); export async function getDevProviderPath() { - const globalConfig = await importAsyncConfig(); - const env = globalConfig.environments.find(({ name }) => name == process.env.MOON_TEST_ENV)!; + const env = getEnvironmentFromConfig(); return env.connections ? env.connections[0].endpoints[0].replace("ws://", "http://") : vitestAutoUrl(); @@ -43,15 +46,17 @@ export type CallType = | Promise; function returnSigner(options: BlockCreation) { - return "privateKey" in options.signer! && "type" in options.signer - ? generateKeyringPair(options.signer!.type, options.signer!.privateKey) + return options.signer && "privateKey" in options.signer && "type" in options.signer + ? generateKeyringPair(options.signer.type, options.signer.privateKey) : options.signer; } function returnDefaultSigner() { return isEthereumDevConfig() ? alith - : new Keyring({ type: "sr25519" }).addFromUri("//Alice", { name: "Alice default" }); + : new Keyring({ type: "sr25519" }).addFromUri("//Alice", { + name: "Alice default", + }); } export async function createDevBlock< @@ -61,22 +66,21 @@ export async function createDevBlock< const containsViem = (context as DevModeContext).isEthereumChain && context.viem() && - (await MoonwallContext.getContext()).providers.find((prov) => prov.type == "viem") + (await MoonwallContext.getContext()).providers.find((prov) => prov.type === "viem") ? true : false; const api = context.polkadotJs(); const originalBlockNumber = (await api.rpc.chain.getHeader()).number.toBigInt(); - const signer = options.signer !== undefined ? returnSigner(options) : returnDefaultSigner(); + const signer = options.signer ? returnSigner(options) : returnDefaultSigner(); const results: ({ type: "eth"; hash: string } | { type: "sub"; hash: string })[] = []; - const txs = - transactions == undefined ? [] : Array.isArray(transactions) ? transactions : [transactions]; + const txs = !transactions ? [] : Array.isArray(transactions) ? transactions : [transactions]; for await (const call of txs) { - if (typeof call == "string") { + if (typeof call === "string") { // Ethereum results.push({ type: "eth", @@ -119,7 +123,7 @@ export async function createDevBlock< const blockResult = await createAndFinalizeBlock(api, parentHash, finalize); // No need to extract events if no transactions - if (results.length == 0) { + if (results.length === 0) { return { block: blockResult, }; @@ -131,25 +135,25 @@ export async function createDevBlock< const blockData = await api.rpc.chain.getBlock(blockResult.hash); const getExtIndex = (records: EventRecord[], result: { type: "sub" | "eth"; hash: string }) => { - if (result.type == "eth") { + if (result.type === "eth") { const res = records .find( ({ phase, event: { section, method, data } }) => phase.isApplyExtrinsic && - section == "ethereum" && - method == "Executed" && - data[2].toString() == result.hash + section === "ethereum" && + method === "Executed" && + data[2].toString() === result.hash ) ?.phase?.asApplyExtrinsic?.toString(); - return res === undefined ? undefined : Number(res); - } else { - return blockData.block.extrinsics.findIndex((ext) => ext.hash.toHex() == result.hash); + return typeof res === "undefined" ? undefined : Number(res); } + return blockData.block.extrinsics.findIndex((ext) => ext.hash.toHex() === result.hash); }; const result: ExtrinsicCreation[] = results.map((result) => { const extrinsicIndex = getExtIndex(allRecords, result); + const extrinsicFound = typeof extrinsicIndex !== "undefined"; // We retrieve the events associated with the extrinsic const events = allRecords.filter( @@ -159,18 +163,18 @@ export async function createDevBlock< const failure = extractError(events); return { - extrinsic: extrinsicIndex! >= 0 ? blockData.block.extrinsics[extrinsicIndex!] : null, + extrinsic: extrinsicFound ? blockData.block.extrinsics[extrinsicIndex] : null, events, error: failure && ((failure.isModule && api.registry.findMetaError(failure.asModule)) || ({ name: failure.toString() } as RegistryError)), - successful: extrinsicIndex !== undefined && !failure, + successful: extrinsicFound && !failure, hash: result.hash, }; }); - if (results.find((res) => res.type == "eth")) { + if (results.find((res) => res.type === "eth")) { // Wait until new block is actually created // max wait 2s for (let i = 0; i < 1000; i++) { @@ -204,12 +208,13 @@ export async function createDevBlock< } if (!options.allowFailures) { - actualEvents.forEach((event) => { - assert( - !api.events.system.ExtrinsicFailed.is(event.event), - "ExtrinsicFailed event detected, enable 'allowFailures' if this is expected." - ); - }); + for (const event of actualEvents) { + if (api.events.system.ExtrinsicFailed.is(event.event)) { + throw new Error( + "ExtrinsicFailed event detected, enable 'allowFailures' if this is expected." + ); + } + } } return { diff --git a/packages/cli/src/internal/foundations/zombieHelpers.ts b/packages/cli/src/internal/foundations/zombieHelpers.ts index f4b730af..089bdc0b 100644 --- a/packages/cli/src/internal/foundations/zombieHelpers.ts +++ b/packages/cli/src/internal/foundations/zombieHelpers.ts @@ -6,7 +6,11 @@ import { setTimeout as timer } from "timers/promises"; import net from "net"; export async function checkZombieBins(config: LaunchConfig) { - const relayBinPath = config.relaychain.default_command!; + const relayBinPath = config.relaychain.default_command; + + if (!relayBinPath) { + throw new Error("No relayBinPath '[relaychain.default_command]' specified in zombie config"); + } await checkExists(relayBinPath); checkAccess(relayBinPath); @@ -22,15 +26,24 @@ export async function checkZombieBins(config: LaunchConfig) { } if (para.collators) { - para.collators.forEach((coll) => { + for (const coll of para.collators) { if (!coll.command) { throw new Error( - "No command found for collators, please check your zombienet config file for para collators command" + "No command found for collators, please check your zombienet config file for collators command" ); } checkExists(coll.command); checkAccess(coll.command); - }); + } + // para.collators.forEach((coll) => { + // if (!coll.command) { + // throw new Error( + // "No command found for collators, please check your zombienet config file for para collators command" + // ); + // } + // checkExists(coll.command); + // checkAccess(coll.command); + // }); } }); await Promise.all(promises); @@ -85,7 +98,7 @@ export async function sendIpcMessage(message: IPCRequestMessage): Promise 100) { - reject(new Error(`Closing IPC connection failed`)); + reject(new Error("Closing IPC connection failed")); } await timer(200); } diff --git a/packages/cli/src/internal/launcherCommon.ts b/packages/cli/src/internal/launcherCommon.ts index d6fd4083..517ba51d 100644 --- a/packages/cli/src/internal/launcherCommon.ts +++ b/packages/cli/src/internal/launcherCommon.ts @@ -10,16 +10,16 @@ export async function commonChecks(env: Environment) { const globalConfig = await importAsyncConfig(); // TODO: This is begging for some Dependency Injection - if (env.foundation.type == "dev") { + if (env.foundation.type === "dev") { await devBinCheck(env); } - if (env.foundation.type == "zombie") { + if (env.foundation.type === "zombie") { await zombieBinCheck(env); } if ( - process.env.MOON_RUN_SCRIPTS == "true" && + process.env.MOON_RUN_SCRIPTS === "true" && globalConfig.scriptsDir && env.runScripts && env.runScripts.length > 0 @@ -37,7 +37,7 @@ async function zombieBinCheck(env: Environment) { const bins = parseZombieConfigForBins(env.foundation.zombieSpec.configPath); const pids = bins.flatMap((bin) => checkAlreadyRunning(bin)); - pids.length == 0 || process.env.CI || (await promptAlreadyRunning(pids)); + pids.length === 0 || process.env.CI || (await promptAlreadyRunning(pids)); } async function devBinCheck(env: Environment) { @@ -47,7 +47,7 @@ async function devBinCheck(env: Environment) { const binName = path.basename(env.foundation.launchSpec[0].binPath); const pids = checkAlreadyRunning(binName); - pids.length == 0 || process.env.CI || (await promptAlreadyRunning(pids)); + pids.length === 0 || process.env.CI || (await promptAlreadyRunning(pids)); await downloadBinsIfMissing(env.foundation.launchSpec[0].binPath); } @@ -73,13 +73,13 @@ export async function executeScript(scriptCommand: string, args?: string) { switch (ext) { case ".js": - execSync("node " + scriptPath + ` ${args}`, { stdio: "inherit" }); + execSync(`node ${scriptPath} ${args}`, { stdio: "inherit" }); break; case ".ts": - execSync("pnpm tsx " + scriptPath + ` ${args}`, { stdio: "inherit" }); + execSync(`pnpm tsx ${scriptPath} ${args}`, { stdio: "inherit" }); break; case ".sh": - execSync(scriptPath + ` ${args}`, { stdio: "inherit" }); + execSync(`${scriptPath} ${args}`, { stdio: "inherit" }); break; default: console.log(`${ext} not supported, skipping ${script}`); diff --git a/packages/cli/src/internal/localNode.ts b/packages/cli/src/internal/localNode.ts index 382356c3..1bd0fe85 100644 --- a/packages/cli/src/internal/localNode.ts +++ b/packages/cli/src/internal/localNode.ts @@ -36,10 +36,8 @@ export async function launchNode(cmd: string, args: string[], name: string) { const fsStream = fs.createWriteStream(logLocation); runningNode.on("error", (err) => { - if ((err as any).errno == "ENOENT") { - console.error( - `\x1b[31mMissing Local binary at` + `(${cmd}).\nPlease compile the project\x1b[0m` - ); + if ((err as any).errno === "ENOENT") { + console.error(`\x1b[31mMissing Local binary at(${cmd}).\nPlease compile the project\x1b[0m`); } throw new Error(err.message); }); @@ -75,14 +73,12 @@ export async function launchNode(cmd: string, args: string[], name: string) { await checkWebSocketJSONRPC(port); // console.log(`Port ${port} supports WebSocket JSON RPC!`); break probe; - } catch { - continue; - } + } catch {} } } } catch { if (i === 300) { - throw new Error(`Could not find ports for node after 30 seconds`); + throw new Error("Could not find ports for node after 30 seconds"); } await timer(100); continue; @@ -127,18 +123,14 @@ async function checkWebSocketJSONRPC(port: number): Promise { }); }); - ws && ws.close(); + ws?.close(); return result; } catch { return false; } } -async function findPortsByPid( - pid: number, - retryCount: number = 600, - retryDelay: number = 100 -): Promise { +async function findPortsByPid(pid: number, retryCount = 600, retryDelay = 100): Promise { for (let i = 0; i < retryCount; i++) { try { const { stdout } = await execAsync(`lsof -i -n -P | grep LISTEN | grep ${pid}`); diff --git a/packages/cli/src/internal/logging.ts b/packages/cli/src/internal/logging.ts index f4feaf9d..8aa3a6c3 100644 --- a/packages/cli/src/internal/logging.ts +++ b/packages/cli/src/internal/logging.ts @@ -17,9 +17,8 @@ process.stderr.write = ( if (shouldWrite) { if (typeof encodingOrCallback === "function") { return originalWrite(chunk, encodingOrCallback); - } else { - return originalWrite(chunk, encodingOrCallback as BufferEncoding, callback); } + return originalWrite(chunk, encodingOrCallback as BufferEncoding, callback); } if (callback) { diff --git a/packages/cli/src/internal/nodePool.ts b/packages/cli/src/internal/nodePool.ts deleted file mode 100644 index 979bc4b3..00000000 --- a/packages/cli/src/internal/nodePool.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Define as a forked resource - -/// Use acquire use release - -// HTTP Server example: https://github.com/mikearnaldi/sf-meetup/blob/main/src/lib/http.ts - -// Effect.forever, -// Effect.interruptible, -// Effect.forkScoped - -// Use message queues: https://effect.website/docs/concurrency/queue - -// IPC Server! - -// Needs endpoints: -// request -// release -// query diff --git a/packages/cli/src/internal/providerFactories.ts b/packages/cli/src/internal/providerFactories.ts index 410a0c48..2ab859e7 100644 --- a/packages/cli/src/internal/providerFactories.ts +++ b/packages/cli/src/internal/providerFactories.ts @@ -16,7 +16,7 @@ export class ProviderFactory { constructor(private providerConfig: ProviderConfig) { this.url = providerConfig.endpoints.includes("ENV_VAR") - ? process.env.WSS_URL! + ? process.env.WSS_URL || "error_missing_WSS_URL_env_var" : providerConfig.endpoints[0]; this.privateKey = process.env.MOON_PRIV_KEY || ALITH_PRIVATE_KEY; } @@ -109,7 +109,10 @@ export class ProviderFactory { return { name: this.providerConfig.name, type: this.providerConfig.type, - connect: () => console.log(`🚧 provider ${this.providerConfig.name} not yet implemented`), + connect: () => { + console.log(`🚧 provider ${this.providerConfig.name} not yet implemented`); + return null; + }, }; } @@ -118,7 +121,7 @@ export class ProviderFactory { } public static prepareDefaultDev(): MoonwallProvider[] { - return this.prepare([ + return ProviderFactory.prepare([ { name: "dev", type: "polkadotJs", @@ -145,7 +148,7 @@ export class ProviderFactory { public static prepareDefaultZombie(): MoonwallProvider[] { const MOON_PARA_WSS = process.env.MOON_PARA_WSS || "error"; const MOON_RELAY_WSS = process.env.MOON_RELAY_WSS || "error"; - return this.prepare([ + return ProviderFactory.prepare([ { name: "w3", type: "web3", @@ -177,7 +180,7 @@ export class ProviderFactory { public static prepareNoEthDefaultZombie(): MoonwallProvider[] { const MOON_PARA_WSS = process.env.MOON_PARA_WSS || "error"; const MOON_RELAY_WSS = process.env.MOON_RELAY_WSS || "error"; - return this.prepare([ + return ProviderFactory.prepare([ { name: "parachain", type: "polkadotJs", @@ -204,7 +207,7 @@ export class ProviderInterfaceFactory { constructor( private name: string, private type: ProviderType, - private connect: () => any + private connect: () => Promise | Wallet | Web3 | Promise | null ) {} public async create(): Promise { @@ -251,10 +254,13 @@ export class ProviderInterfaceFactory { type: this.type, greet: async () => console.log( - `👋 Provider ${this.name} is connected to chain ` + (await (api.eth as any).getChainId()) + `👋 Provider ${this.name} is connected to chain ${await (api.eth as any).getChainId()}` ), disconnect: async () => { - api.eth.net.currentProvider!.disconnect(); + if (!api.eth.net.currentProvider) { + throw new Error("No connected web3 provider to disconnect from"); + } + api.eth.net.currentProvider.disconnect(); }, }; } @@ -265,12 +271,22 @@ export class ProviderInterfaceFactory { name: this.name, api, type: this.type, - greet: async () => + greet: async () => { + if (!api.provider) { + throw new Error("No connected ethers provider to greet with"); + } debug( - `👋 Provider ${this.name} is connected to chain ` + - (await api.provider!.getNetwork()).chainId - ), - disconnect: () => api.provider!.destroy(), + `👋 Provider ${this.name} is connected to chain ${ + (await api.provider.getNetwork()).chainId + }` + ); + }, + disconnect: () => { + if (!api.provider) { + throw new Error("No connected ethers provider to disconnect from"); + } + api.provider.destroy(); + }, }; } @@ -281,7 +297,7 @@ export class ProviderInterfaceFactory { api, type: this.type, greet: async () => - console.log(`👋 Provider ${this.name} is connected to chain ` + (await api.getChainId())), + console.log(`👋 Provider ${this.name} is connected to chain ${await api.getChainId()}`), disconnect: async () => { // Not needed until we switch to websockets }, @@ -291,7 +307,7 @@ export class ProviderInterfaceFactory { public static async populate( name: string, type: ProviderType, - connect: () => Promise | Wallet | Web3 | Promise | void + connect: () => Promise | Wallet | Web3 | Promise | null ): Promise { return await new ProviderInterfaceFactory(name, type, connect).create(); } diff --git a/packages/cli/src/lib/binariesHelpers.ts b/packages/cli/src/lib/binariesHelpers.ts index 59c9c5b4..e5d9b12c 100644 --- a/packages/cli/src/lib/binariesHelpers.ts +++ b/packages/cli/src/lib/binariesHelpers.ts @@ -60,8 +60,8 @@ export async function getMoonbeamDockerBinary(binaryTag: string): Promise } export function isOptionSet(option: string): boolean { - const config = importJsonConfig(); - const env = config.environments.find((env) => env.name == process.env.MOON_TEST_ENV)!; + const env = getEnvironmentFromConfig(); const optionValue = traverseConfig(env, option); return optionValue !== undefined; @@ -60,18 +59,22 @@ export function isOptionSet(option: string): boolean { export function isEthereumZombieConfig(): boolean { const config = importJsonConfig(); - const env = config.environments.find((env) => env.name == process.env.MOON_TEST_ENV)!; - return env.foundation.type == "zombie" && !env.foundation.zombieSpec.disableDefaultEthProviders; + const env = getEnvironmentFromConfig(); + return env.foundation.type === "zombie" && !env.foundation.zombieSpec.disableDefaultEthProviders; } export function isEthereumDevConfig(): boolean { const config = importJsonConfig(); - const env = config.environments.find((env) => env.name == process.env.MOON_TEST_ENV)!; - return env.foundation.type == "dev" && !env.foundation.launchSpec[0].disableDefaultEthProviders; + const env = getEnvironmentFromConfig(); + return env.foundation.type === "dev" && !env.foundation.launchSpec[0].disableDefaultEthProviders; } export async function cacheConfig() { - const configPath = process.env.MOON_CONFIG_PATH!; + const configPath = process.env.MOON_CONFIG_PATH; + + if (!configPath) { + throw new Error(`Environment ${process.env.MOON_TEST_ENV} not found in config`); + } const filePath = path.isAbsolute(configPath) ? configPath : path.join(process.cwd(), configPath); try { const config = parseConfigSync(filePath); @@ -83,12 +86,28 @@ export async function cacheConfig() { } } +export function getEnvironmentFromConfig(): Environment { + const globalConfig = importJsonConfig(); + const config = globalConfig.environments.find(({ name }) => name === process.env.MOON_TEST_ENV); + + if (!config) { + throw new Error(`Environment ${process.env.MOON_TEST_ENV} not found in config`); + } + + return config; +} + export function importJsonConfig(): MoonwallConfig { if (cachedConfig) { return cachedConfig; } - const configPath = process.env.MOON_CONFIG_PATH!; + const configPath = process.env.MOON_CONFIG_PATH; + + if (!configPath) { + throw new Error("No moonwall config path set. This is a defect, please raise it."); + } + const filePath = path.isAbsolute(configPath) ? configPath : path.join(process.cwd(), configPath); try { @@ -107,7 +126,12 @@ export async function importAsyncConfig(): Promise { return cachedConfig; } - const configPath = process.env.MOON_CONFIG_PATH!; + const configPath = process.env.MOON_CONFIG_PATH; + + if (!configPath) { + throw new Error("No moonwall config path set. This is a defect, please raise it."); + } + const filePath = path.isAbsolute(configPath) ? configPath : path.join(process.cwd(), configPath); try { @@ -123,13 +147,12 @@ export async function importAsyncConfig(): Promise { } export function loadEnvVars(): void { - const globalConfig = importJsonConfig(); - const env = globalConfig.environments.find(({ name }) => name === process.env.MOON_TEST_ENV)!; - env.envVars && - env.envVars.forEach((envVar) => { - const [key, value] = envVar.split("="); - process.env[key] = value; - }); + const env = getEnvironmentFromConfig(); + + for (const envVar of env.envVars || []) { + const [key, value] = envVar.split("="); + process.env[key] = value; + } } function replaceEnvVars(value: any): any { @@ -149,17 +172,18 @@ function replaceEnvVars(value: any): any { // } return envVarValue || match; }); - } else if (Array.isArray(value)) { + } + if (Array.isArray(value)) { return value.map(replaceEnvVars); - } else if (typeof value === "object" && value !== null) { + } + if (typeof value === "object" && value !== null) { return Object.fromEntries(Object.entries(value).map(([k, v]) => [k, replaceEnvVars(v)])); - } else { - return value; } + return value; } function traverseConfig(configObj: any, option: string): any { - if (typeof configObj !== "object" || configObj === null) return undefined; + if (typeof configObj !== "object" || !configObj) return undefined; if (Object.prototype.hasOwnProperty.call(configObj, option)) { return configObj[option]; @@ -179,13 +203,13 @@ export function parseZombieConfigForBins(zombieConfigPath: string) { const config = JSON.parse(readFileSync(zombieConfigPath, "utf8")); const commands: string[] = []; - if (config.relaychain && config.relaychain.default_command) { + if (config.relaychain?.default_command) { commands.push(path.basename(config.relaychain.default_command)); } if (config.parachains) { for (const parachain of config.parachains) { - if (parachain.collator && parachain.collator.command) { + if (parachain.collator?.command) { commands.push(path.basename(parachain.collator.command)); } } diff --git a/packages/cli/src/lib/contractFunctions.ts b/packages/cli/src/lib/contractFunctions.ts index 6ff3ff3c..e69374d6 100644 --- a/packages/cli/src/lib/contractFunctions.ts +++ b/packages/cli/src/lib/contractFunctions.ts @@ -44,7 +44,8 @@ function getCompiledPath(contractName: string) { throw new Error( `Neither solidity contract ${contractName}.sol nor its compiled json exists in ${contractsDir}` ); - } else if (!compiledJsonPath) { + } + if (!compiledJsonPath) { throw new Error( `Compiled contract ${contractName}.json doesn't exist\n` + `Please ${chalk.bgWhiteBright.blackBright("recompile contract")} ${contractName}.sol` @@ -63,7 +64,7 @@ export function fetchCompiledContract( abi: parsed.contract.abi, bytecode: parsed.byteCode, methods: parsed.contract.evm.methodIdentifiers, - deployedBytecode: ("0x" + parsed.contract.evm.deployedBytecode.object) as `0x${string}`, + deployedBytecode: `0x${parsed.contract.evm.deployedBytecode.object}` as `0x${string}`, }; } @@ -136,9 +137,12 @@ export async function interactWithContract( const account = privateKeyToAccount(privateKey); const gasParam = gas === "estimate" - ? await context - .viem() - .estimateGas({ account: account.address, to: contractAddress, value: 0n, data }) + ? await context.viem().estimateGas({ + account: account.address, + to: contractAddress, + value: 0n, + data, + }) : gas > 0n ? gas : 200_000n; @@ -163,21 +167,29 @@ export async function interactWithContract( if (call) { if (web3Library === "viem") { - const result = await context - .viem() - .call({ account: account.address, to: contractAddress, value: 0n, data, gas: gasParam }); - return decodeFunctionResult({ abi, functionName, data: result.data! }); - } else { - const result = await context.ethers().call({ - from: account.address, + const result = await context.viem().call({ + account: account.address, to: contractAddress, - value: toHex(value), + value: 0n, data, - gasLimit: toHex(gasParam), + gas: gasParam, }); - return new Interface(abi as InterfaceAbi).decodeFunctionResult(functionName, result); + + if (!result.data) { + throw new Error("No data field returned from call"); + } + return decodeFunctionResult({ abi, functionName, data: result.data }); } - } else if (!rawTxOnly) { + const result = await context.ethers().call({ + from: account.address, + to: contractAddress, + value: toHex(value), + data, + gasLimit: toHex(gasParam), + }); + return new Interface(abi as InterfaceAbi).decodeFunctionResult(functionName, result); + } + if (!rawTxOnly) { if (web3Library === "viem") { const hash = await (context.viem() as any).sendTransaction({ account: account, @@ -187,20 +199,18 @@ export async function interactWithContract( gas: gasParam, }); return hash; - } else { - const signer = new Wallet(privateKey, context.ethers().provider); - const { hash } = await signer.sendTransaction({ - from: account.address, - to: contractAddress, - value: toHex(value), - data, - gasLimit: toHex(gasParam), - }); - return hash; } - } else { - throw new Error("This should never happen, if it does there's a logic error in the code"); + const signer = new Wallet(privateKey, context.ethers().provider); + const { hash } = await signer.sendTransaction({ + from: account.address, + to: contractAddress, + value: toHex(value), + data, + gasLimit: toHex(gasParam), + }); + return hash; } + throw new Error("This should never happen, if it does there's a logic error in the code"); } export async function deployCreateCompiledContract( diff --git a/packages/cli/src/lib/globalContext.ts b/packages/cli/src/lib/globalContext.ts index e0310df5..311270ff 100644 --- a/packages/cli/src/lib/globalContext.ts +++ b/packages/cli/src/lib/globalContext.ts @@ -28,6 +28,7 @@ import { vitestAutoUrl, } from "../internal/providerFactories"; import { + getEnvironmentFromConfig, importAsyncConfig, isEthereumDevConfig, isEthereumZombieConfig, @@ -38,7 +39,7 @@ const debugSetup = Debug("global:context"); export class MoonwallContext { private static instance: MoonwallContext | undefined; - configured: boolean = false; + configured = false; environment!: MoonwallEnvironment; providers: ConnectedProvider[]; nodes: ChildProcess[]; @@ -48,7 +49,12 @@ export class MoonwallContext { ipcServer?: net.Server; constructor(config: MoonwallConfig) { - const env = config.environments.find(({ name }) => name == process.env.MOON_TEST_ENV)!; + const env = config.environments.find(({ name }) => name === process.env.MOON_TEST_ENV); + + if (!env) { + throw new Error(`Environment ${process.env.MOON_TEST_ENV} not found in config`); + } + this.providers = []; this.nodes = []; this.foundation = env.foundation.type; @@ -56,7 +62,12 @@ export class MoonwallContext { public async setupFoundation() { const config = await importAsyncConfig(); - const env = config.environments.find(({ name }) => name == process.env.MOON_TEST_ENV)!; + const env = config.environments.find(({ name }) => name === process.env.MOON_TEST_ENV); + + if (!env) { + throw new Error(`Environment ${process.env.MOON_TEST_ENV} not found in config`); + } + const foundationHandlers: Record< FoundationType, (env: Environment, config: MoonwallConfig) => Promise @@ -104,7 +115,7 @@ export class MoonwallContext { } const { cmd, args, launch } = await parseRunCmd( - env.foundation.launchSpec![0], + env.foundation.launchSpec[0], config.additionalRepos ); @@ -113,7 +124,7 @@ export class MoonwallContext { foundationType: "dev", nodes: [ { - name: env.foundation.launchSpec![0].name, + name: env.foundation.launchSpec[0].name, cmd, args, launch, @@ -155,19 +166,23 @@ export class MoonwallContext { throw new Error(`Foundation type must be 'chopsticks'`); } + if (!env.connections || env.connections.length === 0) { + throw new Error( + `${env.name} env config is missing connections specification, required by foundation CHOPSTICKS` + ); + } + this.rtUpgradePath = env.foundation.rtUpgradePath; return { name: env.name, foundationType: "chopsticks", - nodes: [parseChopsticksRunCmd(env.foundation.launchSpec!)], - providers: [...ProviderFactory.prepare(env.connections!)], + nodes: [parseChopsticksRunCmd(env.foundation.launchSpec)], + providers: [...ProviderFactory.prepare(env.connections)], } satisfies IGlobalContextFoundation; } private async startZombieNetwork() { - const config = await importAsyncConfig(); - const env = config.environments.find(({ name }) => name == process.env.MOON_TEST_ENV)!; - + const env = getEnvironmentFromConfig(); if (env.foundation.type !== "zombie") { throw new Error(`Foundation type must be 'zombie', something has gone very wrong.`); } @@ -189,9 +204,13 @@ export class MoonwallContext { const onProcessExit = () => { try { - const processIds = Object.values((this.zombieNetwork!.client as any).processMap) - .filter((item) => item!["pid"]) - .map((process) => process!["pid"]); + if (!this.zombieNetwork) { + throw "Zombie network not found to kill"; + } + + const processIds = Object.values((this.zombieNetwork.client as any).processMap) + .filter((item: any) => item.pid) + .map((process: any) => process.pid); exec(`kill ${processIds.join(" ")}`, (error) => { if (error) { console.error(`Error killing process: ${error.message}`); @@ -310,7 +329,11 @@ export class MoonwallContext { } catch (e: any) { console.log("📨 Error processing message from client:", data.toString()); console.error(e.message); - writeToClient({ status: "failure", result: false, message: e.message }); + writeToClient({ + status: "failure", + result: false, + message: e.message, + }); } }); }); @@ -331,11 +354,10 @@ export class MoonwallContext { public async startNetwork() { const ctx = await MoonwallContext.getContext(); - if (process.env.MOON_RECYCLE == "true") { + if (process.env.MOON_RECYCLE === "true") { return ctx; } - // const activeNodes = this.nodes.filter((node) => !node.killed); if (this.nodes.length > 0) { return ctx; } @@ -347,7 +369,7 @@ export class MoonwallContext { const promises = nodes.map(async ({ cmd, args, name, launch }) => { if (launch) { - const { runningNode } = await launchNode(cmd, args, name!); + const { runningNode } = await launchNode(cmd, args, name || "node"); this.nodes.push(runningNode); } else { return Promise.resolve(); @@ -358,11 +380,10 @@ export class MoonwallContext { return ctx; } - public async connectEnvironment(silent: boolean = false): Promise { - const config = await importAsyncConfig(); - const env = config.environments.find(({ name }) => name == process.env.MOON_TEST_ENV)!; + public async connectEnvironment(silent = false): Promise { + const env = getEnvironmentFromConfig(); - if (this.environment.foundationType == "zombie") { + if (this.environment.foundationType === "zombie") { this.environment.providers = env.connections ? ProviderFactory.prepare(env.connections) : isEthereumZombieConfig() @@ -383,12 +404,18 @@ export class MoonwallContext { ); await Promise.all(promises); - if (this.foundation == "zombie") { - let readStreams: any[]; + if (this.foundation === "zombie") { + let readStreams: any[] = []; if (!isOptionSet("disableLogEavesdropping")) { !silent && console.log(`đŸĻģ Eavesdropping on node logs at ${process.env.MOON_ZOMBIE_DIR}`); - const zombieNodeLogs = process.env - .MOON_ZOMBIE_NODES!.split("|") + + const envVar = process.env.MOON_ZOMBIE_NODES; + + if (!envVar) { + throw new Error("MOON_ZOMBIE_NODES not set, this is an error please raise."); + } + const zombieNodeLogs = envVar + .split("|") .map((nodeName) => `${process.env.MOON_ZOMBIE_DIR}/${nodeName}.log`); readStreams = zombieNodeLogs.map((logPath) => { @@ -407,10 +434,10 @@ export class MoonwallContext { } const promises = this.providers - .filter(({ type }) => type == "polkadotJs") + .filter(({ type }) => type === "polkadotJs") .filter( ({ name }) => - env.foundation.type == "zombie" && + env.foundation.type === "zombie" && (!env.foundation.zombieSpec.skipBlockCheck || !env.foundation.zombieSpec.skipBlockCheck.includes(name)) ) @@ -420,7 +447,7 @@ export class MoonwallContext { while ( ( await (provider.api as ApiPromise).rpc.chain.getBlock() - ).block.header.number.toNumber() == 0 + ).block.header.number.toNumber() === 0 ) { await timer(500); } @@ -432,7 +459,10 @@ export class MoonwallContext { await Promise.all(promises); if (!isOptionSet("disableLogEavesdropping")) { - readStreams!.forEach((readStream) => readStream.close()); + for (const readStream of readStreams) { + readStream.close(); + } + // readStreams.forEach((readStream) => readStream.close()); } } @@ -441,18 +471,20 @@ export class MoonwallContext { public async disconnect(providerName?: string) { if (providerName) { - this.providers.find(({ name }) => name === providerName)!.disconnect(); - this.providers.filter(({ name }) => name !== providerName); + const prov = this.providers.find(({ name }) => name === providerName); + + if (!prov) { + throw new Error(`Provider ${providerName} not found`); + } + + prov.disconnect(); } else { await Promise.all(this.providers.map((prov) => prov.disconnect())); this.providers = []; } } - public static async getContext( - config?: MoonwallConfig, - force: boolean = false - ): Promise { + public static async getContext(config?: MoonwallConfig, force = false): Promise { if (!MoonwallContext.instance?.configured || force) { if (!config) { throw new Error("❌ Config must be provided on Global Context instantiation"); @@ -465,7 +497,7 @@ export class MoonwallContext { } public static async destroy() { - const ctx = this.instance; + const ctx = MoonwallContext.instance; if (!ctx) { throw new Error("❌ No context to destroy"); @@ -505,8 +537,8 @@ export class MoonwallContext { console.log("đŸĒ“ Killing zombie nodes"); await ctx.zombieNetwork.stop(); const processIds = Object.values((ctx.zombieNetwork.client as any).processMap) - .filter((item) => item!["pid"]) - .map((process) => process!["pid"]); + .filter((item: any) => item.pid) + .map((process: any) => process.pid); try { execSync(`kill ${processIds.join(" ")}`, {}); diff --git a/packages/cli/src/lib/governanceProcedures.ts b/packages/cli/src/lib/governanceProcedures.ts index e9b006c8..1165b445 100644 --- a/packages/cli/src/lib/governanceProcedures.ts +++ b/packages/cli/src/lib/governanceProcedures.ts @@ -44,14 +44,14 @@ export const instantFastTrack = async < { votingPeriod, delayPeriod } = { votingPeriod: 2, delayPeriod: 0 } ): Promise => { const proposalHash = - typeof proposal == "string" ? proposal : await notePreimage(context, proposal); + typeof proposal === "string" ? proposal : await notePreimage(context, proposal); await execCouncilProposal( context, context.polkadotJs().tx.democracy.externalProposeMajority({ Lookup: { hash: proposalHash, - len: typeof proposal == "string" ? proposal : proposal.method.encodedLength, + len: typeof proposal === "string" ? proposal : proposal.method.encodedLength, }, }) ); @@ -71,7 +71,7 @@ export const execCouncilProposal = async < >( context: DevModeContext, polkadotCall: Call, - index: number = -1, + index = -1, voters: KeyringPair[] = COUNCIL_MEMBERS, threshold: number = COUNCIL_THRESHOLD ) => { @@ -84,22 +84,35 @@ export const execCouncilProposal = async < .signAsync(charleth) ); + if (!proposalResult) { + throw "Proposal result is undefined"; + } + if (threshold <= 1) { // Proposal are automatically executed on threshold <= 1 return proposalResult; } - expect(proposalResult!.successful, `Council proposal refused: ${proposalResult?.error?.name}`).to - .be.true; - const proposalHash = proposalResult!.events - .find(({ event: { method } }) => method.toString() == "Proposed")! - .event.data[2].toHex() as string; + if (!proposalResult.successful) { + throw `Council proposal refused: ${proposalResult?.error?.name}`; + } + + const proposed = proposalResult.events.find( + ({ event: { method } }) => method.toString() === "Proposed" + ); + + if (!proposed) { + throw "Proposed event not found"; + } + + const proposalHash = proposed.event.data[2].toHex() as string; // Dorothy vote for this proposal and close it const proposalIndex = index >= 0 ? index - : (await context.polkadotJs().query.councilCollective.proposalCount()).toNumber() - 1; + : ((await context.polkadotJs().query.councilCollective.proposalCount()) as any).toNumber() - + 1; await Promise.all( voters.map((voter) => context @@ -138,7 +151,7 @@ export const proposeReferendaAndDeposit = async < ): Promise<[number, string]> => { // Fetch proposal hash const proposalHash = - typeof proposal == "string" ? proposal : await notePreimage(context, proposal); + typeof proposal === "string" ? proposal : await notePreimage(context, proposal); // Post referenda const { result: proposalResult } = await context.createBlock( @@ -149,7 +162,7 @@ export const proposeReferendaAndDeposit = async < { Lookup: { hash: proposalHash, - len: typeof proposal == "string" ? proposal : proposal.method.encodedLength, + len: typeof proposal === "string" ? proposal : proposal.method.encodedLength, }, }, { At: 0 } @@ -157,12 +170,21 @@ export const proposeReferendaAndDeposit = async < .signAsync(alith) ); - expect(proposalResult!.successful, `Unable to post referenda: ${proposalResult?.error?.name}`).to - .be.true; + if (!proposalResult) { + throw "Proposal result is undefined"; + } - const refIndex = proposalResult!.events - .find(({ event: { method } }) => method.toString() == "Submitted")! - .event.data[0].toString(); + if (!proposalResult.successful) { + throw `Unable to post referenda: ${proposalResult?.error?.name}`; + } + + const refIndex = proposalResult.events + .find(({ event: { method } }) => method.toString() === "Submitted") + ?.event.data[0].toString(); + + if (!refIndex) { + throw "Referendum index not found"; + } // Place decision deposit await context.createBlock( @@ -254,17 +276,24 @@ export const execTechnicalCommitteeProposal = async < context.polkadotJs().tx.techCommitteeCollective.propose(threshold, polkadotCall, lengthBound) ); + if (!proposalResult) { + throw "Proposal result is undefined"; + } + if (threshold <= 1) { // Proposal are automatically executed on threshold <= 1 return proposalResult; } - expect(proposalResult!.successful, `Council proposal refused: ${proposalResult?.error?.name}`).to + expect(proposalResult.successful, `Council proposal refused: ${proposalResult?.error?.name}`).to .be.true; - const proposalHash = proposalResult!.events - .find(({ event: { method } }) => method.toString() == "Proposed")! - .event.data[2].toHex() as string; + const proposalHash = proposalResult.events + .find(({ event: { method } }) => method.toString() === "Proposed") + ?.event.data[2].toHex(); + if (!proposalHash) { + throw "Proposed event not found"; + } // Get proposal count const proposalCount = await context.polkadotJs().query.techCommitteeCollective.proposalCount(); @@ -295,14 +324,14 @@ export const execTechnicalCommitteeProposal = async < export const executeProposalWithCouncil = async (api: ApiPromise, encodedHash: string) => { let nonce = (await api.rpc.system.accountNextIndex(alith.address)).toNumber(); - const referendumNextIndex = (await api.query.democracy.referendumCount()).toNumber(); + const referendumNextIndex = ((await api.query.democracy.referendumCount()) as any).toNumber(); // process.stdout.write( // `Sending council motion (${encodedHash} ` + // `[threashold: 1, expected referendum: ${referendumNextIndex}])...` // ); const callData = - api.consts.system.version.specVersion.toNumber() >= 2000 + (api.consts.system.version as any).specVersion.toNumber() >= 2000 ? { Legacy: encodedHash } : encodedHash; @@ -327,21 +356,25 @@ export const executeProposalWithCouncil = async (api: ApiPromise, encodedHash: s }) .signAndSend(alith, { nonce: nonce++ }), ]); - process.stdout.write(`✅\n`); + process.stdout.write("✅\n"); process.stdout.write(`Waiting for referendum [${referendumNextIndex}] to be executed...`); let referenda: PalletDemocracyReferendumInfo | undefined; while (!referenda) { - referenda = (await api.query.democracy.referendumInfoOf.entries()) - .find( - (ref: any) => - ref[1].unwrap().isFinished && - api.registry.createType("u32", ref[0].toU8a().slice(-4)).toNumber() == referendumNextIndex - )?.[1] - .unwrap(); - await new Promise((resolve) => setTimeout(resolve, 1000)); + try { + referenda = ( + (await api.query.democracy.referendumInfoOf.entries()).find( + (ref: any) => + ref[1].unwrap().isFinished && + (api.registry.createType("u32", ref[0].toU8a().slice(-4)) as any).toNumber() === + referendumNextIndex + )?.[1] as any + ).unwrap(); + } catch { + await new Promise((resolve) => setTimeout(resolve, 1000)); + } } - process.stdout.write(`${referenda.asFinished.approved ? `✅` : `❌`} \n`); + process.stdout.write(`${referenda.asFinished.approved ? "✅" : "❌"} \n`); if (!referenda.asFinished.approved) { throw new Error("Finished Referendum was not approved"); } diff --git a/packages/cli/src/lib/handlers/chopsticksHandler.ts b/packages/cli/src/lib/handlers/chopsticksHandler.ts index 2a1af614..7ba4b8d7 100644 --- a/packages/cli/src/lib/handlers/chopsticksHandler.ts +++ b/packages/cli/src/lib/handlers/chopsticksHandler.ts @@ -29,23 +29,33 @@ export const chopsticksHandler: FoundationHandler<"chopsticks"> = ({ ); const systemAccountStorageType = metadata.pallets[systemPalletIndex].storage .unwrap() - .items.find((storage) => storage.name.toString() === "Account")!.type; + .items.find((storage) => storage.name.toString() === "Account")?.type; + + if (!systemAccountStorageType) { + throw new Error("System.Account storage not found"); + } return metadata.lookup.getTypeDef(systemAccountStorageType.asMap.key).type; }; const newKeyring = () => { - const isEth = accountTypeLookup() == "AccountId20"; + const isEth = accountTypeLookup() === "AccountId20"; const keyring = new Keyring({ type: isEth ? "ethereum" : "sr25519", }); return { - alice: keyring.addFromUri(isEth ? ALITH_PRIVATE_KEY : "//Alice", { name: "Alice default" }), - bob: keyring.addFromUri(isEth ? BALTATHAR_PRIVATE_KEY : "//Bob", { name: "Bob default" }), + alice: keyring.addFromUri(isEth ? ALITH_PRIVATE_KEY : "//Alice", { + name: "Alice default", + }), + bob: keyring.addFromUri(isEth ? BALTATHAR_PRIVATE_KEY : "//Bob", { + name: "Bob default", + }), charlie: keyring.addFromUri(isEth ? CHARLETH_PRIVATE_KEY : "//Charlie", { name: "Charlie default", }), - dave: keyring.addFromUri(isEth ? DOROTHY_PRIVATE_KEY : "//Dave", { name: "Dave default" }), + dave: keyring.addFromUri(isEth ? DOROTHY_PRIVATE_KEY : "//Dave", { + name: "Dave default", + }), }; }; @@ -67,7 +77,7 @@ export const chopsticksHandler: FoundationHandler<"chopsticks"> = ({ createBlock: async (options: ChopsticksBlockCreation = {}) => await createChopsticksBlock(context, options), - setStorage: async (params?: { + setStorage: async (params: { providerName?: string; module: string; method: string; @@ -75,7 +85,11 @@ export const chopsticksHandler: FoundationHandler<"chopsticks"> = ({ }) => await sendSetStorageRequest(params), upgradeRuntime: async (providerName?: string) => { - const path = (await MoonwallContext.getContext()).rtUpgradePath!; + const path = (await MoonwallContext.getContext()).rtUpgradePath; + + if (!path) { + throw new Error("No runtime upgrade path defined in config"); + } await upgradeRuntimeChopsticks(ctx, path, providerName); }, diff --git a/packages/cli/src/lib/handlers/devHandler.ts b/packages/cli/src/lib/handlers/devHandler.ts index 5fa9bd58..9c2c9a3f 100644 --- a/packages/cli/src/lib/handlers/devHandler.ts +++ b/packages/cli/src/lib/handlers/devHandler.ts @@ -24,7 +24,7 @@ import { import { Keyring } from "@polkadot/api"; import { ApiTypes } from "@polkadot/api/types"; import { createDevBlock } from "../../internal/foundations/devModeHelpers"; -import { importJsonConfig, isEthereumDevConfig } from "../configReader"; +import { getEnvironmentFromConfig, importJsonConfig, isEthereumDevConfig } from "../configReader"; import { deployCreateCompiledContract, interactWithContract, @@ -32,8 +32,7 @@ import { } from "../contractFunctions"; export const devHandler: FoundationHandler<"dev"> = ({ testCases, context, testCase, logger }) => { - const config = importJsonConfig(); - const env = config.environments.find((env) => env.name == process.env.MOON_TEST_ENV)!; + const env = getEnvironmentFromConfig(); const ethCompatible = isEthereumDevConfig(); const accountTypeLookup = () => { @@ -41,25 +40,36 @@ export const devHandler: FoundationHandler<"dev"> = ({ testCases, context, testC const systemPalletIndex = metadata.pallets.findIndex( (pallet) => pallet.name.toString() === "System" ); - const systemAccountStorageType = metadata.pallets[systemPalletIndex].storage + const systemAccountStorage = metadata.pallets[systemPalletIndex].storage .unwrap() - .items.find((storage) => storage.name.toString() === "Account")!.type; + .items.find((storage) => storage.name.toString() === "Account"); + + if (!systemAccountStorage) { + throw new Error("Account storage not found"); + } + const systemAccountStorageType = systemAccountStorage.type; return metadata.lookup.getTypeDef(systemAccountStorageType.asMap.key).type; }; const newKeyring = () => { - const isEth = accountTypeLookup() == "AccountId20"; + const isEth = accountTypeLookup() === "AccountId20"; const keyring = new Keyring({ type: isEth ? "ethereum" : "sr25519", }); return { - alice: keyring.addFromUri(isEth ? ALITH_PRIVATE_KEY : "//Alice", { name: "Alice default" }), - bob: keyring.addFromUri(isEth ? BALTATHAR_PRIVATE_KEY : "//Bob", { name: "Bob default" }), + alice: keyring.addFromUri(isEth ? ALITH_PRIVATE_KEY : "//Alice", { + name: "Alice default", + }), + bob: keyring.addFromUri(isEth ? BALTATHAR_PRIVATE_KEY : "//Bob", { + name: "Bob default", + }), charlie: keyring.addFromUri(isEth ? CHARLETH_PRIVATE_KEY : "//Charlie", { name: "Charlie default", }), - dave: keyring.addFromUri(isEth ? DOROTHY_PRIVATE_KEY : "//Dave", { name: "Dave default" }), + dave: keyring.addFromUri(isEth ? DOROTHY_PRIVATE_KEY : "//Dave", { + name: "Dave default", + }), }; }; @@ -138,7 +148,10 @@ export const devHandler: FoundationHandler<"dev"> = ({ testCases, context, testC writePrecompile: !ethCompatible ? undefined : async (options: PrecompileCallOptions) => { - const response = await interactWithPrecompileContract(ctx, { call: false, ...options }); + const response = await interactWithPrecompileContract(ctx, { + call: false, + ...options, + }); return response as `0x${string}`; }, @@ -155,7 +168,10 @@ export const devHandler: FoundationHandler<"dev"> = ({ testCases, context, testC writeContract: !ethCompatible ? undefined : async (options: ContractCallOptions) => { - const response = await interactWithContract(ctx, { call: false, ...options }); + const response = await interactWithContract(ctx, { + call: false, + ...options, + }); return response as `0x${string}`; }, diff --git a/packages/cli/src/lib/handlers/readOnlyHandler.ts b/packages/cli/src/lib/handlers/readOnlyHandler.ts index 70d3014f..2351651b 100644 --- a/packages/cli/src/lib/handlers/readOnlyHandler.ts +++ b/packages/cli/src/lib/handlers/readOnlyHandler.ts @@ -12,7 +12,7 @@ export const readOnlyHandler: FoundationHandler<"read_only"> = ({ context: { ...context, waitBlock: async ( - blocksToWaitFor: number = 1, + blocksToWaitFor = 1, chainName?: string, mode: "height" | "quantity" = "quantity" ) => { @@ -34,7 +34,8 @@ export const readOnlyHandler: FoundationHandler<"read_only"> = ({ const newBlockNumber = (await api.rpc.chain.getBlock()).block.header.number.toNumber(); if (mode === "quantity" && newBlockNumber >= currentBlockNumber + blocksToWaitFor) { break; - } else if (mode === "height" && newBlockNumber >= blocksToWaitFor) { + } + if (mode === "height" && newBlockNumber >= blocksToWaitFor) { break; } } diff --git a/packages/cli/src/lib/handlers/zombieHandler.ts b/packages/cli/src/lib/handlers/zombieHandler.ts index 71f75acc..810bc082 100644 --- a/packages/cli/src/lib/handlers/zombieHandler.ts +++ b/packages/cli/src/lib/handlers/zombieHandler.ts @@ -15,8 +15,8 @@ export const zombieHandler: FoundationHandler<"zombie"> = ({ context: { ...context, waitBlock: async ( - blocksToWaitFor: number = 1, - chain: string = "parachain", + blocksToWaitFor = 1, + chain = "parachain", mode: "height" | "quantity" = "quantity" ) => { const ctx = await MoonwallContext.getContext(); @@ -34,7 +34,8 @@ export const zombieHandler: FoundationHandler<"zombie"> = ({ const newBlockNumber = (await api.rpc.chain.getBlock()).block.header.number.toNumber(); if (mode === "quantity" && newBlockNumber >= currentBlockNumber + blocksToWaitFor) { break; - } else if (mode === "height" && newBlockNumber >= blocksToWaitFor) { + } + if (mode === "height" && newBlockNumber >= blocksToWaitFor) { break; } } @@ -42,6 +43,10 @@ export const zombieHandler: FoundationHandler<"zombie"> = ({ upgradeRuntime: async (options: UpgradePreferences = {}) => { const ctx = await MoonwallContext.getContext(); + + if (!ctx.rtUpgradePath) { + throw new Error("Runtime upgrade path not defined in moonwall config"); + } const provider = ctx.providers.find((prov) => prov.name === "parachain"); if (!provider) { @@ -52,7 +57,7 @@ export const zombieHandler: FoundationHandler<"zombie"> = ({ const params: UpgradePreferences = { runtimeName: options.runtimeName || "moonbase", runtimeTag: options.runtimeTag || "local", - localPath: options.localPath || ctx.rtUpgradePath!, + localPath: options.localPath || ctx.rtUpgradePath, useGovernance: options.useGovernance || false, waitMigration: options.waitMigration || true, from: options.from || alith, diff --git a/packages/cli/src/lib/repoDefinitions/tanssi.ts b/packages/cli/src/lib/repoDefinitions/tanssi.ts index 21938838..4ffce4aa 100644 --- a/packages/cli/src/lib/repoDefinitions/tanssi.ts +++ b/packages/cli/src/lib/repoDefinitions/tanssi.ts @@ -3,7 +3,10 @@ import { RepoSpec } from "@moonwall/types"; const repo: RepoSpec = { name: "tanssi", binaries: [ - { name: "tanssi-node", defaultArgs: ["--dev", "--sealing=manual", "--no-hardware-benchmarks"] }, + { + name: "tanssi-node", + defaultArgs: ["--dev", "--sealing=manual", "--no-hardware-benchmarks"], + }, { name: "container-chain-template-simple-node" }, { name: "container-chain-template-frontier-node" }, ], diff --git a/packages/cli/src/lib/rpcFunctions.ts b/packages/cli/src/lib/rpcFunctions.ts index 063d014d..6baf9011 100644 --- a/packages/cli/src/lib/rpcFunctions.ts +++ b/packages/cli/src/lib/rpcFunctions.ts @@ -1,10 +1,9 @@ import { vitestAutoUrl } from "../internal/providerFactories"; -import { importAsyncConfig } from "./configReader"; +import { getEnvironmentFromConfig } from "./configReader"; import fetch from "node-fetch"; export async function customDevRpcRequest(method: string, params: any[] = []): Promise { - const globalConfig = await importAsyncConfig(); - const env = globalConfig.environments.find(({ name }) => name == process.env.MOON_TEST_ENV)!; + const env = getEnvironmentFromConfig(); const endpoint = env.connections ? env.connections[0].endpoints[0].replace("ws://", "http://") : vitestAutoUrl().replace("ws://", "http://").replace("wss://", "https://"); diff --git a/packages/cli/src/lib/runnerContext.ts b/packages/cli/src/lib/runnerContext.ts index e4ad0275..b1824090 100644 --- a/packages/cli/src/lib/runnerContext.ts +++ b/packages/cli/src/lib/runnerContext.ts @@ -18,7 +18,7 @@ import Debug from "debug"; import { Wallet } from "ethers"; import { afterAll, beforeAll, describe, it } from "vitest"; import { Web3 } from "web3"; -import { importAsyncConfig } from "./configReader"; +import { getEnvironmentFromConfig, importAsyncConfig } from "./configReader"; import { MoonwallContext, contextCreator } from "./globalContext"; import { chopsticksHandler } from "./handlers/chopsticksHandler"; import { devHandler } from "./handlers/devHandler"; @@ -80,15 +80,9 @@ export function describeSuite({ } let ctx: MoonwallContext | null = null; - beforeAll(async function () { - const globalConfig = await importAsyncConfig(); - - if (!process.env.MOON_TEST_ENV) { - throw new Error("MOON_TEST_ENV not set"); - } - + beforeAll(async () => { + const env = getEnvironmentFromConfig(); ctx = await contextCreator(); - const env = globalConfig.environments.find(({ name }) => name === process.env.MOON_TEST_ENV)!; if (env.foundation.type === "read_only") { const settings = loadParams(env.foundation.launchSpec); @@ -96,7 +90,7 @@ export function describeSuite({ } }); - afterAll(async function () { + afterAll(async () => { await MoonwallContext.destroy(); ctx = null; }); @@ -122,23 +116,27 @@ export function describeSuite({ it(`📁 ${suiteId.concat(params.id)} ${params.title}`, params.test, params.timeout); }; - describe(`🗃ī¸ ${suiteId} ${title}`, function () { + describe(`🗃ī¸ ${suiteId} ${title}`, () => { const getApi = (apiType?: T, apiName?: string) => { - const provider = ctx!.providers.find((prov) => { + if (!ctx) { + throw new Error("Context not initialized"); + } + const provider = ctx.providers.find((prov) => { if (apiType && apiName) { - return prov.type == apiType && prov.name === apiName; - } else if (apiType && !apiName) { - return prov.type == apiType; - } else if (!apiType && apiName) { + return prov.type === apiType && prov.name === apiName; + } + if (apiType && !apiName) { + return prov.type === apiType; + } + if (!apiType && apiName) { return prov.name === apiName; - } else { - return false; } + return false; }); if (!provider) { throw new Error( - `API of type ${apiType} ${apiName ? "and name " + apiName : ""} could not be found` + `API of type ${apiType} ${apiName ? `and name ${apiName}` : ""} could not be found` ); } @@ -209,7 +207,11 @@ const scheduleWithBottleneck = (api: T): T => { const origMethod = target[propKey]; if (typeof origMethod === "function" && propKey !== "rpc" && propKey !== "tx") { return (...args: any[]) => { - return limiter!.schedule(() => origMethod.apply(target, args)); + if (!limiter) { + throw new Error("Limiter not initialized"); + } + + return limiter.schedule(() => origMethod.apply(target, args)); }; } return origMethod; diff --git a/packages/cli/src/lib/upgradeProcedures.ts b/packages/cli/src/lib/upgradeProcedures.ts index 57e730bd..f4089bff 100644 --- a/packages/cli/src/lib/upgradeProcedures.ts +++ b/packages/cli/src/lib/upgradeProcedures.ts @@ -15,7 +15,7 @@ export async function upgradeRuntimeChopsticks( providerName?: string ) { if (!existsSync(path)) { - throw new Error("Runtime wasm not found at path: " + path); + throw new Error(`Runtime wasm not found at path: ${path}`); } const rtWasm = readFileSync(path); const rtHex = `0x${rtWasm.toString("hex")}`; @@ -42,39 +42,56 @@ export async function upgradeRuntime(api: ApiPromise, preferences: UpgradePrefer useGovernance: false, ...preferences, }; + return new Promise(async (resolve, reject) => { const log = (text: string) => { if (options.logger) { return options.logger(text); - } else { - return; } + return; }; + if (!options.runtimeName) { + throw new Error("'runtimeName' is required to upgrade runtime"); + } + + if (!options.runtimeTag) { + throw new Error("'runtimeTag' is required to upgrade runtime"); + } + + if (!options.from) { + throw new Error("'from' is required to upgrade runtime"); + } + try { const code = fs .readFileSync( - await getRuntimeWasm(options.runtimeName!, options.runtimeTag!, options.localPath) + await getRuntimeWasm(options.runtimeName, options.runtimeTag, options.localPath) ) .toString(); log("Checking if upgrade is needed..."); const existingCode = await api.rpc.state.getStorage(":code"); - if (existingCode!.toString() == code) { + + if (!existingCode) { + throw "No existing runtime code found"; + } + + if (existingCode.toString() === code) { reject( - `Runtime upgrade with same code: ${existingCode!.toString().slice(0, 20)} vs ${code + `Runtime upgrade with same code: ${existingCode.toString().slice(0, 20)} vs ${code .toString() .slice(0, 20)}` ); } - let nonce = (await api.rpc.system.accountNextIndex(options.from!.address)).toNumber(); + let nonce = (await api.rpc.system.accountNextIndex(options.from.address)).toNumber(); if (options.useGovernance) { log("Using governance..."); // TODO: remove support for old style after all chains upgraded to 2400+ const proposal = - api.consts.system.version.specVersion.toNumber() >= 2400 + (api.consts.system.version as any).specVersion.toNumber() >= 2400 ? (api.tx.parachainSystem as any).authorizeUpgrade(blake2AsHex(code), false) : (api.tx.parachainSystem as any).authorizeUpgrade(blake2AsHex(code)); const encodedProposal = proposal.method.toHex(); @@ -100,14 +117,14 @@ export async function upgradeRuntime(api: ApiPromise, preferences: UpgradePrefer if (api.query.preimage) { await api.tx.preimage .notePreimage(encodedProposal) - .signAndSend(options.from!, { nonce: nonce++ }); + .signAndSend(options.from, { nonce: nonce++ }); } else { // TODO: remove support for democracy after 2000 await api.tx.democracy .notePreimage(encodedProposal) - .signAndSend(options.from!, { nonce: nonce++ }); + .signAndSend(options.from, { nonce: nonce++ }); } - log(`Complete ✅`); + log("Complete ✅"); } // Check if already in referendum @@ -119,34 +136,34 @@ export async function upgradeRuntime(api: ApiPromise, preferences: UpgradePrefer (ref: any) => ref[1].unwrap().isOngoing && ref[1].unwrap().asOngoing.proposal.isLookup && - ref[1].unwrap().asOngoing.proposal.asLookup.hash.toHex() == encodedHash + ref[1].unwrap().asOngoing.proposal.asLookup.hash.toHex() === encodedHash ) .map((ref) => - api.registry.createType("u32", ref[0].toU8a().slice(-4)).toNumber() + (api.registry.createType("u32", ref[0].toU8a().slice(-4)) as any).toNumber() )?.[0] : referendum .filter( (ref: any) => ref[1].unwrap().isOngoing && - (ref[1].unwrap().asOngoing as any).proposalHash.toHex() == encodedHash + (ref[1].unwrap().asOngoing as any).proposalHash.toHex() === encodedHash ) .map((ref) => - api.registry.createType("u32", ref[0].toU8a().slice(-4)).toNumber() + (api.registry.createType("u32", ref[0].toU8a().slice(-4)) as any).toNumber() )?.[0]; if (referendaIndex !== null && referendaIndex !== undefined) { - log(`Vote for upgrade already in referendum, cancelling it.`); + log("Vote for upgrade already in referendum, cancelling it."); await cancelReferendaWithCouncil(api, referendaIndex); } await executeProposalWithCouncil(api, encodedHash); // Needs to retrieve nonce after those governance calls - nonce = (await api.rpc.system.accountNextIndex(options.from!.address)).toNumber(); - log(`Enacting authorized upgrade...`); + nonce = (await api.rpc.system.accountNextIndex(options.from.address)).toNumber(); + log("Enacting authorized upgrade..."); await api.tx.parachainSystem .enactAuthorizedUpgrade(code) - .signAndSend(options.from!, { nonce: nonce++ }); - log(`Complete ✅`); + .signAndSend(options.from, { nonce: nonce++ }); + log("Complete ✅"); } else { log( `Sending sudo.setCode (${sha256(Buffer.from(code))} [~${Math.floor( @@ -164,11 +181,11 @@ export async function upgradeRuntime(api: ApiPromise, preferences: UpgradePrefer refTime: 1, } ) - .signAndSend(options.from!, { nonce: nonce++ }); - log(`✅`); + .signAndSend(options.from, { nonce: nonce++ }); + log("✅"); } - log(`Waiting to apply new runtime (${chalk.red(`~4min`)})...`); + log(`Waiting to apply new runtime (${chalk.red("~4min")})...`); let isInitialVersion = true; const unsub = await api.rpc.state.subscribeStorage([":code"], async (newCode: any) => { @@ -177,14 +194,14 @@ export async function upgradeRuntime(api: ApiPromise, preferences: UpgradePrefer log( `Complete ✅ [New Code: ${newCode.toString().slice(0, 5)}...${newCode .toString() - .slice(-4)} , Old Code:${existingCode!.toString().slice(0, 5)}...${existingCode! + .slice(-4)} , Old Code:${existingCode.toString().slice(0, 5)}...${existingCode .toString() .slice(-4)}] [#${blockNumber}]` ); unsub(); - if (newCode!.toString() != code) { + if (newCode.toString() !== code) { reject( - `Unexpected new code: ${newCode!.toString().slice(0, 20)} vs ${code + `Unexpected new code: ${newCode.toString().slice(0, 20)} vs ${code .toString() .slice(0, 20)}` ); @@ -193,7 +210,7 @@ export async function upgradeRuntime(api: ApiPromise, preferences: UpgradePrefer const blockToWait = (await api.rpc.chain.getHeader()).number.toNumber() + 1; await new Promise(async (resolve) => { const subBlocks = await api.rpc.chain.subscribeNewHeads(async (header) => { - if (header.number.toNumber() == blockToWait) { + if (header.number.toNumber() === blockToWait) { subBlocks(); resolve(blockToWait); } @@ -205,7 +222,8 @@ export async function upgradeRuntime(api: ApiPromise, preferences: UpgradePrefer isInitialVersion = false; }); } catch (e) { - console.error(`Failed to setCode`); + console.error(e); + console.error("Failed to setCode"); reject(e); } }); diff --git a/packages/types/biome.json b/packages/types/biome.json new file mode 100644 index 00000000..7b188232 --- /dev/null +++ b/packages/types/biome.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.5.3/schema.json", + "extends": ["../../biome.json"] +} diff --git a/packages/types/config_schema.json b/packages/types/config_schema.json index e080a467..3937b52b 100644 --- a/packages/types/config_schema.json +++ b/packages/types/config_schema.json @@ -1,684 +1,660 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "definitions": { - "Bottleneck.IORedisConnection": { - "type": "object" - }, - "Bottleneck.RedisConnection": { - "type": "object" - }, - "Bottleneck.Strategy": { - "type": "object" - }, - "ChopsticksLaunchSpec": { - "description": "A launch specification object for the \"chopsticks\" foundation type.", - "properties": { - "allowUnresolvedImports": { - "description": "An optional flag to NOT throw when the host fails to export a function expected by the runtime.", - "type": "boolean" - }, - "buildBlockMode": { - "description": "An optional block building mode, can be \"batch\", \"manual\" or \"instant\".\nThis is only supported for single mode chopsticks.", - "enum": [ - "batch", - "instant", - "manual" - ], - "type": "string" - }, - "configPath": { - "description": "The path to the config file.", - "type": "string" - }, - "name": { - "description": "The name of the launch spec.", - "type": "string" - }, - "options": { - "description": "An optional array of options for the launch spec.", - "items": { - "type": "string" - }, - "type": "array" - }, - "retainAllLogs": { - "description": "An optional flag to retain node logs from previous runs.", - "type": "boolean" - }, - "running": { - "description": "UNUSED", - "type": "boolean" - }, - "type": { - "description": "An optional type of either \"relaychain\" or \"parachain\".", - "enum": [ - "parachain", - "relaychain" - ], - "type": "string" - }, - "wasmOverride": { - "description": "An optional WebAssembly override.", - "type": "string" - }, - "wsPort": { - "description": "An optional WebSocket port.\nQuirk of Chopsticks is that port option is only for single mode not xcm.", - "type": "number" - } - }, - "type": "object" - }, - "DevLaunchSpec": { - "description": "A launch specification object for the \"dev\" foundation type.", - "properties": { - "binPath": { - "description": "The path to the binary file.", - "type": "string" - }, - "disableDefaultEthProviders": { - "description": "Determines if the default Ethereum provider connections should be disabled.\nWhen set to true, the framework will not automatically connect the Ethereum providers.\nDefault behavior (when unset or set to false) is to connect with Ethers, Viem & Web3 frameworks.\n\nNote: This also acts as a feature gate for context methods like createTxn and readPrecompile.", - "type": "boolean" - }, - "name": { - "description": "The name of the launch spec.", - "type": "string" - }, - "newRpcBehaviour": { - "description": "Launch node using rpc-port parameter instead of ws-port.", - "type": "boolean" - }, - "options": { - "description": "An optional array of options for the launch spec.", - "items": { - "type": "string" - }, - "type": "array" - }, - "ports": { - "description": "An optional object with p2pPort, wsPort, and rpcPort.", - "properties": { - "p2pPort": { - "description": "The port for peer-to-peer (P2P) communication.", - "type": "number" - }, - "rpcPort": { - "description": "The port for remote procedure call (RPC).", - "type": "number" - }, - "wsPort": { - "description": "The port for WebSocket communication (soon deprecated)", - "type": "number" - } - }, - "type": "object" - }, - "retainAllLogs": { - "description": "An optional flag to retain node logs from previous runs.", - "type": "boolean" - }, - "running": { - "description": "UNUSED", - "type": "boolean" - } - }, - "type": "object" - }, - "IFoundation": { - "anyOf": [ - { - "properties": { - "launchSpec": { - "items": { - "$ref": "#/definitions/DevLaunchSpec" - }, - "type": "array" - }, - "type": { - "const": "dev", - "type": "string" - } - }, - "type": "object" - }, - { - "properties": { - "launchSpec": { - "items": { - "$ref": "#/definitions/ChopsticksLaunchSpec" - }, - "type": "array" - }, - "rtUpgradePath": { - "type": "string" - }, - "type": { - "const": "chopsticks", - "type": "string" - } - }, - "type": "object" - }, - { - "properties": { - "rtUpgradePath": { - "type": "string" - }, - "type": { - "const": "zombie", - "type": "string" - }, - "zombieSpec": { - "$ref": "#/definitions/ZombieLaunchSpec" - } - }, - "type": "object" - }, - { - "properties": { - "launchSpec": { - "$ref": "#/definitions/ReadOnlyLaunchSpec" - }, - "type": { - "const": "read_only", - "type": "string" - } - }, - "type": "object" - }, - { - "properties": { - "type": { - "const": "fork", - "type": "string" - } - }, - "type": "object" - } - ], - "description": "The foundation configuration for the environment. It can be of several types including \"dev\", \"chopsticks\", \"zombie\", \"read_only\", or \"fork\"." - }, - "IRpcBundle": { - "additionalProperties": { - "$ref": "#/definitions/IRpcModule" - }, - "description": "Interface for defining RPC bundles.\nIt is a dictionary where each key is a module name and the value is an IRpcModule.", - "type": "object" - }, - "IRpcMethod": { - "description": "Interface for defining RPC methods.", - "properties": { - "description": { - "type": "string" - }, - "params": { - "items": { - "$ref": "#/definitions/IRpcParam" - }, - "type": "array" - }, - "type": { - "type": "string" - } - }, - "type": "object" - }, - "IRpcModule": { - "additionalProperties": { - "$ref": "#/definitions/IRpcMethod" - }, - "description": "Interface for defining RPC modules.\nIt is a dictionary where each key is a method name and the value is an IRpcMethod.", - "type": "object" - }, - "IRpcParam": { - "description": "Interface for defining RPC parameters.", - "properties": { - "isOptional": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - } - }, - "type": "object" - }, - "LogType": { - "enum": [ - "silent", - "table", - "text" - ], - "type": "string" - }, - "OrcOptionsInterface": { - "properties": { - "dir": { - "type": "string" - }, - "force": { - "type": "boolean" - }, - "inCI": { - "type": "boolean" - }, - "logType": { - "$ref": "#/definitions/LogType" - }, - "monitor": { - "type": "boolean" - }, - "setGlobalNetwork": { - "type": "object" - }, - "spawnConcurrency": { - "type": "number" - } - }, - "type": "object" - }, - "ProviderConfig": { - "description": "The configuration object for a provider.", - "properties": { - "additionalTypes": { - "additionalProperties": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "description": "An optional collection of additional types.", - "type": "object" - }, - "endpoints": { - "description": "An array of endpoint URLs.", - "items": { - "type": "string" - }, - "type": "array" - }, - "name": { - "description": "The name of the provider.", - "type": "string" - }, - "rpc": { - "$ref": "#/definitions/IRpcBundle", - "description": "An optional RPC bundle." - }, - "type": { - "$ref": "#/definitions/ProviderType", - "description": "The type of the provider." - } - }, - "type": "object" - }, - "ProviderType": { - "description": "The type of provider. Can be \"polkadotJs\", \"ethers\", \"web3\", \"viem\"", - "enum": [ - "ethers", - "polkadotJs", - "viem", - "web3" - ], - "type": "string" - }, - "ReadOnlyLaunchSpec": { - "description": "A launch specification object for the \"read_only\" foundation type.", - "properties": { - "disableRuntimeVersionCheck": { - "description": "Disable runtime version check.\nRT Version check is enabled by default.", - "type": "boolean" - }, - "name": { - "description": "The name of the launch spec.", - "type": "string" - }, - "options": { - "description": "An optional array of options for the launch spec.", - "items": { - "type": "string" - }, - "type": "array" - }, - "rateLimiter": { - "anyOf": [ - { - "additionalProperties": {}, - "properties": { - "Promise": { - "description": "Override the Promise library used by Bottleneck." - }, - "Redis": { - "description": "Optional Redis/IORedis library from `require('ioredis')` or equivalent. If not, Bottleneck will attempt to require Redis/IORedis at runtime." - }, - "clearDatastore": { - "description": "When set to `true`, on initial startup, the limiter will wipe any existing Bottleneck state data on the Redis db.", - "type": "boolean" - }, - "clientOptions": { - "description": "This object is passed directly to the redis client library you've selected." - }, - "clusterNodes": { - "description": "**ioredis only.** When `clusterNodes` is not null, the client will be instantiated by calling `new Redis.Cluster(clusterNodes, clientOptions)`." - }, - "connection": { - "anyOf": [ - { - "$ref": "#/definitions/Bottleneck.RedisConnection" - }, - { - "$ref": "#/definitions/Bottleneck.IORedisConnection" - } - ], - "description": "Bottleneck connection object created from `new Bottleneck.RedisConnection` or `new Bottleneck.IORedisConnection`." - }, - "datastore": { - "description": "Where the limiter stores its internal state. The default (`local`) keeps the state in the limiter itself. Set it to `redis` to enable Clustering.", - "type": "string" - }, - "highWater": { - "description": "How long can the queue get? When the queue length exceeds that value, the selected `strategy` is executed to shed the load.", - "type": "number" - }, - "id": { - "description": "Optional identifier", - "type": "string" - }, - "maxConcurrent": { - "description": "How many jobs can be running at the same time.", - "type": "number" - }, - "minTime": { - "description": "How long to wait after launching a job before launching another one.", - "type": "number" - }, - "penalty": { - "description": "The `penalty` value used by the `Bottleneck.strategy.BLOCK` strategy.", - "type": "number" - }, - "rejectOnDrop": { - "description": "Set to true to leave your failed jobs hanging instead of failing them.", - "type": "boolean" - }, - "reservoir": { - "description": "How many jobs can be executed before the limiter stops executing jobs. If `reservoir` reaches `0`, no jobs will be executed until it is no longer `0`.", - "type": "number" - }, - "reservoirIncreaseAmount": { - "description": "The increment applied to `reservoir` when `reservoirIncreaseInterval` is in use.", - "type": "number" - }, - "reservoirIncreaseInterval": { - "description": "Every `reservoirIncreaseInterval` milliseconds, the `reservoir` value will be automatically incremented by `reservoirIncreaseAmount`.", - "type": "number" - }, - "reservoirIncreaseMaximum": { - "description": "The maximum value that `reservoir` can reach when `reservoirIncreaseInterval` is in use.", - "type": "number" - }, - "reservoirRefreshAmount": { - "description": "The value to reset `reservoir` to when `reservoirRefreshInterval` is in use.", - "type": "number" - }, - "reservoirRefreshInterval": { - "description": "Every `reservoirRefreshInterval` milliseconds, the `reservoir` value will be automatically reset to `reservoirRefreshAmount`.", - "type": "number" - }, - "strategy": { - "$ref": "#/definitions/Bottleneck.Strategy", - "description": "Which strategy to use if the queue gets longer than the high water mark." - }, - "timeout": { - "description": "The Redis TTL in milliseconds for the keys created by the limiter. When `timeout` is set, the limiter's state will be automatically removed from Redis after timeout milliseconds of inactivity. Note: timeout is 300000 (5 minutes) by default when using a Group.", - "type": "number" - }, - "trackDoneStatus": { - "description": "Set to true to keep track of done jobs with counts() and jobStatus(). Uses more memory.", - "type": "boolean" - } - }, - "type": "object" - }, - { - "type": "boolean" - } - ], - "description": "Rate limiter options, on by default.\nCan be set to false to disable." - }, - "running": { - "description": "UNUSED", - "type": "boolean" - } - }, - "type": "object" - }, - "ZombieLaunchSpec": { - "description": "A launch specification object for the \"zombie\" foundation type.", - "properties": { - "additionalZombieConfig": { - "$ref": "#/definitions/OrcOptionsInterface", - "description": "Additional configuration for the zombie network" - }, - "configPath": { - "description": "The path to the config file.", - "type": "string" - }, - "disableDefaultEthProviders": { - "description": "Determines if the default Ethereum provider connections should be disabled.\nWhen set to true, the framework will not automatically connect the Ethereum providers.\nDefault behavior (when unset or set to false) is to connect with Ethers, Viem & Web3 frameworks.", - "type": "boolean" - }, - "disableLogEavesdropping": { - "description": "Specifies whether the framework should eavesdrop and log WARN, ERROR from the node logs.\nIf set to true, the eavesdropping on node logs is disabled.\nDefault behavior (when unset or set to false) is to listen to the logs.", - "type": "boolean" - }, - "name": { - "description": "The name of the launch spec.", - "type": "string" - }, - "options": { - "description": "An optional array of options for the launch spec.", - "items": { - "type": "string" - }, - "type": "array" - }, - "running": { - "description": "UNUSED", - "type": "boolean" - }, - "skipBlockCheck": { - "description": "An optional array of blocks to skip checking.", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - } - }, - "description": "The main configuration object for Moonwall.", - "properties": { - "additionalRepos": { - "description": "Use this to specify additional repos to download binaries from.\nPolkadot, Tanssi and Moonbeam are available by default.", - "items": { - "description": "`RepoSpec` type represents the configuration required to download binaries\nfrom a project's GitHub repository.", - "properties": { - "binaries": { - "items": { - "description": "`Bin` type defines the binary configurations within a `RepoSpec`.", - "properties": { - "defaultArgs": { - "items": { - "type": "string" - }, - "type": "array" - }, - "name": { - "type": "string" - } - }, - "type": "object" - }, - "type": "array" - }, - "ghAuthor": { - "type": "string" - }, - "ghRepo": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "type": "object" - }, - "type": "array" - }, - "defaultTestTimeout": { - "description": "The default timeout for tests.", - "type": "number" - }, - "environments": { - "description": "An array of Environment objects for testing.", - "items": { - "description": "The environment configuration for testing.", - "properties": { - "connections": { - "description": "An optional array of ProviderConfig objects.", - "items": { - "$ref": "#/definitions/ProviderConfig" - }, - "type": "array" - }, - "contracts": { - "description": "Path to directory containing smart contracts for testing against.", - "type": "string" - }, - "defaultAllowFailures": { - "description": "Toggle whether createBlock() will throw when extrinsic errors inside.", - "type": "boolean" - }, - "defaultFinalization": { - "description": "Toggle whether createBlock() will finalize blocks by default or not.", - "type": "boolean" - }, - "defaultSigner": { - "description": "The privateKey with which to sign and send transactions in createBlock() function.", - "properties": { - "privateKey": { - "description": "Hex encoded private key to generate KeyringPair (\"0x..\")", - "type": "string" - }, - "type": { - "description": "Substrate Keyring type", - "enum": [ - "ed25519", - "ethereum", - "sr25519" - ], - "type": "string" - } - }, - "type": "object" - }, - "description": { - "description": "Description of the environment to display in menus.", - "type": "string" - }, - "envVars": { - "description": "An optional array of environment variable names.", - "items": { - "type": "string" - }, - "type": "array" - }, - "foundation": { - "$ref": "#/definitions/IFoundation", - "description": "The foundation configuration for the environment." - }, - "include": { - "description": "An optional array of included files or directories.", - "items": { - "type": "string" - }, - "type": "array" - }, - "multiThreads": { - "anyOf": [ - { - "additionalProperties": true, - "properties": {}, - "type": "object" - }, - { - "type": [ - "number", - "boolean" - ] - } - ], - "description": "An optional boolean to indicate if multi-threading is enabled.\nOptionally, you can specify your own threadPool spec using a PoolOptions config object.\nVisit https://vitest.dev/config/#pooloptions for more info" - }, - "name": { - "description": "The name of the environment.", - "type": "string" - }, - "reportFile": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "string" - } - ], - "description": "Write test results to a file when the using JSON or HTML reporter.\nBy providing an object instead of a string you can define individual outputs when using multiple reporters." - }, - "reporters": { - "description": "An optional array of reporter names.", - "items": { - "type": "string" - }, - "type": "array" - }, - "runScripts": { - "description": "An optional array of scripts to run before testing.", - "items": { - "type": "string" - }, - "type": "array" - }, - "testFileDir": { - "description": "An array of directories with test files.", - "items": { - "type": "string" - }, - "type": "array" - }, - "timeout": { - "description": "The default timeout for tests and hooks", - "type": "number" - } - }, - "type": "object" - }, - "type": "array" - }, - "label": { - "description": "A label for the config.", - "type": "string" - }, - "scriptsDir": { - "description": "Optional path to a directory containing scripts.", - "type": "string" - } - }, - "type": "object" + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "Bottleneck.IORedisConnection": { + "type": "object" + }, + "Bottleneck.RedisConnection": { + "type": "object" + }, + "Bottleneck.Strategy": { + "type": "object" + }, + "ChopsticksLaunchSpec": { + "description": "A launch specification object for the \"chopsticks\" foundation type.", + "properties": { + "allowUnresolvedImports": { + "description": "An optional flag to NOT throw when the host fails to export a function expected by the runtime.", + "type": "boolean" + }, + "buildBlockMode": { + "description": "An optional block building mode, can be \"batch\", \"manual\" or \"instant\".\nThis is only supported for single mode chopsticks.", + "enum": ["batch", "instant", "manual"], + "type": "string" + }, + "configPath": { + "description": "The path to the config file.", + "type": "string" + }, + "name": { + "description": "The name of the launch spec.", + "type": "string" + }, + "options": { + "description": "An optional array of options for the launch spec.", + "items": { + "type": "string" + }, + "type": "array" + }, + "retainAllLogs": { + "description": "An optional flag to retain node logs from previous runs.", + "type": "boolean" + }, + "running": { + "description": "UNUSED", + "type": "boolean" + }, + "type": { + "description": "An optional type of either \"relaychain\" or \"parachain\".", + "enum": ["parachain", "relaychain"], + "type": "string" + }, + "wasmOverride": { + "description": "An optional WebAssembly override.", + "type": "string" + }, + "wsPort": { + "description": "An optional WebSocket port.\nQuirk of Chopsticks is that port option is only for single mode not xcm.", + "type": "number" + } + }, + "type": "object" + }, + "DevLaunchSpec": { + "description": "A launch specification object for the \"dev\" foundation type.", + "properties": { + "binPath": { + "description": "The path to the binary file.", + "type": "string" + }, + "disableDefaultEthProviders": { + "description": "Determines if the default Ethereum provider connections should be disabled.\nWhen set to true, the framework will not automatically connect the Ethereum providers.\nDefault behavior (when unset or set to false) is to connect with Ethers, Viem & Web3 frameworks.\n\nNote: This also acts as a feature gate for context methods like createTxn and readPrecompile.", + "type": "boolean" + }, + "name": { + "description": "The name of the launch spec.", + "type": "string" + }, + "newRpcBehaviour": { + "description": "Launch node using rpc-port parameter instead of ws-port.", + "type": "boolean" + }, + "options": { + "description": "An optional array of options for the launch spec.", + "items": { + "type": "string" + }, + "type": "array" + }, + "ports": { + "description": "An optional object with p2pPort, wsPort, and rpcPort.", + "properties": { + "p2pPort": { + "description": "The port for peer-to-peer (P2P) communication.", + "type": "number" + }, + "rpcPort": { + "description": "The port for remote procedure call (RPC).", + "type": "number" + }, + "wsPort": { + "description": "The port for WebSocket communication (soon deprecated)", + "type": "number" + } + }, + "type": "object" + }, + "retainAllLogs": { + "description": "An optional flag to retain node logs from previous runs.", + "type": "boolean" + }, + "running": { + "description": "UNUSED", + "type": "boolean" + } + }, + "type": "object" + }, + "IFoundation": { + "anyOf": [ + { + "properties": { + "launchSpec": { + "items": { + "$ref": "#/definitions/DevLaunchSpec" + }, + "type": "array" + }, + "type": { + "const": "dev", + "type": "string" + } + }, + "type": "object" + }, + { + "properties": { + "launchSpec": { + "items": { + "$ref": "#/definitions/ChopsticksLaunchSpec" + }, + "type": "array" + }, + "rtUpgradePath": { + "type": "string" + }, + "type": { + "const": "chopsticks", + "type": "string" + } + }, + "type": "object" + }, + { + "properties": { + "rtUpgradePath": { + "type": "string" + }, + "type": { + "const": "zombie", + "type": "string" + }, + "zombieSpec": { + "$ref": "#/definitions/ZombieLaunchSpec" + } + }, + "type": "object" + }, + { + "properties": { + "launchSpec": { + "$ref": "#/definitions/ReadOnlyLaunchSpec" + }, + "type": { + "const": "read_only", + "type": "string" + } + }, + "type": "object" + }, + { + "properties": { + "type": { + "const": "fork", + "type": "string" + } + }, + "type": "object" + } + ], + "description": "The foundation configuration for the environment. It can be of several types including \"dev\", \"chopsticks\", \"zombie\", \"read_only\", or \"fork\"." + }, + "IRpcBundle": { + "additionalProperties": { + "$ref": "#/definitions/IRpcModule" + }, + "description": "Interface for defining RPC bundles.\nIt is a dictionary where each key is a module name and the value is an IRpcModule.", + "type": "object" + }, + "IRpcMethod": { + "description": "Interface for defining RPC methods.", + "properties": { + "description": { + "type": "string" + }, + "params": { + "items": { + "$ref": "#/definitions/IRpcParam" + }, + "type": "array" + }, + "type": { + "type": "string" + } + }, + "type": "object" + }, + "IRpcModule": { + "additionalProperties": { + "$ref": "#/definitions/IRpcMethod" + }, + "description": "Interface for defining RPC modules.\nIt is a dictionary where each key is a method name and the value is an IRpcMethod.", + "type": "object" + }, + "IRpcParam": { + "description": "Interface for defining RPC parameters.", + "properties": { + "isOptional": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "type": "object" + }, + "LogType": { + "enum": ["silent", "table", "text"], + "type": "string" + }, + "OrcOptionsInterface": { + "properties": { + "dir": { + "type": "string" + }, + "force": { + "type": "boolean" + }, + "inCI": { + "type": "boolean" + }, + "logType": { + "$ref": "#/definitions/LogType" + }, + "monitor": { + "type": "boolean" + }, + "setGlobalNetwork": { + "type": "object" + }, + "spawnConcurrency": { + "type": "number" + } + }, + "type": "object" + }, + "ProviderConfig": { + "description": "The configuration object for a provider.", + "properties": { + "additionalTypes": { + "additionalProperties": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "description": "An optional collection of additional types.", + "type": "object" + }, + "endpoints": { + "description": "An array of endpoint URLs.", + "items": { + "type": "string" + }, + "type": "array" + }, + "name": { + "description": "The name of the provider.", + "type": "string" + }, + "rpc": { + "$ref": "#/definitions/IRpcBundle", + "description": "An optional RPC bundle." + }, + "type": { + "$ref": "#/definitions/ProviderType", + "description": "The type of the provider." + } + }, + "type": "object" + }, + "ProviderType": { + "description": "The type of provider. Can be \"polkadotJs\", \"ethers\", \"web3\", \"viem\"", + "enum": ["ethers", "polkadotJs", "viem", "web3"], + "type": "string" + }, + "ReadOnlyLaunchSpec": { + "description": "A launch specification object for the \"read_only\" foundation type.", + "properties": { + "disableRuntimeVersionCheck": { + "description": "Disable runtime version check.\nRT Version check is enabled by default.", + "type": "boolean" + }, + "name": { + "description": "The name of the launch spec.", + "type": "string" + }, + "options": { + "description": "An optional array of options for the launch spec.", + "items": { + "type": "string" + }, + "type": "array" + }, + "rateLimiter": { + "anyOf": [ + { + "additionalProperties": {}, + "properties": { + "Promise": { + "description": "Override the Promise library used by Bottleneck." + }, + "Redis": { + "description": "Optional Redis/IORedis library from `require('ioredis')` or equivalent. If not, Bottleneck will attempt to require Redis/IORedis at runtime." + }, + "clearDatastore": { + "description": "When set to `true`, on initial startup, the limiter will wipe any existing Bottleneck state data on the Redis db.", + "type": "boolean" + }, + "clientOptions": { + "description": "This object is passed directly to the redis client library you've selected." + }, + "clusterNodes": { + "description": "**ioredis only.** When `clusterNodes` is not null, the client will be instantiated by calling `new Redis.Cluster(clusterNodes, clientOptions)`." + }, + "connection": { + "anyOf": [ + { + "$ref": "#/definitions/Bottleneck.RedisConnection" + }, + { + "$ref": "#/definitions/Bottleneck.IORedisConnection" + } + ], + "description": "Bottleneck connection object created from `new Bottleneck.RedisConnection` or `new Bottleneck.IORedisConnection`." + }, + "datastore": { + "description": "Where the limiter stores its internal state. The default (`local`) keeps the state in the limiter itself. Set it to `redis` to enable Clustering.", + "type": "string" + }, + "highWater": { + "description": "How long can the queue get? When the queue length exceeds that value, the selected `strategy` is executed to shed the load.", + "type": "number" + }, + "id": { + "description": "Optional identifier", + "type": "string" + }, + "maxConcurrent": { + "description": "How many jobs can be running at the same time.", + "type": "number" + }, + "minTime": { + "description": "How long to wait after launching a job before launching another one.", + "type": "number" + }, + "penalty": { + "description": "The `penalty` value used by the `Bottleneck.strategy.BLOCK` strategy.", + "type": "number" + }, + "rejectOnDrop": { + "description": "Set to true to leave your failed jobs hanging instead of failing them.", + "type": "boolean" + }, + "reservoir": { + "description": "How many jobs can be executed before the limiter stops executing jobs. If `reservoir` reaches `0`, no jobs will be executed until it is no longer `0`.", + "type": "number" + }, + "reservoirIncreaseAmount": { + "description": "The increment applied to `reservoir` when `reservoirIncreaseInterval` is in use.", + "type": "number" + }, + "reservoirIncreaseInterval": { + "description": "Every `reservoirIncreaseInterval` milliseconds, the `reservoir` value will be automatically incremented by `reservoirIncreaseAmount`.", + "type": "number" + }, + "reservoirIncreaseMaximum": { + "description": "The maximum value that `reservoir` can reach when `reservoirIncreaseInterval` is in use.", + "type": "number" + }, + "reservoirRefreshAmount": { + "description": "The value to reset `reservoir` to when `reservoirRefreshInterval` is in use.", + "type": "number" + }, + "reservoirRefreshInterval": { + "description": "Every `reservoirRefreshInterval` milliseconds, the `reservoir` value will be automatically reset to `reservoirRefreshAmount`.", + "type": "number" + }, + "strategy": { + "$ref": "#/definitions/Bottleneck.Strategy", + "description": "Which strategy to use if the queue gets longer than the high water mark." + }, + "timeout": { + "description": "The Redis TTL in milliseconds for the keys created by the limiter. When `timeout` is set, the limiter's state will be automatically removed from Redis after timeout milliseconds of inactivity. Note: timeout is 300000 (5 minutes) by default when using a Group.", + "type": "number" + }, + "trackDoneStatus": { + "description": "Set to true to keep track of done jobs with counts() and jobStatus(). Uses more memory.", + "type": "boolean" + } + }, + "type": "object" + }, + { + "type": "boolean" + } + ], + "description": "Rate limiter options, on by default.\nCan be set to false to disable." + }, + "running": { + "description": "UNUSED", + "type": "boolean" + } + }, + "type": "object" + }, + "ZombieLaunchSpec": { + "description": "A launch specification object for the \"zombie\" foundation type.", + "properties": { + "additionalZombieConfig": { + "$ref": "#/definitions/OrcOptionsInterface", + "description": "Additional configuration for the zombie network" + }, + "configPath": { + "description": "The path to the config file.", + "type": "string" + }, + "disableDefaultEthProviders": { + "description": "Determines if the default Ethereum provider connections should be disabled.\nWhen set to true, the framework will not automatically connect the Ethereum providers.\nDefault behavior (when unset or set to false) is to connect with Ethers, Viem & Web3 frameworks.", + "type": "boolean" + }, + "disableLogEavesdropping": { + "description": "Specifies whether the framework should eavesdrop and log WARN, ERROR from the node logs.\nIf set to true, the eavesdropping on node logs is disabled.\nDefault behavior (when unset or set to false) is to listen to the logs.", + "type": "boolean" + }, + "name": { + "description": "The name of the launch spec.", + "type": "string" + }, + "options": { + "description": "An optional array of options for the launch spec.", + "items": { + "type": "string" + }, + "type": "array" + }, + "running": { + "description": "UNUSED", + "type": "boolean" + }, + "skipBlockCheck": { + "description": "An optional array of blocks to skip checking.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "description": "The main configuration object for Moonwall.", + "properties": { + "additionalRepos": { + "description": "Use this to specify additional repos to download binaries from.\nPolkadot, Tanssi and Moonbeam are available by default.", + "items": { + "description": "`RepoSpec` type represents the configuration required to download binaries\nfrom a project's GitHub repository.", + "properties": { + "binaries": { + "items": { + "description": "`Bin` type defines the binary configurations within a `RepoSpec`.", + "properties": { + "defaultArgs": { + "items": { + "type": "string" + }, + "type": "array" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "ghAuthor": { + "type": "string" + }, + "ghRepo": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "defaultTestTimeout": { + "description": "The default timeout for tests.", + "type": "number" + }, + "environments": { + "description": "An array of Environment objects for testing.", + "items": { + "description": "The environment configuration for testing.", + "properties": { + "connections": { + "description": "An optional array of ProviderConfig objects.", + "items": { + "$ref": "#/definitions/ProviderConfig" + }, + "type": "array" + }, + "contracts": { + "description": "Path to directory containing smart contracts for testing against.", + "type": "string" + }, + "defaultAllowFailures": { + "description": "Toggle whether createBlock() will throw when extrinsic errors inside.", + "type": "boolean" + }, + "defaultFinalization": { + "description": "Toggle whether createBlock() will finalize blocks by default or not.", + "type": "boolean" + }, + "defaultSigner": { + "description": "The privateKey with which to sign and send transactions in createBlock() function.", + "properties": { + "privateKey": { + "description": "Hex encoded private key to generate KeyringPair (\"0x..\")", + "type": "string" + }, + "type": { + "description": "Substrate Keyring type", + "enum": ["ed25519", "ethereum", "sr25519"], + "type": "string" + } + }, + "type": "object" + }, + "description": { + "description": "Description of the environment to display in menus.", + "type": "string" + }, + "envVars": { + "description": "An optional array of environment variable names.", + "items": { + "type": "string" + }, + "type": "array" + }, + "foundation": { + "$ref": "#/definitions/IFoundation", + "description": "The foundation configuration for the environment." + }, + "include": { + "description": "An optional array of included files or directories.", + "items": { + "type": "string" + }, + "type": "array" + }, + "multiThreads": { + "anyOf": [ + { + "additionalProperties": true, + "properties": {}, + "type": "object" + }, + { + "type": ["number", "boolean"] + } + ], + "description": "An optional boolean to indicate if multi-threading is enabled.\nOptionally, you can specify your own threadPool spec using a PoolOptions config object.\nVisit https://vitest.dev/config/#pooloptions for more info" + }, + "name": { + "description": "The name of the environment.", + "type": "string" + }, + "reportFile": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "string" + } + ], + "description": "Write test results to a file when the using JSON or HTML reporter.\nBy providing an object instead of a string you can define individual outputs when using multiple reporters." + }, + "reporters": { + "description": "An optional array of reporter types e.g. html, basic, verbose, json etc", + "items": { + "type": "string" + }, + "type": "array" + }, + "runScripts": { + "description": "An optional array of scripts to run before testing.", + "items": { + "type": "string" + }, + "type": "array" + }, + "testFileDir": { + "description": "An array of directories with test files.", + "items": { + "type": "string" + }, + "type": "array" + }, + "timeout": { + "description": "The default timeout for tests and hooks", + "type": "number" + } + }, + "type": "object" + }, + "type": "array" + }, + "label": { + "description": "A label for the config.", + "type": "string" + }, + "scriptsDir": { + "description": "Optional path to a directory containing scripts.", + "type": "string" + } + }, + "type": "object" } - diff --git a/packages/types/package.json b/packages/types/package.json index 467eb407..98b67571 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -50,12 +50,12 @@ "generate-types": "tsup src --format cjs,esm --dts && pnpm schema && pnpm typecheck", "watch": "tsup src --format cjs,esm --dts --watch", "typecheck": "tsc --noEmit", - "lint": "eslint ./src/**/*.ts", - "lint:fix": "eslint './src/**/*.ts' --fix", - "fmt": "pnpm prettier --check --ignore-path ../../.prettierignore '**/*.(yml|js|ts|json)'", - "fmt:fix": "pnpm prettier --write --ignore-path ../../.prettierignore '**/*.(yml|js|ts|json)'", + "lint": "pnpm biome lint ./src", + "lint:fix": "pnpm biome lint ./src --apply", + "fmt": "biome format .", + "fmt:fix": "biome format . --write", "prepublish": "pnpm run build && pnpm run generate-types", - "schema": "typescript-json-schema --tsNodeRegister --esModuleInterop -o config_schema.json ./src/config.ts MoonwallConfig" + "schema": "typescript-json-schema --tsNodeRegister --esModuleInterop -o config_schema.json ./src/config.ts MoonwallConfig && pnpm biome format config_schema.json --write" }, "dependencies": { "@polkadot/api": "10.11.2", @@ -64,12 +64,12 @@ "@polkadot/types": "10.11.2", "@polkadot/util": "12.6.2", "@polkadot/util-crypto": "12.6.2", - "@types/node": "20.11.5", + "@types/node": "20.11.13", "@zombienet/utils": "0.0.24", "bottleneck": "2.19.5", "debug": "4.3.4", "ethers": "6.10.0", - "viem": "2.4.1", + "viem": "2.7.1", "web3": "4.4.0" }, "peerDependencies": { @@ -79,6 +79,7 @@ "access": "public" }, "devDependencies": { + "@biomejs/biome": "1.5.3", "@types/debug": "4.1.12", "tsup": "8.0.1", "typescript": "5.3.3", diff --git a/packages/types/src/config.ts b/packages/types/src/config.ts index 0065420d..b9edd8aa 100644 --- a/packages/types/src/config.ts +++ b/packages/types/src/config.ts @@ -37,7 +37,7 @@ export type MoonwallConfig = { */ export type Environment = { /** - * An optional array of reporter names. + * An optional array of reporter types e.g. html, basic, verbose, json etc */ reporters?: string[]; diff --git a/packages/types/src/context.ts b/packages/types/src/context.ts index 71267acb..16967964 100644 --- a/packages/types/src/context.ts +++ b/packages/types/src/context.ts @@ -38,7 +38,7 @@ export type MoonwallEnvironment = { export interface MoonwallProvider { name: string; type: ProviderType; - connect: () => Promise | Wallet | Web3 | Promise | void; + connect: () => Promise | Wallet | Web3 | Promise | null; ws?: () => WsProvider; } @@ -59,7 +59,9 @@ export interface ConnectedProvider { greet: () => Promise | void | { rtName: string; rtVersion: number }; } -export type ProviderApi = { [P in keyof ProviderMap]: ProviderMap[P] }[keyof ProviderMap]; +export type ProviderApi = { + [P in keyof ProviderMap]: ProviderMap[P]; +}[keyof ProviderMap]; export type ProviderMap = { polkadotJs: ApiPromise; diff --git a/packages/types/src/runner.ts b/packages/types/src/runner.ts index a84161e9..cc1106f6 100644 --- a/packages/types/src/runner.ts +++ b/packages/types/src/runner.ts @@ -325,7 +325,12 @@ export interface ChopsticksContext extends GenericContext { /** * Getter that returns an object with the default accounts already generated. */ - keyring: { alice: KeyringPair; bob: KeyringPair; charlie: KeyringPair; dave: KeyringPair }; + keyring: { + alice: KeyringPair; + bob: KeyringPair; + charlie: KeyringPair; + dave: KeyringPair; + }; /** * Property that returns true if System.Account is AccountId32 (Substrate Account length is 32 bytes). @@ -343,7 +348,10 @@ export interface ChopsticksContext extends GenericContext { * @param {number} blocksToJump The number of ParachainStaking rounds to jump forward. * @returns {Promise} A Promise that resolves after the operation is fully complete. */ - jumpRounds?: (options: { rounds: number; providerName?: string }) => Promise; + jumpRounds?: (options: { + rounds: number; + providerName?: string; + }) => Promise; } /** @@ -368,7 +376,12 @@ export interface DevModeContext extends GenericContext { /** * Getter that returns an object with the default accounts already generated. */ - keyring: { alice: KeyringPair; bob: KeyringPair; charlie: KeyringPair; dave: KeyringPair }; + keyring: { + alice: KeyringPair; + bob: KeyringPair; + charlie: KeyringPair; + dave: KeyringPair; + }; /** * Property that returns true if System.Account is AccountId32 (Substrate Account length is 32 bytes). @@ -404,9 +417,7 @@ export interface DevModeContext extends GenericContext { | (EthersTransactionOptions & { libraryType: "ethers"; }), - >( - options: TOptions - ): Promise<`0x${string}`>; + >(options: TOptions): Promise<`0x${string}`>; /** * Execute a non-state changing transaction to a precompiled contract address (i.e. read). diff --git a/packages/util/biome.json b/packages/util/biome.json new file mode 100644 index 00000000..7b188232 --- /dev/null +++ b/packages/util/biome.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.5.3/schema.json", + "extends": ["../../biome.json"] +} diff --git a/packages/util/package.json b/packages/util/package.json index 9195152d..7879086e 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -48,10 +48,10 @@ "clean": "rm -rf dist && rm -rf node_modules", "build": "pnpm exec rm -rf dist && tsup src --format cjs,esm && pnpm generate-types", "generate-types": "tsup src --format cjs,esm --dts ", - "lint": "eslint ./src/**/*.ts", - "lint:fix": "eslint './src/**/*.ts' --fix", - "fmt": "pnpm prettier --check --ignore-path ../../.prettierignore '**/*.(yml|js|ts|json)'", - "fmt:fix": "pnpm prettier --write --ignore-path ../../.prettierignore '**/*.(yml|js|ts|json)'", + "lint": "pnpm biome lint ./src", + "lint:fix": "pnpm biome lint ./src --apply", + "fmt": "biome format .", + "fmt:fix": "biome format . --write", "watch": "tsup src --format cjs,esm --dts --watch", "typecheck": "pnpm exec tsc --noEmit", "prepublish": "pnpm run build && pnpm run generate-types" @@ -73,15 +73,15 @@ "cli-progress": "3.12.0", "colors": "1.4.0", "debug": "4.3.4", - "dotenv": "16.3.2", + "dotenv": "16.4.1", "ethers": "6.10.0", - "inquirer": "9.2.12", + "inquirer": "9.2.13", "inquirer-press-to-continue": "1.2.0", "node-fetch": "3.3.2", "rlp": "3.0.0", "semver": "7.5.4", - "viem": "2.4.1", - "vitest": "1.2.1", + "viem": "2.7.1", + "vitest": "1.2.2", "web3": "4.4.0", "ws": "8.16.0", "yaml": "2.3.4", @@ -89,14 +89,14 @@ }, "peerDependencies": { "@polkadot/api": "10.11.2", - "vitest": "1.2.1" + "vitest": "1.2.2" }, "devDependencies": { + "@biomejs/biome": "1.5.3", "@types/debug": "4.1.12", - "@types/node": "20.11.5", + "@types/node": "20.11.13", "@types/ws": "^8.5.10", "@types/yargs": "17.0.32", - "prettier": "3.2.4", "tsup": "8.0.1", "typescript": "5.3.3" }, diff --git a/packages/util/src/classes/eth-tester.ts b/packages/util/src/classes/eth-tester.ts index fb65c25e..6dedb24f 100644 --- a/packages/util/src/classes/eth-tester.ts +++ b/packages/util/src/classes/eth-tester.ts @@ -1,4 +1,4 @@ -import { Web3, JsonRpcResponse } from "web3"; +import { Web3 } from "web3"; import { AccessListish, ContractFactory } from "ethers"; import { Debugger } from "debug"; @@ -123,30 +123,31 @@ export class EthTester { // Checks transaction shouldn't have both Legacy and EIP1559 fields if (options.gasPrice && options.maxFeePerGas) { - throw new Error(`txn has both gasPrice and maxFeePerGas!`); + throw new Error("txn has both gasPrice and maxFeePerGas!"); } if (options.gasPrice && options.maxPriorityFeePerGas) { - throw new Error(`txn has both gasPrice and maxPriorityFeePerGas!`); + throw new Error("txn has both gasPrice and maxPriorityFeePerGas!"); } // Converts BigInt to hex string. This is needed because Web3 doesn't support BigInt if (typeof options.gasPrice === "bigint") { - options.gasPrice = "0x" + options.gasPrice.toString(16); + options.gasPrice = `0x${options.gasPrice.toString(16)}`; } if (typeof options.maxFeePerGas === "bigint") { - options.maxFeePerGas = "0x" + options.maxFeePerGas.toString(16); + options.maxFeePerGas = `0x${options.maxFeePerGas.toString(16)}`; } if (typeof options.maxPriorityFeePerGas === "bigint") { - options.maxPriorityFeePerGas = "0x" + options.maxPriorityFeePerGas.toString(16); + options.maxPriorityFeePerGas = `0x${options.maxPriorityFeePerGas.toString(16)}`; } - let maxFeePerGas; - let maxPriorityFeePerGas; + let maxFeePerGas: any; + let maxPriorityFeePerGas: any; + if (options.gasPrice) { maxFeePerGas = options.gasPrice; maxPriorityFeePerGas = options.gasPrice; } else { - maxFeePerGas = options.maxFeePerGas || BigInt(await this.web3.eth.getGasPrice()); + maxFeePerGas = options.maxFeePerGas || BigInt(await (this.web3 as any).eth.getGasPrice()); maxPriorityFeePerGas = options.maxPriorityFeePerGas || 0; } @@ -154,7 +155,7 @@ export class EthTester { const gasPrice = options.gasPrice !== undefined ? options.gasPrice - : "0x" + BigInt(await this.web3.eth.getGasPrice()).toString(16); + : `0x${BigInt(await (this.web3 as any).eth.getGasPrice()).toString(16)}`; const value = options.value !== undefined ? options.value : "0x00"; const from = options.from || this.defaultAccount.address; const privateKey = @@ -162,7 +163,7 @@ export class EthTester { // Always execute estimateGas. Allows to retrieve potential errors let error: any; - const estimatedGas = await this.web3.eth + const estimatedGas = await (this.web3 as any).eth .estimateGas({ from: from, to: options.to, @@ -180,7 +181,7 @@ export class EthTester { const nonce = options.nonce != null ? options.nonce - : await this.web3.eth.getTransactionCount(from, "pending"); + : await (this.web3 as any).eth.getTransactionCount(from, "pending"); let data: any; let rawTransaction: string; @@ -188,21 +189,21 @@ export class EthTester { data = { from, to: options.to, - value: value && value.toString(), + value: value?.toString(), gasPrice, gas, nonce: nonce, data: options.data, }; - const tx = await this.web3.eth.accounts.signTransaction(data, privateKey); + const tx = await (this.web3 as any).eth.accounts.signTransaction(data, privateKey); rawTransaction = tx.rawTransaction; } else { - const chainId = await this.web3.eth.getChainId(); + const chainId = await (this.web3 as any).eth.getChainId(); if (isEip2930) { data = { from, to: options.to, - value: value && value.toString(), + value: value?.toString(), gasPrice, gasLimit: gas, nonce: nonce, @@ -215,7 +216,7 @@ export class EthTester { data = { from, to: options.to, - value: value && value.toString(), + value: value?.toString(), maxFeePerGas, maxPriorityFeePerGas, gasLimit: gas, @@ -226,33 +227,32 @@ export class EthTester { type: 2, }; } - const tx = await this.web3.eth.accounts.signTransaction(data, privateKey); + const tx = await (this.web3 as any).eth.accounts.signTransaction(data, privateKey); rawTransaction = tx.rawTransaction; } this.logger( - `Tx [${/:([0-9]+)$/.exec((this.web3.currentProvider as any).host)?.[1]}] ` + - `from: ${data.from.substr(0, 5) + "..." + data.from.substr(data.from.length - 3)}, ` + - (data.to - ? `to: ${data.to.substr(0, 5) + "..." + data.to.substr(data.to.length - 3)}, ` - : "") + - (data.value ? `value: ${data.value.toString()}, ` : "") + - (data.gasPrice ? `gasPrice: ${data.gasPrice.toString()}, ` : "") + - (data.maxFeePerGas ? `maxFeePerGas: ${data.maxFeePerGas.toString()}, ` : "") + - (data.maxPriorityFeePerGas + `Tx [${ + /:([0-9]+)$/.exec(((this.web3 as any).currentProvider as any).host)?.[1] + }] from: ${`${data.from.substr(0, 5)}...${data.from.substr(data.from.length - 3)}`}, ${ + data.to ? `to: ${`${data.to.substr(0, 5)}...${data.to.substr(data.to.length - 3)}`}, ` : "" + }${data.value ? `value: ${data.value.toString()}, ` : ""}${ + data.gasPrice ? `gasPrice: ${data.gasPrice.toString()}, ` : "" + }${data.maxFeePerGas ? `maxFeePerGas: ${data.maxFeePerGas.toString()}, ` : ""}${ + data.maxPriorityFeePerGas ? `maxPriorityFeePerGas: ${data.maxPriorityFeePerGas.toString()}, ` - : "") + - (data.accessList ? `accessList: ${data.accessList.toString()}, ` : "") + - (data.gas ? `gas: ${data.gas.toString()}, ` : "") + - (data.nonce ? `nonce: ${data.nonce.toString()}, ` : "") + - (!data.data + : "" + }${data.accessList ? `accessList: ${data.accessList.toString()}, ` : ""}${ + data.gas ? `gas: ${data.gas.toString()}, ` : "" + }${data.nonce ? `nonce: ${data.nonce.toString()}, ` : ""}${ + !data.data ? "" : `data: ${ data.data.length < 50 ? data.data - : data.data.substr(0, 5) + "..." + data.data.substr(data.data.length - 3) - }, `) + - (error ? `ERROR: ${error.toString()}, ` : "") + : `${data.data.substr(0, 5)}...${data.data.substr(data.data.length - 3)}` + }, ` + }${error ? `ERROR: ${error.toString()}, ` : ""}` ); return rawTransaction; }; @@ -301,16 +301,14 @@ export class EthTester { * @param rawTransaction Signed transaction * @returns Transaction JSON RPC response */ - sendSignedTransaction = async ( - rawTransaction: string | PromiseLike - ): Promise => { - return new Promise(async (resolve, reject) => { + sendSignedTransaction = async (rawTransaction: string | PromiseLike): Promise => { + return new Promise(async (resolve, reject) => { try { - if (typeof this.web3.currentProvider == "string") { + if (typeof (this.web3 as any).currentProvider === "string") { reject("Web3 provider is not a valid provider"); return; } - (this.web3.currentProvider as any).send( + ((this.web3 as any).currentProvider as any).send( { jsonrpc: "2.0", id: 1, @@ -321,7 +319,7 @@ export class EthTester { if (error) { reject(`Failed to send signed transaction: ${error.message || error.toString()}`); } - resolve(result as JsonRpcResponse); + resolve(result); } ); } catch (e) { diff --git a/packages/util/src/constants/accounts.ts b/packages/util/src/constants/accounts.ts index 6910346b..499f42fd 100644 --- a/packages/util/src/constants/accounts.ts +++ b/packages/util/src/constants/accounts.ts @@ -87,9 +87,10 @@ export function generateKeyringPair( privateKey?: string ) { const key = privateKey || `0xDEADBEEF${(accountSeed++).toString(16).padStart(56, "0")}`; - if (type == "sr25519") { + if (type === "sr25519") { return keyringSr25519.addFromUri(key); - } else if (type == "ed25519") { + } + if (type === "ed25519") { return keyringEd25519.addFromUri(key); } return keyringEth.addFromUri(key); diff --git a/packages/util/src/constants/chain.ts b/packages/util/src/constants/chain.ts index 36e215fc..35f97403 100644 --- a/packages/util/src/constants/chain.ts +++ b/packages/util/src/constants/chain.ts @@ -1,5 +1,5 @@ import "@moonbeam-network/api-augment"; -export const SPECS_PATH = `./moonbeam-test-specs`; +export const SPECS_PATH = "./moonbeam-test-specs"; export const DEBUG_MODE = process.env.DEBUG_MODE || false; export const DISPLAY_LOG = process.env.MOONBEAM_LOG || false; @@ -7,12 +7,12 @@ export const MOONBEAM_LOG = process.env.MOONBEAM_LOG || "info"; export const BASE_PATH = process.env.BASE_PATH; export const CUSTOM_SPEC_PATH = process.env.CUSTOM_SPEC_PATH; -export const BINARY_PATH = process.env.BINARY_PATH || `../target/release/moonbeam`; -export const RELAY_BINARY_PATH = process.env.RELAY_BINARY_PATH || `../target/release/polkadot`; +export const BINARY_PATH = process.env.BINARY_PATH || "../target/release/moonbeam"; +export const RELAY_BINARY_PATH = process.env.RELAY_BINARY_PATH || "../target/release/polkadot"; export const RELAY_LOG = process.env.RELAY_LOG; // Is undefined by default as the path is dependent of the runtime. -export const OVERRIDE_RUNTIME_PATH = process.env["OVERRIDE_RUNTIME_PATH"] || undefined; +export const OVERRIDE_RUNTIME_PATH = process.env.OVERRIDE_RUNTIME_PATH || undefined; export const SPAWNING_TIME = 20000; export const ETHAPI_CMD = process.env.ETHAPI_CMD || ""; export const WASM_RUNTIME_OVERRIDES = process.env.WASM_RUNTIME_OVERRIDES || ""; diff --git a/packages/util/src/constants/smartContract.ts b/packages/util/src/constants/smartContract.ts index cd00bb0c..9f0bc815 100644 --- a/packages/util/src/constants/smartContract.ts +++ b/packages/util/src/constants/smartContract.ts @@ -2,9 +2,24 @@ export const xcAssetAbi = [ { anonymous: false, inputs: [ - { indexed: true, internalType: "address", name: "owner", type: "address" }, - { indexed: true, internalType: "address", name: "spender", type: "address" }, - { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "spender", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, ], name: "Approval", type: "event", @@ -14,7 +29,12 @@ export const xcAssetAbi = [ inputs: [ { indexed: true, internalType: "address", name: "from", type: "address" }, { indexed: true, internalType: "address", name: "to", type: "address" }, - { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, ], name: "Transfer", type: "event", diff --git a/packages/util/src/functions/block.ts b/packages/util/src/functions/block.ts index a63621b8..7ab7412c 100644 --- a/packages/util/src/functions/block.ts +++ b/packages/util/src/functions/block.ts @@ -20,7 +20,7 @@ const debug = Debug("test:blocks"); export async function createAndFinalizeBlock( api: ApiPromise, parentHash?: string, - finalize: boolean = false + finalize = false ): Promise<{ duration: number; hash: string; @@ -83,7 +83,7 @@ export const getBlockExtrinsic = async ( apiAt.query.system.events(), ]); const extIndex = block.extrinsics.findIndex( - (ext) => ext.method.section == section && ext.method.method == method + (ext) => ext.method.section === section && ext.method.method === method ); const extrinsic = extIndex > -1 ? block.extrinsics[extIndex] : null; const events = (records as any) @@ -99,7 +99,7 @@ export const getBlockExtrinsic = async ( export const getBlockTime = (signedBlock: any) => signedBlock.block.extrinsics - .find((item) => item.method.section == "timestamp") + .find((item) => item.method.section === "timestamp") .method.args[0].toNumber(); export const checkBlockFinalized = async (api: ApiPromise, number: number) => { @@ -139,7 +139,11 @@ export const fetchHistoricBlockNum = async ( ); }; -export const getBlockArray = async (api: ApiPromise, timePeriod: number, limiter?: Bottleneck) => { +export const getBlockArray = async ( + api: ApiPromise, + timePeriod: number, + bottleneck?: Bottleneck +) => { /** @brief Returns an sequential array of block numbers from a given period of time in the past @param api Connected ApiPromise to perform queries on @@ -147,11 +151,15 @@ export const getBlockArray = async (api: ApiPromise, timePeriod: number, limiter @param limiter Bottleneck rate limiter to throttle requests */ - if (limiter == null) { + let limiter = bottleneck; + + if (!limiter) { limiter = new Bottleneck({ maxConcurrent: 10, minTime: 100 }); } const finalizedHead = await limiter.schedule(() => api.rpc.chain.getFinalizedHead()); - const signedBlock = await limiter.schedule(() => api.rpc.chain.getBlock(finalizedHead)); + const signedBlock: SignedBlock = await limiter.schedule(() => + api.rpc.chain.getBlock(finalizedHead) + ); const lastBlockNumber = signedBlock.block.header.number.toNumber(); const lastBlockTime = getBlockTime(signedBlock); @@ -202,7 +210,8 @@ export function extractPreimageDeposit( accountId: deposit.unwrap()[0].toHex(), amount: deposit.unwrap()[1], }; - } else if ("isNone" in deposit && deposit.isNone) { + } + if ("isNone" in deposit && deposit.isNone) { return undefined; } return { @@ -234,7 +243,13 @@ export function mapExtrinsics( return event; }); - return { dispatchError, dispatchInfo, events, extrinsic, fee: fees ? fees[index] : undefined }; + return { + dispatchError, + dispatchInfo, + events, + extrinsic, + fee: fees ? fees[index] : undefined, + }; }); } diff --git a/packages/util/src/functions/common.ts b/packages/util/src/functions/common.ts index f1b9a49b..eedcde70 100644 --- a/packages/util/src/functions/common.ts +++ b/packages/util/src/functions/common.ts @@ -3,10 +3,15 @@ import { BN } from "@polkadot/util"; import fetch from "node-fetch"; // Sort dict by key -export function sortObjectByKeys(o) { - return Object.keys(o) - .sort() - .reduce((r, k) => ((r[k] = o[k]), r), {}); +export function sortObjectByKeys(obj: Record): Record { + const sortedKeys = Object.keys(obj).sort(); + const sortedObj: Record = {}; + + for (const key of sortedKeys) { + sortedObj[key] = obj[key]; + } + + return sortedObj; } // Perthings arithmetic conformant type. @@ -14,7 +19,10 @@ class Perthing { private unit: BN; private perthing: BN; - constructor(unit: BN, numerator: BN | number, denominator?: BN | number) { + constructor(unit: BN, num: BN | number, denom?: BN | number) { + let numerator = num; + let denominator = denom; + if (!(numerator instanceof BN)) { numerator = new BN(numerator.toString()); } @@ -90,13 +98,18 @@ export class Percent extends Perthing { } } -export function getObjectMethods(obj) { - const properties = new Set(); - let currentObj = obj; - do { - Object.getOwnPropertyNames(currentObj).map((item) => properties.add(item)); - } while ((currentObj = Object.getPrototypeOf(currentObj))); - return [...properties.keys()].filter((item: any) => typeof obj[item] === "function"); +export function getObjectMethods(obj: any): string[] { + const properties = new Set(); + let currentObj: any = obj; + + while (currentObj) { + for (const item of Object.getOwnPropertyNames(currentObj)) { + properties.add(item); + } + currentObj = Object.getPrototypeOf(currentObj); + } + + return Array.from(properties).filter((item) => typeof obj[item] === "function"); } export async function directRpcRequest( diff --git a/packages/util/src/functions/contracts.ts b/packages/util/src/functions/contracts.ts index f93194a6..a683a7ca 100644 --- a/packages/util/src/functions/contracts.ts +++ b/packages/util/src/functions/contracts.ts @@ -3,10 +3,7 @@ import fs from "fs"; import path from "path"; import type { Abi } from "viem"; -export function getAllCompiledContracts( - contractsDir: string = "./", - recurse: boolean = false -): string[] { +export function getAllCompiledContracts(contractsDir = "./", recurse = false): string[] { const contractsPath = path.isAbsolute(contractsDir) ? contractsDir : path.join(process.cwd(), contractsDir); @@ -14,7 +11,7 @@ export function getAllCompiledContracts( let contractNames: string[] = []; - contracts.forEach((dirent) => { + for (const dirent of contracts) { const fullDirentPath = path.join(contractsPath, dirent.name); if (dirent.isDirectory() && recurse) { @@ -22,7 +19,7 @@ export function getAllCompiledContracts( } else if (dirent.isFile() && path.extname(dirent.name) === ".json") { contractNames.push(path.basename(dirent.name, ".json")); } - }); + } return contractNames; } diff --git a/packages/util/src/functions/ethers.ts b/packages/util/src/functions/ethers.ts index c3637e0b..c5b5f6e1 100644 --- a/packages/util/src/functions/ethers.ts +++ b/packages/util/src/functions/ethers.ts @@ -1,28 +1,37 @@ import { GenericContext, EthersTransactionOptions } from "@moonwall/types"; -import { TransactionRequest, Wallet } from "ethers"; +import { AccessListish, BigNumberish, TransactionRequest, Wallet } from "ethers"; import { TransactionType } from "@moonwall/types"; import { ALITH_ADDRESS } from "../constants/accounts"; -type TransactionHandler = (blob: object, params: TransactionRequest) => void; +type TransactionHandler = (blob: TransactionBlob, params: TransactionRequest) => void; + +interface TransactionBlob { + gasPrice?: BigNumberish; + gasLimit?: BigNumberish; + accessList?: AccessListish; // Replace any[] with a more specific type if you have one + maxFeePerGas?: BigNumberish; + maxPriorityFeePerGas?: BigNumberish; + type?: number; +} const transactionHandlers: Record = { legacy: (blob, params) => { - blob["gasPrice"] = params.gasPrice || 10_000_000_000; - blob["gasLimit"] = params.gasLimit || 200000; - blob["type"] = 0; + blob.gasPrice = params.gasPrice || "10000000000"; + blob.gasLimit = params.gasLimit || "200000"; + blob.type = 0; }, eip2930: (blob, params) => { - blob["gasPrice"] = params.gasPrice || 10_000_000_000; - blob["gasLimit"] = params.gasLimit || 200000; - blob["accessList"] = params.accessList || []; - blob["type"] = 1; + blob.gasPrice = params.gasPrice || "10000000000"; + blob.gasLimit = params.gasLimit || "200000"; + blob.accessList = params.accessList || []; + blob.type = 1; }, eip1559: (blob, params) => { - blob["accessList"] = params.accessList || []; - blob["maxFeePerGas"] = params.maxFeePerGas || 10_000_000_000; - blob["maxPriorityFeePerGas"] = params.maxPriorityFeePerGas || 0; - blob["gasLimit"] = params.gasLimit || 200000; - blob["type"] = 2; + blob.accessList = params.accessList || []; + blob.maxFeePerGas = params.maxFeePerGas || "10000000000"; + blob.maxPriorityFeePerGas = params.maxPriorityFeePerGas || 0; + blob.gasLimit = params.gasLimit || "200000"; + blob.type = 2; }, }; diff --git a/packages/util/src/functions/jumping.ts b/packages/util/src/functions/jumping.ts index 78fdc581..1c12db3e 100644 --- a/packages/util/src/functions/jumping.ts +++ b/packages/util/src/functions/jumping.ts @@ -6,7 +6,9 @@ import WebSocket from "ws"; // DEV //************************** -export async function jumpBlocksDev(polkadotJsApi: ApiPromise, blockCount: number) { +export async function jumpBlocksDev(polkadotJsApi: ApiPromise, blocks: number) { + let blockCount = blocks; + while (blockCount > 0) { await polkadotJsApi.rpc.engine.createBlock(true, true); blockCount--; @@ -33,7 +35,8 @@ export async function jumpToRoundDev(polkadotJsApi: ApiPromise, round: number) { if (currentRound === round) { return lastBlockHash; - } else if (currentRound > round) { + } + if (currentRound > round) { return null; } @@ -80,14 +83,19 @@ export async function jumpBlocksChopsticks(port: number, blockCount: number) { return await sendNewBlockCmd(port, blockCount); } -const sendNewBlockCmd = async (port: number, count: number = 1) => { +const sendNewBlockCmd = async (port: number, count = 1) => { const websocketUrl = `ws://127.0.0.1:${port}`; const socket = new WebSocket(websocketUrl); const result: string = await new Promise((resolve) => { socket.on("open", () => { socket.send( - JSON.stringify({ jsonrpc: "2.0", id: 1, method: "dev_newBlock", params: [{ count }] }) + JSON.stringify({ + jsonrpc: "2.0", + id: 1, + method: "dev_newBlock", + params: [{ count }], + }) ); }); diff --git a/packages/util/src/functions/logging.ts b/packages/util/src/functions/logging.ts index 37e070e4..191d3f0e 100644 --- a/packages/util/src/functions/logging.ts +++ b/packages/util/src/functions/logging.ts @@ -12,22 +12,26 @@ export function setupLogger(name: string) { } export function log(...msg: any[]) { - if (process.argv && process.argv[2] && process.argv[2] === "--printlogs") { + if (process.argv?.[2] && process.argv[2] === "--printlogs") { console.log(...msg); } } export const printTokens = (api: ApiPromise, tokens: bigint, decimals = 2, pad = 9) => { + if (!api.registry.chainDecimals[0]) { + throw new Error("Chain decimals not found for system token"); + } + return `${( - Math.ceil(Number(tokens / 10n ** BigInt(api.registry.chainDecimals[0]! - decimals))) / + Math.ceil(Number(tokens / 10n ** BigInt(api.registry.chainDecimals[0] - decimals))) / 10 ** decimals ) .toString() .padStart(pad)} ${api.registry.chainTokens[0]}`; }; -export const printEvents = async (api: ApiPromise, blockHash?: string) => { - blockHash = blockHash != undefined ? blockHash : (await api.rpc.chain.getBlockHash()).toString(); +export const printEvents = async (api: ApiPromise, hash?: string) => { + const blockHash = hash || (await api.rpc.chain.getBlockHash()).toString(); const apiAt = await api.at(blockHash); const { block } = await api.rpc.chain.getBlock(blockHash); const allRecords = (await apiAt.query.system.events()) as any; diff --git a/packages/util/src/functions/providers.ts b/packages/util/src/functions/providers.ts index 3084b1ac..1fc7d28e 100644 --- a/packages/util/src/functions/providers.ts +++ b/packages/util/src/functions/providers.ts @@ -1,18 +1,18 @@ import "@moonbeam-network/api-augment"; -import { Web3, JsonRpcResponse } from "web3"; +import { Web3 } from "web3"; import { alith } from "../constants/accounts"; import { MIN_GAS_PRICE } from "../constants/chain"; export async function customWeb3Request(web3: Web3, method: string, params: any[]) { - return new Promise((resolve, reject) => { - (web3.eth.currentProvider as any).send( + return new Promise((resolve, reject) => { + ((web3.eth as any).currentProvider as any).send( { jsonrpc: "2.0", id: 1, method, params, }, - (error: Error | null, result?: JsonRpcResponse) => { + (error: Error | null, result?: any) => { if (error) { reject( `Failed to send custom request (${method} (${params @@ -23,7 +23,7 @@ export async function customWeb3Request(web3: Web3, method: string, params: any[ .join(",")})): ${error.message || error.toString()}` ); } - resolve(result!); + resolve(result); } ); }); @@ -44,10 +44,10 @@ export interface Web3EthCallOptions { export async function web3EthCall(web3: Web3, options: Web3EthCallOptions) { return await customWeb3Request(web3, "eth_call", [ { - from: options.from == undefined ? options.from : alith.address, + from: options.from === undefined ? options.from : alith.address, value: options.value, - gas: options.gas == undefined ? options.gas : 256000, - gasPrice: options.gas == undefined ? options.gas : `0x${MIN_GAS_PRICE}`, + gas: options.gas === undefined ? options.gas : 256000, + gasPrice: options.gas === undefined ? options.gas : `0x${MIN_GAS_PRICE}`, to: options.to, data: options.data, }, @@ -85,5 +85,5 @@ export async function web3EthCall(web3: Web3, options: Web3EthCallOptions) { // } export type EnhancedWeb3 = Web3 & { - customRequest: (method: string, params: any[]) => Promise; + customRequest: (method: string, params: any[]) => Promise; }; diff --git a/packages/util/src/functions/viem.ts b/packages/util/src/functions/viem.ts index f1817ad2..2f5b640e 100644 --- a/packages/util/src/functions/viem.ts +++ b/packages/util/src/functions/viem.ts @@ -111,7 +111,8 @@ export async function deriveViemChain(endpoint: string) { * @property status - The status of the contract deployment transaction. * @property logs - Any logs produced during the contract deployment transaction. */ -export async function deployViemContract( // TODO: Make this generic +export async function deployViemContract( + // TODO: Make this generic context: DevModeContext, abi: Abi, bytecode: `0x${string}`, @@ -125,7 +126,12 @@ export async function deployViemContract( options?: TOptions ): Promise<`0x${string}`> { const transferAmount = typeof value === "bigint" ? value : BigInt(value); - return await createViemTransaction(context, { ...options, to, value: transferAmount }); + return await createViemTransaction(context, { + ...options, + to: to as any, + value: transferAmount, + }); } /** @@ -220,22 +229,22 @@ export async function createViemTransaction 0) { - txnBlob["accessList"] = accessList; + if ( + (type === "eip1559" && accessList.length > 0) || + (type === "eip2930" && accessList.length > 0) + ) { + (txnBlob as any).accessList = accessList; } return await account.signTransaction(txnBlob); } @@ -288,9 +300,9 @@ export async function checkBalance( account: `0x${string}` = ALITH_ADDRESS, block: BlockTag | bigint = "latest" ): Promise { - return typeof block == "string" + return typeof block === "string" ? await context.viem().getBalance({ address: account, blockTag: block }) - : typeof block == "bigint" + : typeof block === "bigint" ? await context.viem().getBalance({ address: account, blockNumber: block }) : await context.viem().getBalance({ address: account }); } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 636fe45b..128d09f9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,33 +8,12 @@ importers: .: devDependencies: + '@biomejs/biome': + specifier: 1.5.3 + version: 1.5.3 '@changesets/cli': specifier: 2.27.1 version: 2.27.1 - '@pnpm/eslint-config': - specifier: 1.1.0 - version: 1.1.0 - '@typescript-eslint/eslint-plugin': - specifier: 6.19.0 - version: 6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/parser': - specifier: 6.19.0 - version: 6.19.0(eslint@8.56.0)(typescript@5.3.3) - eslint: - specifier: 8.56.0 - version: 8.56.0 - eslint-config-prettier: - specifier: 9.1.0 - version: 9.1.0(eslint@8.56.0) - eslint-config-xo: - specifier: 0.43.1 - version: 0.43.1(eslint@8.56.0) - eslint-config-xo-typescript: - specifier: 1.0.1 - version: 1.0.1(@typescript-eslint/eslint-plugin@6.19.0)(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3) - prettier: - specifier: 3.2.4 - version: 3.2.4 typescript: specifier: 5.3.3 version: 5.3.3 @@ -55,8 +34,8 @@ importers: packages/cli: dependencies: '@acala-network/chopsticks': - specifier: 0.9.7 - version: 0.9.7(debug@4.3.4) + specifier: 0.9.8 + version: 0.9.8(debug@4.3.4) '@moonbeam-network/api-augment': specifier: 0.2700.0 version: 0.2700.0 @@ -88,14 +67,14 @@ importers: specifier: 12.6.2 version: 12.6.2(@polkadot/util@12.6.2) '@vitest/ui': - specifier: 1.2.1 - version: 1.2.1(vitest@1.2.1) + specifier: 1.2.2 + version: 1.2.2(vitest@1.2.2) '@zombienet/orchestrator': specifier: 0.0.68 - version: 0.0.68(@polkadot/util@12.6.2)(@types/node@20.11.5) + version: 0.0.68(@polkadot/util@12.6.2)(@types/node@20.11.13) '@zombienet/utils': specifier: 0.0.24 - version: 0.0.24(@types/node@20.11.5)(typescript@5.3.3) + version: 0.0.24(@types/node@20.11.13)(typescript@5.3.3) bottleneck: specifier: 2.19.5 version: 2.19.5 @@ -115,8 +94,8 @@ importers: specifier: 4.3.4 version: 4.3.4(supports-color@8.1.1) dotenv: - specifier: 16.3.2 - version: 16.3.2 + specifier: 16.4.1 + version: 16.4.1 ethers: specifier: 6.10.0 version: 6.10.0 @@ -124,14 +103,14 @@ importers: specifier: ^7.0.0 version: 7.0.0 inquirer: - specifier: 9.2.12 - version: 9.2.12 + specifier: 9.2.13 + version: 9.2.13 inquirer-press-to-continue: specifier: 1.2.0 - version: 1.2.0(inquirer@9.2.12) + version: 1.2.0(inquirer@9.2.13) jsonc-parser: - specifier: 3.2.0 - version: 3.2.0 + specifier: 3.2.1 + version: 3.2.1 minimatch: specifier: 9.0.3 version: 9.0.3 @@ -142,11 +121,11 @@ importers: specifier: 7.5.4 version: 7.5.4 viem: - specifier: 2.4.1 - version: 2.4.1(typescript@5.3.3) + specifier: 2.7.1 + version: 2.7.1(typescript@5.3.3) vitest: - specifier: 1.2.1 - version: 1.2.1(@types/node@20.11.5)(@vitest/ui@1.2.1) + specifier: 1.2.2 + version: 1.2.2(@types/node@20.11.13)(@vitest/ui@1.2.2) web3: specifier: 4.4.0 version: 4.4.0(typescript@5.3.3) @@ -163,6 +142,9 @@ importers: specifier: 17.7.2 version: 17.7.2 devDependencies: + '@biomejs/biome': + specifier: 1.5.3 + version: 1.5.3 '@types/clear': specifier: ^0.1.4 version: 0.1.4 @@ -173,17 +155,14 @@ importers: specifier: 4.1.12 version: 4.1.12 '@types/node': - specifier: 20.11.5 - version: 20.11.5 + specifier: 20.11.13 + version: 20.11.13 '@types/ws': specifier: ^8.5.10 version: 8.5.10 '@types/yargs': specifier: 17.0.32 version: 17.0.32 - prettier: - specifier: 3.2.4 - version: 3.2.4 tsup: specifier: 8.0.1 version: 8.0.1(typescript@5.3.3) @@ -215,11 +194,11 @@ importers: specifier: 12.6.2 version: 12.6.2(@polkadot/util@12.6.2) '@types/node': - specifier: 20.11.5 - version: 20.11.5 + specifier: 20.11.13 + version: 20.11.13 '@zombienet/utils': specifier: 0.0.24 - version: 0.0.24(@types/node@20.11.5)(typescript@5.3.3) + version: 0.0.24(@types/node@20.11.13)(typescript@5.3.3) bottleneck: specifier: 2.19.5 version: 2.19.5 @@ -230,12 +209,15 @@ importers: specifier: 6.10.0 version: 6.10.0 viem: - specifier: 2.4.1 - version: 2.4.1(typescript@5.3.3) + specifier: 2.7.1 + version: 2.7.1(typescript@5.3.3) web3: specifier: 4.4.0 version: 4.4.0(typescript@5.3.3) devDependencies: + '@biomejs/biome': + specifier: 1.5.3 + version: 1.5.3 '@types/debug': specifier: 4.1.12 version: 4.1.12 @@ -300,17 +282,17 @@ importers: specifier: 4.3.4 version: 4.3.4(supports-color@8.1.1) dotenv: - specifier: 16.3.2 - version: 16.3.2 + specifier: 16.4.1 + version: 16.4.1 ethers: specifier: 6.10.0 version: 6.10.0 inquirer: - specifier: 9.2.12 - version: 9.2.12 + specifier: 9.2.13 + version: 9.2.13 inquirer-press-to-continue: specifier: 1.2.0 - version: 1.2.0(inquirer@9.2.12) + version: 1.2.0(inquirer@9.2.13) node-fetch: specifier: 3.3.2 version: 3.3.2 @@ -321,11 +303,11 @@ importers: specifier: 7.5.4 version: 7.5.4 viem: - specifier: 2.4.1 - version: 2.4.1(typescript@5.3.3) + specifier: 2.7.1 + version: 2.7.1(typescript@5.3.3) vitest: - specifier: 1.2.1 - version: 1.2.1(@types/node@20.11.5)(@vitest/ui@1.2.1) + specifier: 1.2.2 + version: 1.2.2(@types/node@20.11.13)(@vitest/ui@1.2.2) web3: specifier: 4.4.0 version: 4.4.0(typescript@5.3.3) @@ -339,21 +321,21 @@ importers: specifier: 17.7.2 version: 17.7.2 devDependencies: + '@biomejs/biome': + specifier: 1.5.3 + version: 1.5.3 '@types/debug': specifier: 4.1.12 version: 4.1.12 '@types/node': - specifier: 20.11.5 - version: 20.11.5 + specifier: 20.11.13 + version: 20.11.13 '@types/ws': specifier: ^8.5.10 version: 8.5.10 '@types/yargs': specifier: 17.0.32 version: 17.0.32 - prettier: - specifier: 3.2.4 - version: 3.2.4 tsup: specifier: 8.0.1 version: 8.0.1(typescript@5.3.3) @@ -365,7 +347,10 @@ importers: devDependencies: '@acala-network/chopsticks': specifier: 0.9.7 - version: 0.9.7(debug@4.3.4) + version: 0.9.7 + '@biomejs/biome': + specifier: 1.5.3 + version: 1.5.3 '@moonbeam-network/api-augment': specifier: 0.2700.0 version: 0.2700.0 @@ -394,8 +379,8 @@ importers: specifier: 20.11.5 version: 20.11.5 '@vitest/ui': - specifier: 1.2.1 - version: 1.2.1(vitest@1.2.1) + specifier: 1.2.2 + version: 1.2.2(vitest@1.2.2) bun-types: specifier: 1.0.25 version: 1.0.25 @@ -411,9 +396,6 @@ importers: pnpm: specifier: 8.14.2 version: 8.14.2 - prettier: - specifier: 3.2.4 - version: 3.2.4 solc: specifier: 0.8.23-fixed version: 0.8.23-fixed @@ -427,8 +409,8 @@ importers: specifier: 2.4.1 version: 2.4.1(typescript@5.3.3) vitest: - specifier: 1.2.1 - version: 1.2.1(@types/node@20.11.5)(@vitest/ui@1.2.1) + specifier: 1.2.2 + version: 1.2.2(@types/node@20.11.5)(@vitest/ui@1.2.2) web3: specifier: 4.4.0 version: 4.4.0(typescript@5.3.3) @@ -438,11 +420,6 @@ importers: packages: - /@aashutoshrathi/word-wrap@1.2.6: - resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} - engines: {node: '>=0.10.0'} - dev: true - /@acala-network/chopsticks-core@0.9.7: resolution: {integrity: sha512-pUJ7rk9YvRELPZtU9N4mk6DjFD7Z70r1ukiUM1pB7m7wDVM1Erd5mKdI62J9BiakmrJ37lZgHyWtdOSl27YRKg==} dependencies: @@ -465,6 +442,31 @@ packages: - bufferutil - supports-color - utf-8-validate + dev: true + + /@acala-network/chopsticks-core@0.9.8: + resolution: {integrity: sha512-KtnST9k+2peAWxYitM2RQRuqUgbEkEXQJLQuiMuoP38Q0clQTVFc7Vfw9/T3zdE7CCst68vz0HmAWn5JaMgoow==} + dependencies: + '@acala-network/chopsticks-executor': 0.9.8 + '@polkadot/rpc-provider': 10.11.2 + '@polkadot/types': 10.11.2 + '@polkadot/types-codec': 10.11.2 + '@polkadot/types-known': 10.11.2 + '@polkadot/util': 12.6.2 + '@polkadot/util-crypto': 12.6.2(@polkadot/util@12.6.2) + comlink: 4.4.1 + eventemitter3: 5.0.1 + lodash: 4.17.21 + lru-cache: 10.2.0 + pino: 8.17.2 + pino-pretty: 10.3.1 + rxjs: 7.8.1 + zod: 3.22.4 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: false /@acala-network/chopsticks-db@0.9.7: resolution: {integrity: sha512-Kwk+davh+JmAktILtrfLLAT/nlDpZl/dbOICNaIHONT9yUP5WQL/gatmPO5ZtI3rL3FewOtNADxwIbq/t5WPGA==} @@ -495,14 +497,54 @@ packages: - ts-node - typeorm-aurora-data-api-driver - utf-8-validate + dev: true + + /@acala-network/chopsticks-db@0.9.8: + resolution: {integrity: sha512-L1bSkMsSd8UYuU2NXVw/EUoB+kZ443PE+HbBj2obnna3giUx/qOzLAJw3gm5BK3/zbZBf91gjeERUgq6W8W/wQ==} + dependencies: + '@acala-network/chopsticks-core': 0.9.8 + '@polkadot/util': 12.6.2 + idb: 8.0.0 + sqlite3: 5.1.7 + typeorm: 0.3.20(sqlite3@5.1.7) + transitivePeerDependencies: + - '@google-cloud/spanner' + - '@sap/hana-client' + - better-sqlite3 + - bluebird + - bufferutil + - hdb-pool + - ioredis + - mongodb + - mssql + - mysql2 + - oracledb + - pg + - pg-native + - pg-query-stream + - redis + - sql.js + - supports-color + - ts-node + - typeorm-aurora-data-api-driver + - utf-8-validate + dev: false /@acala-network/chopsticks-executor@0.9.7: resolution: {integrity: sha512-L9mSfA1SFqmROoX+iokpkTf+PHHGy0SGJ8GteEU418T4nDXV99/RKag2PRe6KAP0L5SfHP4veVI3hEszjoycHw==} dependencies: '@polkadot/util': 12.6.2 '@polkadot/wasm-util': 7.3.2(@polkadot/util@12.6.2) + dev: true + + /@acala-network/chopsticks-executor@0.9.8: + resolution: {integrity: sha512-4xogW5wTq2spblKLpVKKHkXyTWnbvVgcWKgIevJ9088kOFGa6EEAuWWtZTs+54HUhfO2qPvHx+PrXRv0JEA+kQ==} + dependencies: + '@polkadot/util': 12.6.2 + '@polkadot/wasm-util': 7.3.2(@polkadot/util@12.6.2) + dev: false - /@acala-network/chopsticks@0.9.7(debug@4.3.4): + /@acala-network/chopsticks@0.9.7: resolution: {integrity: sha512-sthat3RSi6Kg3r5uLesEC1u2nxUdDWrlVKamWHNbihQ/Vrm/wFXTPuuHO59j0STj9hM3CtZHEWa/gOemuj1S8A==} hasBin: true dependencies: @@ -513,8 +555,52 @@ packages: '@polkadot/types': 10.11.2 '@polkadot/util': 12.6.2 '@polkadot/util-crypto': 12.6.2(@polkadot/util@12.6.2) - axios: 1.6.5(debug@4.3.4) - dotenv: 16.3.2 + axios: 1.6.5 + dotenv: 16.4.1 + global-agent: 3.0.0 + js-yaml: 4.1.0 + jsondiffpatch: 0.5.0 + lodash: 4.17.21 + ws: 8.16.0 + yargs: 17.7.2 + zod: 3.22.4 + transitivePeerDependencies: + - '@google-cloud/spanner' + - '@sap/hana-client' + - better-sqlite3 + - bluebird + - bufferutil + - debug + - hdb-pool + - ioredis + - mongodb + - mssql + - mysql2 + - oracledb + - pg + - pg-native + - pg-query-stream + - redis + - sql.js + - supports-color + - ts-node + - typeorm-aurora-data-api-driver + - utf-8-validate + dev: true + + /@acala-network/chopsticks@0.9.8(debug@4.3.4): + resolution: {integrity: sha512-ZasjzOQBFmIVXqt6KQFq4/AXx+hGM7JFK+R1tg4PmTMM9O8tAGZdEiHbdDRRB3LxxDNtwoJLQle/f+VkQcrcgQ==} + hasBin: true + dependencies: + '@acala-network/chopsticks-core': 0.9.8 + '@acala-network/chopsticks-db': 0.9.8 + '@pnpm/npm-conf': 2.2.2 + '@polkadot/api-augment': 10.11.2 + '@polkadot/types': 10.11.2 + '@polkadot/util': 12.6.2 + '@polkadot/util-crypto': 12.6.2(@polkadot/util@12.6.2) + axios: 1.6.7(debug@4.3.4) + dotenv: 16.4.1 global-agent: 3.0.0 js-yaml: 4.1.0 jsondiffpatch: 0.5.0 @@ -544,6 +630,7 @@ packages: - ts-node - typeorm-aurora-data-api-driver - utf-8-validate + dev: false /@adraffy/ens-normalize@1.10.0: resolution: {integrity: sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==} @@ -735,6 +822,94 @@ packages: to-fast-properties: 2.0.0 dev: true + /@biomejs/biome@1.5.3: + resolution: {integrity: sha512-yvZCa/g3akwTaAQ7PCwPWDCkZs3Qa5ONg/fgOUT9e6wAWsPftCjLQFPXBeGxPK30yZSSpgEmRCfpGTmVbUjGgg==} + engines: {node: '>=14.*'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@biomejs/cli-darwin-arm64': 1.5.3 + '@biomejs/cli-darwin-x64': 1.5.3 + '@biomejs/cli-linux-arm64': 1.5.3 + '@biomejs/cli-linux-arm64-musl': 1.5.3 + '@biomejs/cli-linux-x64': 1.5.3 + '@biomejs/cli-linux-x64-musl': 1.5.3 + '@biomejs/cli-win32-arm64': 1.5.3 + '@biomejs/cli-win32-x64': 1.5.3 + dev: true + + /@biomejs/cli-darwin-arm64@1.5.3: + resolution: {integrity: sha512-ImU7mh1HghEDyqNmxEZBoMPr8SxekkZuYcs+gynKlNW+TALQs7swkERiBLkG9NR0K1B3/2uVzlvYowXrmlW8hw==} + engines: {node: '>=14.*'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-darwin-x64@1.5.3: + resolution: {integrity: sha512-vCdASqYnlpq/swErH7FD6nrFz0czFtK4k/iLgj0/+VmZVjineFPgevOb+Sr9vz0tk0GfdQO60bSpI74zU8M9Dw==} + engines: {node: '>=14.*'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-linux-arm64-musl@1.5.3: + resolution: {integrity: sha512-DYuMizUYUBYfS0IHGjDrOP1RGipqWfMGEvNEJ398zdtmCKLXaUvTimiox5dvx4X15mBK5M2m8wgWUgOP1giUpQ==} + engines: {node: '>=14.*'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-linux-arm64@1.5.3: + resolution: {integrity: sha512-cupBQv0sNF1OKqBfx7EDWMSsKwRrBUZfjXawT4s6hKV6ALq7p0QzWlxr/sDmbKMLOaLQtw2Qgu/77N9rm+f9Rg==} + engines: {node: '>=14.*'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-linux-x64-musl@1.5.3: + resolution: {integrity: sha512-UUHiAnlDqr2Y/LpvshBFhUYMWkl2/Jn+bi3U6jKuav0qWbbBKU/ByHgR4+NBxpKBYoCtWxhnmatfH1bpPIuZMw==} + engines: {node: '>=14.*'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-linux-x64@1.5.3: + resolution: {integrity: sha512-YQrSArQvcv4FYsk7Q91Yv4uuu5F8hJyORVcv3zsjCLGkjIjx2RhjYLpTL733SNL7v33GmOlZY0eFR1ko38tuUw==} + engines: {node: '>=14.*'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-win32-arm64@1.5.3: + resolution: {integrity: sha512-HxatYH7vf/kX9nrD+pDYuV2GI9GV8EFo6cfKkahAecTuZLPxryHx1WEfJthp5eNsE0+09STGkKIKjirP0ufaZA==} + engines: {node: '>=14.*'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-win32-x64@1.5.3: + resolution: {integrity: sha512-fMvbSouZEASU7mZH8SIJSANDm5OqsjgtVXlbUqxwed6BP7uuHRSs396Aqwh2+VoW8fwTpp6ybIUoC9FrzB0kyA==} + engines: {node: '>=14.*'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@changesets/apply-release-plan@7.0.0: resolution: {integrity: sha512-vfi69JR416qC9hWmFGSxj7N6wA5J222XNBmezSVATPWDVPIF7gkd4d8CpbEbXmRWbVrkoli3oerGS6dcL/BGsQ==} dependencies: @@ -1563,43 +1738,6 @@ packages: dev: true optional: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.56.0): - resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - dependencies: - eslint: 8.56.0 - eslint-visitor-keys: 3.4.3 - dev: true - - /@eslint-community/regexpp@4.10.0: - resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} - engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - dev: true - - /@eslint/eslintrc@2.1.4: - resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - ajv: 6.12.6 - debug: 4.3.4(supports-color@8.1.1) - espree: 9.6.1 - globals: 13.24.0 - ignore: 5.3.0 - import-fresh: 3.3.0 - js-yaml: 4.1.0 - minimatch: 3.1.2 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - dev: true - - /@eslint/js@8.56.0: - resolution: {integrity: sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true - /@ethereumjs/rlp@4.0.1: resolution: {integrity: sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==} engines: {node: '>=14'} @@ -1610,26 +1748,6 @@ packages: requiresBuild: true optional: true - /@humanwhocodes/config-array@0.11.13: - resolution: {integrity: sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==} - engines: {node: '>=10.10.0'} - dependencies: - '@humanwhocodes/object-schema': 2.0.1 - debug: 4.3.4(supports-color@8.1.1) - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color - dev: true - - /@humanwhocodes/module-importer@1.0.1: - resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} - engines: {node: '>=12.22'} - dev: true - - /@humanwhocodes/object-schema@2.0.1: - resolution: {integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==} - dev: true - /@isaacs/cliui@8.0.2: resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} @@ -1681,8 +1799,8 @@ packages: '@jridgewell/resolve-uri': 3.1.1 '@jridgewell/sourcemap-codec': 1.4.15 - /@ljharb/through@2.3.11: - resolution: {integrity: sha512-ccfcIDlogiXNq5KcbAwbaO7lMh3Tm1i3khMPYpxlK8hH/W53zN81KM9coerRLOnTGu3nfXIniAmQbRI9OxbC0w==} + /@ljharb/through@2.3.12: + resolution: {integrity: sha512-ajo/heTlG3QgC8EGP6APIejksVAYt4ayz4tqoP3MolFELzcH1x1fzwEYRJTPO0IELutZ5HQ0c26/GqAYy79u3g==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.5 @@ -1797,25 +1915,6 @@ packages: resolution: {integrity: sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==} engines: {node: '>=12.22.0'} - /@pnpm/eslint-config@1.1.0: - resolution: {integrity: sha512-SKS6ojdy2Pcrr/BQEMgkc/u1fPqFePVe7N1LgWV7Dh30g7L9Q4r2ZAbnW5JP5/RK9j1Jd1aplmjR80Vd7MOViw==} - engines: {node: '>=12.22.0'} - dependencies: - '@typescript-eslint/eslint-plugin': 6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.2.2) - '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.2.2) - eslint: 8.56.0 - eslint-config-standard-with-typescript: 39.1.1(@typescript-eslint/eslint-plugin@6.19.0)(eslint-plugin-import@2.28.1)(eslint-plugin-n@16.2.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.2.2) - eslint-plugin-import: 2.28.1(@typescript-eslint/parser@6.19.0)(eslint@8.56.0) - eslint-plugin-n: 16.2.0(eslint@8.56.0) - eslint-plugin-node: 11.1.0(eslint@8.56.0) - eslint-plugin-promise: 6.1.1(eslint@8.56.0) - typescript: 5.2.2 - transitivePeerDependencies: - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - - supports-color - dev: true - /@pnpm/network.ca-file@1.0.2: resolution: {integrity: sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==} engines: {node: '>=12.22.0'} @@ -2599,7 +2698,7 @@ packages: /@types/bn.js@5.1.5: resolution: {integrity: sha512-V46N0zwKRF5Q00AZ6hWtN0T8gGmDUaUzLWQvHFo5yThtVwK/VCenFY3wXVbOvNfajEpsTfQM4IN9k/d6gUVX3A==} dependencies: - '@types/node': 20.11.5 + '@types/node': 20.11.13 /@types/clear@0.1.4: resolution: {integrity: sha512-4nJjoilJPTbYF7Q4y5+F7JFDK8QdcwOItzwVv3RDEMWALT9Mx9UzfxCiUfpbFK05REhieXTCvhbNkiDW/Wfejw==} @@ -2608,7 +2707,7 @@ packages: /@types/cli-progress@3.11.5: resolution: {integrity: sha512-D4PbNRbviKyppS5ivBGyFO29POlySLmA2HyUFE4p5QGazAMM3CwkKWcvTl8gvElSuxRh6FPKL8XmidX873ou4g==} dependencies: - '@types/node': 20.11.5 + '@types/node': 20.11.13 dev: true /@types/debug@4.1.12: @@ -2624,10 +2723,6 @@ packages: resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} dev: true - /@types/json5@0.0.29: - resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} - dev: true - /@types/linkify-it@3.0.5: resolution: {integrity: sha512-yg6E+u0/+Zjva+buc3EIb+29XEg4wltq7cSmd4Uc2EE/1nUVmxyzpX6gUXD0V8jIrG0r7YeOGVIbYRkxeooCtw==} dev: true @@ -2659,17 +2754,23 @@ packages: resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} dev: true - /@types/node@16.18.74: - resolution: {integrity: sha512-eEn8RkzZFcT0gb8qyi0CcfSOQnLE+NbGLIIaxGGmjn/N35v/C3M8ohxcpSlNlCv+H8vPpMGmrGDdCkzr8xu2tQ==} + /@types/node@16.18.77: + resolution: {integrity: sha512-zwqAbRkHjGlxH9PBv8i9dmeaDpBRgfQDSFuREMF2Z+WUi8uc13gfRquMV/8LxBqwm+7jBz+doTVkEEA1CIWOnQ==} dev: true /@types/node@18.15.13: resolution: {integrity: sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==} + /@types/node@20.11.13: + resolution: {integrity: sha512-5G4zQwdiQBSWYTDAH1ctw2eidqdhMJaNsiIDKHFr55ihz5Trl2qqR8fdrT732yPBho5gkNxXm67OxWFBqX9aPg==} + dependencies: + undici-types: 5.26.5 + /@types/node@20.11.5: resolution: {integrity: sha512-g557vgQjUUfN76MZAN/dt1z3dzcUsimuysco0KeluHgrPdJXkP/XdAURgyO2W9fZWHRtRBiVKzKn8vyOAwlG+w==} dependencies: undici-types: 5.26.5 + dev: true /@types/normalize-package-data@2.4.4: resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -2686,13 +2787,13 @@ packages: /@types/ws@8.5.10: resolution: {integrity: sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==} dependencies: - '@types/node': 20.11.5 + '@types/node': 20.11.13 dev: true /@types/ws@8.5.3: resolution: {integrity: sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==} dependencies: - '@types/node': 20.11.5 + '@types/node': 20.11.13 /@types/yargs-parser@21.0.3: resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} @@ -2704,306 +2805,59 @@ packages: '@types/yargs-parser': 21.0.3 dev: true - /@typescript-eslint/eslint-plugin@6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.2.2): - resolution: {integrity: sha512-DUCUkQNklCQYnrBSSikjVChdc84/vMPDQSgJTHBZ64G9bA9w0Crc0rd2diujKbTdp6w2J47qkeHQLoi0rpLCdg==} - engines: {node: ^16.0.0 || >=18.0.0} + /@vitejs/plugin-vue@5.0.3(vite@5.0.11)(vue@3.4.7): + resolution: {integrity: sha512-b8S5dVS40rgHdDrw+DQi/xOM9ed+kSRZzfm1T74bMmBDCd8XO87NKlFYInzCtwvtWwXZvo1QxE2OSspTATWrbA==} + engines: {node: ^18.0.0 || >=20.0.0} peerDependencies: - '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha - eslint: ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + vite: ^5.0.0 + vue: ^3.2.25 dependencies: - '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.2.2) - '@typescript-eslint/scope-manager': 6.19.0 - '@typescript-eslint/type-utils': 6.19.0(eslint@8.56.0)(typescript@5.2.2) - '@typescript-eslint/utils': 6.19.0(eslint@8.56.0)(typescript@5.2.2) - '@typescript-eslint/visitor-keys': 6.19.0 - debug: 4.3.4(supports-color@8.1.1) - eslint: 8.56.0 - graphemer: 1.4.0 - ignore: 5.3.0 - natural-compare: 1.4.0 - semver: 7.5.4 - ts-api-utils: 1.0.3(typescript@5.2.2) - typescript: 5.2.2 - transitivePeerDependencies: - - supports-color + vite: 5.0.11 + vue: 3.4.7(typescript@5.3.3) dev: true - /@typescript-eslint/eslint-plugin@6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-DUCUkQNklCQYnrBSSikjVChdc84/vMPDQSgJTHBZ64G9bA9w0Crc0rd2diujKbTdp6w2J47qkeHQLoi0rpLCdg==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha - eslint: ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + /@vitest/expect@1.2.2: + resolution: {integrity: sha512-3jpcdPAD7LwHUUiT2pZTj2U82I2Tcgg2oVPvKxhn6mDI2On6tfvPQTjAI4628GUGDZrCm4Zna9iQHm5cEexOAg==} dependencies: - '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/scope-manager': 6.19.0 - '@typescript-eslint/type-utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.19.0 - debug: 4.3.4(supports-color@8.1.1) - eslint: 8.56.0 - graphemer: 1.4.0 - ignore: 5.3.0 - natural-compare: 1.4.0 - semver: 7.5.4 - ts-api-utils: 1.0.3(typescript@5.3.3) - typescript: 5.3.3 - transitivePeerDependencies: - - supports-color - dev: true + '@vitest/spy': 1.2.2 + '@vitest/utils': 1.2.2 + chai: 4.4.1 - /@typescript-eslint/parser@6.19.0(eslint@8.56.0)(typescript@5.2.2): - resolution: {integrity: sha512-1DyBLG5SH7PYCd00QlroiW60YJ4rWMuUGa/JBV0iZuqi4l4IK3twKPq5ZkEebmGqRjXWVgsUzfd3+nZveewgow==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + /@vitest/runner@1.2.2: + resolution: {integrity: sha512-JctG7QZ4LSDXr5CsUweFgcpEvrcxOV1Gft7uHrvkQ+fsAVylmWQvnaAr/HDp3LAH1fztGMQZugIheTWjaGzYIg==} dependencies: - '@typescript-eslint/scope-manager': 6.19.0 - '@typescript-eslint/types': 6.19.0 - '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.2.2) - '@typescript-eslint/visitor-keys': 6.19.0 - debug: 4.3.4(supports-color@8.1.1) - eslint: 8.56.0 - typescript: 5.2.2 - transitivePeerDependencies: - - supports-color - dev: true + '@vitest/utils': 1.2.2 + p-limit: 5.0.0 + pathe: 1.1.2 - /@typescript-eslint/parser@6.19.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-1DyBLG5SH7PYCd00QlroiW60YJ4rWMuUGa/JBV0iZuqi4l4IK3twKPq5ZkEebmGqRjXWVgsUzfd3+nZveewgow==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/scope-manager': 6.19.0 - '@typescript-eslint/types': 6.19.0 - '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.19.0 - debug: 4.3.4(supports-color@8.1.1) - eslint: 8.56.0 - typescript: 5.3.3 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/scope-manager@6.19.0: - resolution: {integrity: sha512-dO1XMhV2ehBI6QN8Ufi7I10wmUovmLU0Oru3n5LVlM2JuzB4M+dVphCPLkVpKvGij2j/pHBWuJ9piuXx+BhzxQ==} - engines: {node: ^16.0.0 || >=18.0.0} - dependencies: - '@typescript-eslint/types': 6.19.0 - '@typescript-eslint/visitor-keys': 6.19.0 - dev: true - - /@typescript-eslint/type-utils@6.19.0(eslint@8.56.0)(typescript@5.2.2): - resolution: {integrity: sha512-mcvS6WSWbjiSxKCwBcXtOM5pRkPQ6kcDds/juxcy/727IQr3xMEcwr/YLHW2A2+Fp5ql6khjbKBzOyjuPqGi/w==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.2.2) - '@typescript-eslint/utils': 6.19.0(eslint@8.56.0)(typescript@5.2.2) - debug: 4.3.4(supports-color@8.1.1) - eslint: 8.56.0 - ts-api-utils: 1.0.3(typescript@5.2.2) - typescript: 5.2.2 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/type-utils@6.19.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-mcvS6WSWbjiSxKCwBcXtOM5pRkPQ6kcDds/juxcy/727IQr3xMEcwr/YLHW2A2+Fp5ql6khjbKBzOyjuPqGi/w==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) - '@typescript-eslint/utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) - debug: 4.3.4(supports-color@8.1.1) - eslint: 8.56.0 - ts-api-utils: 1.0.3(typescript@5.3.3) - typescript: 5.3.3 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/types@6.19.0: - resolution: {integrity: sha512-lFviGV/vYhOy3m8BJ/nAKoAyNhInTdXpftonhWle66XHAtT1ouBlkjL496b5H5hb8dWXHwtypTqgtb/DEa+j5A==} - engines: {node: ^16.0.0 || >=18.0.0} - dev: true - - /@typescript-eslint/typescript-estree@6.19.0(typescript@5.2.2): - resolution: {integrity: sha512-o/zefXIbbLBZ8YJ51NlkSAt2BamrK6XOmuxSR3hynMIzzyMY33KuJ9vuMdFSXW+H0tVvdF9qBPTHA91HDb4BIQ==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 6.19.0 - '@typescript-eslint/visitor-keys': 6.19.0 - debug: 4.3.4(supports-color@8.1.1) - globby: 11.1.0 - is-glob: 4.0.3 - minimatch: 9.0.3 - semver: 7.5.4 - ts-api-utils: 1.0.3(typescript@5.2.2) - typescript: 5.2.2 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/typescript-estree@6.19.0(typescript@5.3.3): - resolution: {integrity: sha512-o/zefXIbbLBZ8YJ51NlkSAt2BamrK6XOmuxSR3hynMIzzyMY33KuJ9vuMdFSXW+H0tVvdF9qBPTHA91HDb4BIQ==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 6.19.0 - '@typescript-eslint/visitor-keys': 6.19.0 - debug: 4.3.4(supports-color@8.1.1) - globby: 11.1.0 - is-glob: 4.0.3 - minimatch: 9.0.3 - semver: 7.5.4 - ts-api-utils: 1.0.3(typescript@5.3.3) - typescript: 5.3.3 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/utils@6.19.0(eslint@8.56.0)(typescript@5.2.2): - resolution: {integrity: sha512-QR41YXySiuN++/dC9UArYOg4X86OAYP83OWTewpVx5ct1IZhjjgTLocj7QNxGhWoTqknsgpl7L+hGygCO+sdYw==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.6 - '@typescript-eslint/scope-manager': 6.19.0 - '@typescript-eslint/types': 6.19.0 - '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.2.2) - eslint: 8.56.0 - semver: 7.5.4 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - - /@typescript-eslint/utils@6.19.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-QR41YXySiuN++/dC9UArYOg4X86OAYP83OWTewpVx5ct1IZhjjgTLocj7QNxGhWoTqknsgpl7L+hGygCO+sdYw==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.6 - '@typescript-eslint/scope-manager': 6.19.0 - '@typescript-eslint/types': 6.19.0 - '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) - eslint: 8.56.0 - semver: 7.5.4 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - - /@typescript-eslint/visitor-keys@6.19.0: - resolution: {integrity: sha512-hZaUCORLgubBvtGpp1JEFEazcuEdfxta9j4iUwdSAr7mEsYYAp3EAUyCZk3VEEqGj6W+AV4uWyrDGtrlawAsgQ==} - engines: {node: ^16.0.0 || >=18.0.0} - dependencies: - '@typescript-eslint/types': 6.19.0 - eslint-visitor-keys: 3.4.3 - dev: true - - /@ungap/structured-clone@1.2.0: - resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - dev: true - - /@vitejs/plugin-vue@5.0.3(vite@5.0.11)(vue@3.4.7): - resolution: {integrity: sha512-b8S5dVS40rgHdDrw+DQi/xOM9ed+kSRZzfm1T74bMmBDCd8XO87NKlFYInzCtwvtWwXZvo1QxE2OSspTATWrbA==} - engines: {node: ^18.0.0 || >=20.0.0} - peerDependencies: - vite: ^5.0.0 - vue: ^3.2.25 - dependencies: - vite: 5.0.11 - vue: 3.4.7(typescript@5.3.3) - dev: true - - /@vitest/expect@1.2.1: - resolution: {integrity: sha512-/bqGXcHfyKgFWYwIgFr1QYDaR9e64pRKxgBNWNXPefPFRhgm+K3+a/dS0cUGEreWngets3dlr8w8SBRw2fCfFQ==} - dependencies: - '@vitest/spy': 1.2.1 - '@vitest/utils': 1.2.1 - chai: 4.4.1 - - /@vitest/runner@1.2.1: - resolution: {integrity: sha512-zc2dP5LQpzNzbpaBt7OeYAvmIsRS1KpZQw4G3WM/yqSV1cQKNKwLGmnm79GyZZjMhQGlRcSFMImLjZaUQvNVZQ==} - dependencies: - '@vitest/utils': 1.2.1 - p-limit: 5.0.0 - pathe: 1.1.2 - - /@vitest/snapshot@1.2.1: - resolution: {integrity: sha512-Tmp/IcYEemKaqAYCS08sh0vORLJkMr0NRV76Gl8sHGxXT5151cITJCET20063wk0Yr/1koQ6dnmP6eEqezmd/Q==} + /@vitest/snapshot@1.2.2: + resolution: {integrity: sha512-SmGY4saEw1+bwE1th6S/cZmPxz/Q4JWsl7LvbQIky2tKE35US4gd0Mjzqfr84/4OD0tikGWaWdMja/nWL5NIPA==} dependencies: magic-string: 0.30.5 pathe: 1.1.2 pretty-format: 29.7.0 - /@vitest/spy@1.2.1: - resolution: {integrity: sha512-vG3a/b7INKH7L49Lbp0IWrG6sw9j4waWAucwnksPB1r1FTJgV7nkBByd9ufzu6VWya/QTvQW4V9FShZbZIB2UQ==} + /@vitest/spy@1.2.2: + resolution: {integrity: sha512-k9Gcahssw8d7X3pSLq3e3XEu/0L78mUkCjivUqCQeXJm9clfXR/Td8+AP+VC1O6fKPIDLcHDTAmBOINVuv6+7g==} dependencies: tinyspy: 2.2.0 - /@vitest/ui@1.2.1(vitest@1.2.1): - resolution: {integrity: sha512-5kyEDpH18TB13Keutk5VScWG+LUDfPJOL2Yd1hqX+jv6+V74tp4ZYcmTgx//WDngiZA5PvX3qCHQ5KrhGzPbLg==} + /@vitest/ui@1.2.2(vitest@1.2.2): + resolution: {integrity: sha512-CG+5fa8lyoBr+9i+UZGS31Qw81v33QlD10uecHxN2CLJVN+jLnqx4pGzGvFFeJ7jSnUCT0AlbmVWY6fU6NJZmw==} peerDependencies: vitest: ^1.0.0 dependencies: - '@vitest/utils': 1.2.1 + '@vitest/utils': 1.2.2 fast-glob: 3.3.2 fflate: 0.8.1 flatted: 3.2.9 pathe: 1.1.2 picocolors: 1.0.0 sirv: 2.0.4 - vitest: 1.2.1(@types/node@20.11.5)(@vitest/ui@1.2.1) + vitest: 1.2.2(@types/node@20.11.13)(@vitest/ui@1.2.2) - /@vitest/utils@1.2.1: - resolution: {integrity: sha512-bsH6WVZYe/J2v3+81M5LDU8kW76xWObKIURpPrOXm2pjBniBu2MERI/XP60GpS4PHU3jyK50LUutOwrx4CyHUg==} + /@vitest/utils@1.2.2: + resolution: {integrity: sha512-WKITBHLsBHlpjnDQahr+XK6RE7MiAsgrIkr0pGhQ9ygoxBfUeG0lUG5iLlzqjmKSlBv3+j5EGsriBzh+C3Tq9g==} dependencies: diff-sequences: 29.6.3 estree-walker: 3.0.3 @@ -3162,14 +3016,14 @@ packages: - vue dev: true - /@zombienet/orchestrator@0.0.68(@polkadot/util@12.6.2)(@types/node@20.11.5): + /@zombienet/orchestrator@0.0.68(@polkadot/util@12.6.2)(@types/node@20.11.13): resolution: {integrity: sha512-n/Gj1VWGz6W4Phzw5r/rb56uMT3H3B06xRzP+PZJtG2dGMqWAUZP2DcNhLWZ8w3/NEsWrrNTfSejaQvuaUApGg==} engines: {node: '>=18'} dependencies: '@polkadot/api': 10.11.2 '@polkadot/keyring': 12.6.2(@polkadot/util-crypto@12.6.2)(@polkadot/util@12.6.2) '@polkadot/util-crypto': 12.6.2(@polkadot/util@12.6.2) - '@zombienet/utils': 0.0.24(@types/node@20.11.5)(typescript@5.3.3) + '@zombienet/utils': 0.0.24(@types/node@20.11.13)(typescript@5.3.3) JSONStream: 1.3.5 chai: 4.4.1 debug: 4.3.4(supports-color@8.1.1) @@ -3197,7 +3051,7 @@ packages: - utf-8-validate dev: false - /@zombienet/utils@0.0.24(@types/node@20.11.5)(typescript@5.3.3): + /@zombienet/utils@0.0.24(@types/node@20.11.13)(typescript@5.3.3): resolution: {integrity: sha512-CUHn4u04ryfRqCQQsZHSpMIpMxzdMvSZR86Gp3Hwexf7wZTkHNZ5hsJnQO+J/yl28ny0GcjLJSU1hZ2kMV+hqw==} engines: {node: '>=18'} dependencies: @@ -3206,7 +3060,7 @@ packages: mocha: 10.2.0 nunjucks: 3.2.4 toml: 3.0.0 - ts-node: 10.9.1(@types/node@20.11.5)(typescript@5.3.3) + ts-node: 10.9.1(@types/node@20.11.13)(typescript@5.3.3) transitivePeerDependencies: - '@swc/core' - '@swc/wasm' @@ -3263,14 +3117,6 @@ packages: dependencies: event-target-shim: 5.0.1 - /acorn-jsx@5.3.2(acorn@8.11.3): - resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} - peerDependencies: - acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - acorn: 8.11.3 - dev: true - /acorn-walk@8.2.0: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} engines: {node: '>=0.4.0'} @@ -3284,11 +3130,6 @@ packages: engines: {node: '>=0.4.0'} hasBin: true - /acorn@8.11.2: - resolution: {integrity: sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==} - engines: {node: '>=0.4.0'} - hasBin: true - /acorn@8.11.3: resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} engines: {node: '>=0.4.0'} @@ -3333,15 +3174,6 @@ packages: indent-string: 4.0.0 optional: true - /ajv@6.12.6: - resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} - dependencies: - fast-deep-equal: 3.1.3 - fast-json-stable-stringify: 2.1.0 - json-schema-traverse: 0.4.1 - uri-js: 4.4.1 - dev: true - /algoliasearch@4.22.1: resolution: {integrity: sha512-jwydKFQJKIx9kIZ8Jm44SdpigFwRGPESaxZBaHSV0XWN2yBJAOT4mT7ppvlrpA4UGzz92pqFnVKr/kaZXrcreg==} dependencies: @@ -3453,33 +3285,11 @@ packages: call-bind: 1.0.2 is-array-buffer: 3.0.2 - /array-includes@3.1.7: - resolution: {integrity: sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.5 - define-properties: 1.2.1 - es-abstract: 1.22.2 - get-intrinsic: 1.2.2 - is-string: 1.0.7 - dev: true - /array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} dev: true - /array.prototype.findlastindex@1.2.3: - resolution: {integrity: sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.5 - define-properties: 1.2.1 - es-abstract: 1.22.2 - es-shim-unscopables: 1.0.0 - get-intrinsic: 1.2.2 - dev: true - /array.prototype.flat@1.3.2: resolution: {integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==} engines: {node: '>= 0.4'} @@ -3490,16 +3300,6 @@ packages: es-shim-unscopables: 1.0.0 dev: true - /array.prototype.flatmap@1.3.2: - resolution: {integrity: sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.5 - define-properties: 1.2.1 - es-abstract: 1.22.2 - es-shim-unscopables: 1.0.0 - dev: true - /arraybuffer.prototype.slice@1.0.2: resolution: {integrity: sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==} engines: {node: '>= 0.4'} @@ -3541,14 +3341,25 @@ packages: resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} engines: {node: '>= 0.4'} - /axios@1.6.5(debug@4.3.4): + /axios@1.6.5: resolution: {integrity: sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==} dependencies: - follow-redirects: 1.15.4(debug@4.3.4) + follow-redirects: 1.15.4 + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + dev: true + + /axios@1.6.7(debug@4.3.4): + resolution: {integrity: sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==} + dependencies: + follow-redirects: 1.15.5(debug@4.3.4) form-data: 4.0.0 proxy-from-env: 1.1.0 transitivePeerDependencies: - debug + dev: false /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -3647,12 +3458,6 @@ packages: base64-js: 1.5.1 ieee754: 1.2.1 - /builtins@5.0.1: - resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==} - dependencies: - semver: 7.5.4 - dev: true - /bun-types@1.0.25: resolution: {integrity: sha512-9lxeUR/OJsvlZH4GOWteiAdx7ikrSxCUX7Rr0JJux+DrR3LejouVLxIZnTeQ3UPAZovvSgKivWeHPJ2wlo7/Kg==} dependencies: @@ -3715,11 +3520,6 @@ packages: get-intrinsic: 1.2.2 set-function-length: 1.1.1 - /callsites@3.1.0: - resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} - engines: {node: '>=6'} - dev: true - /camelcase-keys@6.2.2: resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} engines: {node: '>=8'} @@ -3880,6 +3680,11 @@ packages: engines: {node: '>=6'} dev: false + /cli-spinners@2.9.2: + resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} + engines: {node: '>=6'} + dev: false + /cli-table3@0.6.3: resolution: {integrity: sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==} engines: {node: 10.* || >= 12.*} @@ -3992,10 +3797,6 @@ packages: ini: 1.3.8 proto-list: 1.2.4 - /confusing-browser-globals@1.0.11: - resolution: {integrity: sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==} - dev: true - /console-control-strings@1.1.0: resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} requiresBuild: true @@ -4091,17 +3892,6 @@ packages: /dayjs@1.11.10: resolution: {integrity: sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==} - /debug@3.2.7: - resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.1.3 - dev: true - /debug@4.3.4(supports-color@8.1.1): resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -4180,10 +3970,6 @@ packages: resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} engines: {node: '>=4.0.0'} - /deep-is@0.1.4: - resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - dev: true - /defaults@1.0.4: resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} dependencies: @@ -4249,22 +4035,8 @@ packages: path-type: 4.0.0 dev: true - /doctrine@2.1.0: - resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} - engines: {node: '>=0.10.0'} - dependencies: - esutils: 2.0.3 - dev: true - - /doctrine@3.0.0: - resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} - engines: {node: '>=6.0.0'} - dependencies: - esutils: 2.0.3 - dev: true - - /dotenv@16.3.2: - resolution: {integrity: sha512-HTlk5nmhkm8F6JcdXvHIzaorzCoziNQT9mGxLPVXW8wJF1TiGSL60ZGB4gHWabHOaMmWmhvk2/lPHfnBiT78AQ==} + /dotenv@16.4.1: + resolution: {integrity: sha512-CjA3y+Dr3FyFDOAMnxZEGtnW9KBR2M0JvvUtXNW+dYJL5ROWxP9DUHCwgFqpMk0OXCc0ljhaNTr2w/kutYIcHQ==} engines: {node: '>=12'} /eastasianwidth@0.2.0: @@ -4505,332 +4277,17 @@ packages: /escape-string-regexp@1.0.5: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} engines: {node: '>=0.8.0'} - dev: true /escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - /escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - dev: false - - /eslint-config-prettier@9.1.0(eslint@8.56.0): - resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==} - hasBin: true - peerDependencies: - eslint: '>=7.0.0' - dependencies: - eslint: 8.56.0 - dev: true - - /eslint-config-standard-with-typescript@39.1.1(@typescript-eslint/eslint-plugin@6.19.0)(eslint-plugin-import@2.28.1)(eslint-plugin-n@16.2.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.2.2): - resolution: {integrity: sha512-t6B5Ep8E4I18uuoYeYxINyqcXb2UbC0SOOTxRtBSt2JUs+EzeXbfe2oaiPs71AIdnoWhXDO2fYOHz8df3kV84A==} - peerDependencies: - '@typescript-eslint/eslint-plugin': ^6.4.0 - eslint: ^8.0.1 - eslint-plugin-import: ^2.25.2 - eslint-plugin-n: '^15.0.0 || ^16.0.0 ' - eslint-plugin-promise: ^6.0.0 - typescript: '*' - dependencies: - '@typescript-eslint/eslint-plugin': 6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.2.2) - '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.2.2) - eslint: 8.56.0 - eslint-config-standard: 17.1.0(eslint-plugin-import@2.28.1)(eslint-plugin-n@16.2.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0) - eslint-plugin-import: 2.28.1(@typescript-eslint/parser@6.19.0)(eslint@8.56.0) - eslint-plugin-n: 16.2.0(eslint@8.56.0) - eslint-plugin-promise: 6.1.1(eslint@8.56.0) - typescript: 5.2.2 - transitivePeerDependencies: - - supports-color - dev: true - - /eslint-config-standard@17.1.0(eslint-plugin-import@2.28.1)(eslint-plugin-n@16.2.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0): - resolution: {integrity: sha512-IwHwmaBNtDK4zDHQukFDW5u/aTb8+meQWZvNFWkiGmbWjD6bqyuSSBxxXKkCftCUzc1zwCH2m/baCNDLGmuO5Q==} - engines: {node: '>=12.0.0'} - peerDependencies: - eslint: ^8.0.1 - eslint-plugin-import: ^2.25.2 - eslint-plugin-n: '^15.0.0 || ^16.0.0 ' - eslint-plugin-promise: ^6.0.0 - dependencies: - eslint: 8.56.0 - eslint-plugin-import: 2.28.1(@typescript-eslint/parser@6.19.0)(eslint@8.56.0) - eslint-plugin-n: 16.2.0(eslint@8.56.0) - eslint-plugin-promise: 6.1.1(eslint@8.56.0) - dev: true - - /eslint-config-xo-typescript@1.0.1(@typescript-eslint/eslint-plugin@6.19.0)(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-vPQssnRSUgBFOEfB/KY12CXwltwFSn4RSCfa+w7gjBC2PFQ7Yfgmyei+1XUZ3K+8LRGef2NMJUcxts7PldhDjg==} - engines: {node: '>=16'} - peerDependencies: - '@typescript-eslint/eslint-plugin': '>=6.0.0' - '@typescript-eslint/parser': '>=6.0.0' - eslint: '>=8.0.0' - typescript: '>=4.7' - dependencies: - '@typescript-eslint/eslint-plugin': 6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.3.3) - eslint: 8.56.0 - typescript: 5.3.3 - dev: true - - /eslint-config-xo@0.43.1(eslint@8.56.0): - resolution: {integrity: sha512-azv1L2PysRA0NkZOgbndUpN+581L7wPqkgJOgxxw3hxwXAbJgD6Hqb/SjHRiACifXt/AvxCzE/jIKFAlI7XjvQ==} - engines: {node: '>=12'} - peerDependencies: - eslint: '>=8.27.0' - dependencies: - confusing-browser-globals: 1.0.11 - eslint: 8.56.0 - dev: true - - /eslint-import-resolver-node@0.3.9: - resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} - dependencies: - debug: 3.2.7 - is-core-module: 2.13.0 - resolve: 1.22.8 - transitivePeerDependencies: - - supports-color - dev: true - - /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.19.0)(eslint-import-resolver-node@0.3.9)(eslint@8.56.0): - resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} - engines: {node: '>=4'} - peerDependencies: - '@typescript-eslint/parser': '*' - eslint: '*' - eslint-import-resolver-node: '*' - eslint-import-resolver-typescript: '*' - eslint-import-resolver-webpack: '*' - peerDependenciesMeta: - '@typescript-eslint/parser': - optional: true - eslint: - optional: true - eslint-import-resolver-node: - optional: true - eslint-import-resolver-typescript: - optional: true - eslint-import-resolver-webpack: - optional: true - dependencies: - '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.2.2) - debug: 3.2.7 - eslint: 8.56.0 - eslint-import-resolver-node: 0.3.9 - transitivePeerDependencies: - - supports-color - dev: true - - /eslint-plugin-es-x@7.2.0(eslint@8.56.0): - resolution: {integrity: sha512-9dvv5CcvNjSJPqnS5uZkqb3xmbeqRLnvXKK7iI5+oK/yTusyc46zbBZKENGsOfojm/mKfszyZb+wNqNPAPeGXA==} - engines: {node: ^14.18.0 || >=16.0.0} - peerDependencies: - eslint: '>=8' - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) - '@eslint-community/regexpp': 4.10.0 - eslint: 8.56.0 - dev: true - - /eslint-plugin-es@3.0.1(eslint@8.56.0): - resolution: {integrity: sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==} - engines: {node: '>=8.10.0'} - peerDependencies: - eslint: '>=4.19.1' - dependencies: - eslint: 8.56.0 - eslint-utils: 2.1.0 - regexpp: 3.2.0 - dev: true - - /eslint-plugin-import@2.28.1(@typescript-eslint/parser@6.19.0)(eslint@8.56.0): - resolution: {integrity: sha512-9I9hFlITvOV55alzoKBI+K9q74kv0iKMeY6av5+umsNwayt59fz692daGyjR+oStBQgx6nwR9rXldDev3Clw+A==} - engines: {node: '>=4'} - peerDependencies: - '@typescript-eslint/parser': '*' - eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 - peerDependenciesMeta: - '@typescript-eslint/parser': - optional: true - dependencies: - '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.2.2) - array-includes: 3.1.7 - array.prototype.findlastindex: 1.2.3 - array.prototype.flat: 1.3.2 - array.prototype.flatmap: 1.3.2 - debug: 3.2.7 - doctrine: 2.1.0 - eslint: 8.56.0 - eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.19.0)(eslint-import-resolver-node@0.3.9)(eslint@8.56.0) - has: 1.0.4 - is-core-module: 2.13.0 - is-glob: 4.0.3 - minimatch: 3.1.2 - object.fromentries: 2.0.7 - object.groupby: 1.0.1 - object.values: 1.1.7 - semver: 6.3.1 - tsconfig-paths: 3.14.2 - transitivePeerDependencies: - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - - supports-color - dev: true - - /eslint-plugin-n@16.2.0(eslint@8.56.0): - resolution: {integrity: sha512-AQER2jEyQOt1LG6JkGJCCIFotzmlcCZFur2wdKrp1JX2cNotC7Ae0BcD/4lLv3lUAArM9uNS8z/fsvXTd0L71g==} - engines: {node: '>=16.0.0'} - peerDependencies: - eslint: '>=7.0.0' - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) - builtins: 5.0.1 - eslint: 8.56.0 - eslint-plugin-es-x: 7.2.0(eslint@8.56.0) - get-tsconfig: 4.7.2 - ignore: 5.3.0 - is-core-module: 2.13.0 - minimatch: 3.1.2 - resolve: 1.22.8 - semver: 7.5.4 - dev: true - - /eslint-plugin-node@11.1.0(eslint@8.56.0): - resolution: {integrity: sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==} - engines: {node: '>=8.10.0'} - peerDependencies: - eslint: '>=5.16.0' - dependencies: - eslint: 8.56.0 - eslint-plugin-es: 3.0.1(eslint@8.56.0) - eslint-utils: 2.1.0 - ignore: 5.3.0 - minimatch: 3.1.2 - resolve: 1.22.8 - semver: 6.3.1 - dev: true - - /eslint-plugin-promise@6.1.1(eslint@8.56.0): - resolution: {integrity: sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - dependencies: - eslint: 8.56.0 - dev: true - - /eslint-scope@7.2.2: - resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - esrecurse: 4.3.0 - estraverse: 5.3.0 - dev: true - - /eslint-utils@2.1.0: - resolution: {integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==} - engines: {node: '>=6'} - dependencies: - eslint-visitor-keys: 1.3.0 - dev: true - - /eslint-visitor-keys@1.3.0: - resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==} - engines: {node: '>=4'} - dev: true - - /eslint-visitor-keys@3.4.3: - resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true - - /eslint@8.56.0: - resolution: {integrity: sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - hasBin: true - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) - '@eslint-community/regexpp': 4.10.0 - '@eslint/eslintrc': 2.1.4 - '@eslint/js': 8.56.0 - '@humanwhocodes/config-array': 0.11.13 - '@humanwhocodes/module-importer': 1.0.1 - '@nodelib/fs.walk': 1.2.8 - '@ungap/structured-clone': 1.2.0 - ajv: 6.12.6 - chalk: 4.1.2 - cross-spawn: 7.0.3 - debug: 4.3.4(supports-color@8.1.1) - doctrine: 3.0.0 - escape-string-regexp: 4.0.0 - eslint-scope: 7.2.2 - eslint-visitor-keys: 3.4.3 - espree: 9.6.1 - esquery: 1.5.0 - esutils: 2.0.3 - fast-deep-equal: 3.1.3 - file-entry-cache: 6.0.1 - find-up: 5.0.0 - glob-parent: 6.0.2 - globals: 13.24.0 - graphemer: 1.4.0 - ignore: 5.3.0 - imurmurhash: 0.1.4 - is-glob: 4.0.3 - is-path-inside: 3.0.3 - js-yaml: 4.1.0 - json-stable-stringify-without-jsonify: 1.0.1 - levn: 0.4.1 - lodash.merge: 4.6.2 - minimatch: 3.1.2 - natural-compare: 1.4.0 - optionator: 0.9.3 - strip-ansi: 6.0.1 - text-table: 0.2.0 - transitivePeerDependencies: - - supports-color - dev: true - - /espree@9.6.1: - resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - acorn: 8.11.3 - acorn-jsx: 5.3.2(acorn@8.11.3) - eslint-visitor-keys: 3.4.3 - dev: true - /esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} hasBin: true dev: true - /esquery@1.5.0: - resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} - engines: {node: '>=0.10'} - dependencies: - estraverse: 5.3.0 - dev: true - - /esrecurse@4.3.0: - resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} - engines: {node: '>=4.0'} - dependencies: - estraverse: 5.3.0 - dev: true - - /estraverse@5.3.0: - resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} - engines: {node: '>=4.0'} - dev: true - /estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} dev: true @@ -4840,11 +4297,6 @@ packages: dependencies: '@types/estree': 1.0.5 - /esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - dev: true - /ethereum-cryptography@2.1.2: resolution: {integrity: sha512-Z5Ba0T0ImZ8fqXrJbpHcbpAvIswRte2wGNR/KePnu8GbbvgJ47lMxT/ZZPG6i9Jaht4azPDop4HaM00J0J59ug==} dependencies: @@ -4926,10 +4378,6 @@ packages: /fast-copy@3.0.1: resolution: {integrity: sha512-Knr7NOtK3HWRYGtHoJrjkaWepqT8thIVGAwt0p0aUs1zqkAzXZV4vo9fFNwyb5fcqK1GKYFYxldQdIDVKhUAfA==} - /fast-deep-equal@3.1.3: - resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - dev: true - /fast-glob@3.3.1: resolution: {integrity: sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==} engines: {node: '>=8.6.0'} @@ -4951,14 +4399,6 @@ packages: merge2: 1.4.1 micromatch: 4.0.5 - /fast-json-stable-stringify@2.1.0: - resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} - dev: true - - /fast-levenshtein@2.0.6: - resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - dev: true - /fast-redact@3.3.0: resolution: {integrity: sha512-6T5V1QK1u4oF+ATxs1lWUmlEk6P2T9HqJG3e2DnHOdVgZy2rFJBoEnrIedcTXlkAHU/zKC+7KETJ+KGGKwxgMQ==} engines: {node: '>=6'} @@ -4981,21 +4421,13 @@ packages: /fflate@0.8.1: resolution: {integrity: sha512-/exOvEuc+/iaUm105QIiOt4LpBdMTWsXxqR0HDF35vx3fmaKzw7354gTilCh5rkzEt8WYyG//ku3h3nRmd7CHQ==} - /figures@5.0.0: - resolution: {integrity: sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==} - engines: {node: '>=14'} + /figures@3.2.0: + resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} + engines: {node: '>=8'} dependencies: - escape-string-regexp: 5.0.0 - is-unicode-supported: 1.3.0 + escape-string-regexp: 1.0.5 dev: false - /file-entry-cache@6.0.1: - resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} - engines: {node: ^10.12.0 || >=12.0.0} - dependencies: - flat-cache: 3.2.0 - dev: true - /file-uri-to-path@1.0.0: resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} @@ -5027,15 +4459,6 @@ packages: pkg-dir: 4.2.0 dev: true - /flat-cache@3.2.0: - resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} - engines: {node: ^10.12.0 || >=12.0.0} - dependencies: - flatted: 3.2.9 - keyv: 4.5.4 - rimraf: 3.0.2 - dev: true - /flat@5.0.2: resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} hasBin: true @@ -5050,9 +4473,19 @@ packages: tabbable: 6.2.0 dev: true - /follow-redirects@1.15.4(debug@4.3.4): + /follow-redirects@1.15.4: resolution: {integrity: sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==} engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dev: true + + /follow-redirects@1.15.5(debug@4.3.4): + resolution: {integrity: sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==} + engines: {node: '>=4.0'} peerDependencies: debug: '*' peerDependenciesMeta: @@ -5060,6 +4493,7 @@ packages: optional: true dependencies: debug: 4.3.4(supports-color@8.1.1) + dev: false /for-each@0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} @@ -5226,13 +4660,6 @@ packages: dependencies: is-glob: 4.0.3 - /glob-parent@6.0.2: - resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} - engines: {node: '>=10.13.0'} - dependencies: - is-glob: 4.0.3 - dev: true - /glob@10.3.10: resolution: {integrity: sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==} engines: {node: '>=16 || 14 >=14.17'} @@ -5288,13 +4715,6 @@ packages: semver: 7.5.4 serialize-error: 7.0.1 - /globals@13.24.0: - resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} - engines: {node: '>=8'} - dependencies: - type-fest: 0.20.2 - dev: true - /globalthis@1.0.3: resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} engines: {node: '>= 0.4'} @@ -5329,10 +4749,6 @@ packages: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} dev: true - /graphemer@1.4.0: - resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} - dev: true - /hard-rejection@2.1.0: resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} engines: {node: '>=6'} @@ -5497,23 +4913,11 @@ packages: engines: {node: '>= 4'} dev: true - /ignore@5.3.0: - resolution: {integrity: sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==} - engines: {node: '>= 4'} - dev: true - - /import-fresh@3.3.0: - resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} - engines: {node: '>=6'} - dependencies: - parent-module: 1.0.1 - resolve-from: 4.0.0 - dev: true - /imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} requiresBuild: true + optional: true /indent-string@4.0.0: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} @@ -5537,27 +4941,27 @@ packages: /ini@1.3.8: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} - /inquirer-press-to-continue@1.2.0(inquirer@9.2.12): + /inquirer-press-to-continue@1.2.0(inquirer@9.2.13): resolution: {integrity: sha512-HdKOgEAydYhI3OKLy5S4LMi7a/AHJjPzF06mHqbdVxlTmHOaytQVBaVbQcSytukD70K9FYLhYicNOPuNjFiWVQ==} peerDependencies: inquirer: '>=8.0.0 <10.0.0' dependencies: deep-equal: 2.2.2 - inquirer: 9.2.12 + inquirer: 9.2.13 ora: 6.3.1 dev: false - /inquirer@9.2.12: - resolution: {integrity: sha512-mg3Fh9g2zfuVWJn6lhST0O7x4n03k7G8Tx5nvikJkbq8/CK47WDVm+UznF0G6s5Zi0KcyUisr6DU8T67N5U+1Q==} + /inquirer@9.2.13: + resolution: {integrity: sha512-mUlJNemjYioZgaZXqEFlQ0z9GD8/o+pavIF3JyhzWLX4Xa9M1wioGMCxQEFmps70un9lrah2WaBl3kSRVcoV3g==} engines: {node: '>=14.18.0'} dependencies: - '@ljharb/through': 2.3.11 + '@ljharb/through': 2.3.12 ansi-escapes: 4.3.2 chalk: 5.3.0 cli-cursor: 3.1.0 cli-width: 4.1.0 external-editor: 3.1.0 - figures: 5.0.0 + figures: 3.2.0 lodash: 4.17.21 mute-stream: 1.0.0 ora: 5.4.1 @@ -5687,11 +5091,6 @@ packages: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} - /is-path-inside@3.0.3: - resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} - engines: {node: '>=8'} - dev: true - /is-plain-obj@1.1.0: resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} engines: {node: '>=0.10.0'} @@ -5892,34 +5291,15 @@ packages: bignumber.js: 9.1.2 dev: false - /json-buffer@3.0.1: - resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} - dev: true - /json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} dev: true - /json-schema-traverse@0.4.1: - resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} - dev: true - - /json-stable-stringify-without-jsonify@1.0.1: - resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} - dev: true - /json-stringify-safe@5.0.1: resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} - /json5@1.0.2: - resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==} - hasBin: true - dependencies: - minimist: 1.2.8 - dev: true - - /jsonc-parser@3.2.0: - resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} + /jsonc-parser@3.2.1: + resolution: {integrity: sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==} /jsondiffpatch@0.5.0: resolution: {integrity: sha512-Quz3MvAwHxVYNXsOByL7xI5EB2WYOeFswqaHIA3qOK3isRWTxiplBEocmmru6XmxDB2L7jDNYtYA4FyimoAFEw==} @@ -5949,12 +5329,6 @@ packages: engines: {'0': node >= 0.2.0} dev: false - /keyv@4.5.4: - resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} - dependencies: - json-buffer: 3.0.1 - dev: true - /kind-of@6.0.3: resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} engines: {node: '>=0.10.0'} @@ -5965,14 +5339,6 @@ packages: engines: {node: '>=6'} dev: true - /levn@0.4.1: - resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} - engines: {node: '>= 0.8.0'} - dependencies: - prelude-ls: 1.2.1 - type-check: 0.4.0 - dev: true - /libp2p-crypto@0.21.2: resolution: {integrity: sha512-EXFrhSpiHtJ+/L8xXDvQNK5VjUMG51u878jzZcaT5XhuN/zFg6PWJFnl/qB2Y2j7eMWnvCRP7Kp+ua2H36cG4g==} engines: {node: '>=12.0.0'} @@ -6031,10 +5397,6 @@ packages: dependencies: p-locate: 5.0.0 - /lodash.merge@4.6.2: - resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} - dev: true - /lodash.sortby@4.7.0: resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} dev: true @@ -6081,6 +5443,11 @@ packages: resolution: {integrity: sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag==} engines: {node: 14 || >=16.14} + /lru-cache@10.2.0: + resolution: {integrity: sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==} + engines: {node: 14 || >=16.14} + dev: false + /lru-cache@4.1.5: resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} dependencies: @@ -6461,10 +5828,6 @@ packages: napi-maybe-compressed-blob-linux-x64-gnu: 0.0.11 dev: false - /natural-compare@1.4.0: - resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - dev: true - /negotiator@0.6.3: resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} engines: {node: '>= 0.6'} @@ -6627,33 +5990,6 @@ packages: has-symbols: 1.0.3 object-keys: 1.1.1 - /object.fromentries@2.0.7: - resolution: {integrity: sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.5 - define-properties: 1.2.1 - es-abstract: 1.22.2 - dev: true - - /object.groupby@1.0.1: - resolution: {integrity: sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==} - dependencies: - call-bind: 1.0.5 - define-properties: 1.2.1 - es-abstract: 1.22.2 - get-intrinsic: 1.2.2 - dev: true - - /object.values@1.1.7: - resolution: {integrity: sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.5 - define-properties: 1.2.1 - es-abstract: 1.22.2 - dev: true - /on-exit-leak-free@2.1.2: resolution: {integrity: sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==} engines: {node: '>=14.0.0'} @@ -6673,19 +6009,7 @@ packages: resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} engines: {node: '>=12'} dependencies: - mimic-fn: 4.0.0 - - /optionator@0.9.3: - resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} - engines: {node: '>= 0.8.0'} - dependencies: - '@aashutoshrathi/word-wrap': 1.2.6 - deep-is: 0.1.4 - fast-levenshtein: 2.0.6 - levn: 0.4.1 - prelude-ls: 1.2.1 - type-check: 0.4.0 - dev: true + mimic-fn: 4.0.0 /ora@5.4.1: resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} @@ -6694,7 +6018,7 @@ packages: bl: 4.1.0 chalk: 4.1.2 cli-cursor: 3.1.0 - cli-spinners: 2.9.1 + cli-spinners: 2.9.2 is-interactive: 1.0.0 is-unicode-supported: 0.1.0 log-symbols: 4.1.0 @@ -6782,13 +6106,6 @@ packages: engines: {node: '>=6'} dev: true - /parent-module@1.0.1: - resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} - engines: {node: '>=6'} - dependencies: - callsites: 3.1.0 - dev: true - /parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} @@ -6946,7 +6263,7 @@ packages: /pkg-types@1.0.3: resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} dependencies: - jsonc-parser: 3.2.0 + jsonc-parser: 3.2.1 mlly: 1.5.0 pathe: 1.1.2 @@ -7012,23 +6329,12 @@ packages: which-pm: 2.0.0 dev: true - /prelude-ls@1.2.1: - resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} - engines: {node: '>= 0.8.0'} - dev: true - /prettier@2.8.8: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} hasBin: true dev: true - /prettier@3.2.4: - resolution: {integrity: sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==} - engines: {node: '>=14'} - hasBin: true - dev: true - /pretty-format@29.7.0: resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -7086,7 +6392,7 @@ packages: '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 '@types/long': 4.0.2 - '@types/node': 20.11.5 + '@types/node': 20.11.13 long: 4.0.0 dev: false @@ -7211,6 +6517,11 @@ packages: /reflect-metadata@0.1.14: resolution: {integrity: sha512-ZhYeb6nRaXCfhnndflDK8qI6ZQ/YcWZCISRAWICW9XYqMUwjZM9Z0DveWX/ABN01oxSHwVxKQmxeYZSsm0jh5A==} + dev: true + + /reflect-metadata@0.2.1: + resolution: {integrity: sha512-i5lLI6iw9AU3Uu4szRNPPEkomnkjRTaVt9hy/bn5g/oSzekBSMeLZblcjP74AW0vBabqERLLIrz+gR8QYR54Tw==} + dev: false /regenerator-runtime@0.14.0: resolution: {integrity: sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==} @@ -7224,11 +6535,6 @@ packages: define-properties: 1.2.1 set-function-name: 2.0.1 - /regexpp@3.2.0: - resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} - engines: {node: '>=8'} - dev: true - /require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} @@ -7246,11 +6552,6 @@ packages: resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} dev: false - /resolve-from@4.0.0: - resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} - engines: {node: '>=4'} - dev: true - /resolve-from@5.0.0: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} @@ -7451,11 +6752,6 @@ packages: hasBin: true dev: true - /semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - dev: true - /semver@7.5.4: resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} engines: {node: '>=10'} @@ -7640,7 +6936,7 @@ packages: dependencies: command-exists: 1.2.9 commander: 8.3.0 - follow-redirects: 1.15.4(debug@4.3.4) + follow-redirects: 1.15.4 js-sha3: 0.8.0 memorystream: 0.3.1 semver: 5.7.2 @@ -7845,7 +7141,7 @@ packages: /strip-literal@1.3.0: resolution: {integrity: sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==} dependencies: - acorn: 8.11.2 + acorn: 8.11.3 /sucrase@3.34.0: resolution: {integrity: sha512-70/LQEZ07TEcxiU2dz51FKaE6hCTWC6vr7FOk3Gr0U60C3shtAN+H+BFr9XlYe5xqf3RA8nrc+VIwzCfnxuXJw==} @@ -7927,10 +7223,6 @@ packages: engines: {node: '>=8'} dev: true - /text-table@0.2.0: - resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} - dev: true - /thenify-all@1.6.0: resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} engines: {node: '>=0.8'} @@ -8036,29 +7328,11 @@ packages: engines: {node: '>=8'} dev: true - /ts-api-utils@1.0.3(typescript@5.2.2): - resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==} - engines: {node: '>=16.13.0'} - peerDependencies: - typescript: '>=4.2.0' - dependencies: - typescript: 5.2.2 - dev: true - - /ts-api-utils@1.0.3(typescript@5.3.3): - resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==} - engines: {node: '>=16.13.0'} - peerDependencies: - typescript: '>=4.2.0' - dependencies: - typescript: 5.3.3 - dev: true - /ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: true - /ts-node@10.9.1(@types/node@16.18.74)(typescript@5.1.6): + /ts-node@10.9.1(@types/node@16.18.77)(typescript@5.1.6): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -8077,7 +7351,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 16.18.74 + '@types/node': 16.18.77 acorn: 8.10.0 acorn-walk: 8.2.0 arg: 4.1.3 @@ -8089,7 +7363,7 @@ packages: yn: 3.1.1 dev: true - /ts-node@10.9.1(@types/node@20.11.5)(typescript@5.3.3): + /ts-node@10.9.1(@types/node@20.11.13)(typescript@5.3.3): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -8108,7 +7382,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.11.5 + '@types/node': 20.11.13 acorn: 8.10.0 acorn-walk: 8.2.0 arg: 4.1.3 @@ -8120,15 +7394,6 @@ packages: yn: 3.1.1 dev: false - /tsconfig-paths@3.14.2: - resolution: {integrity: sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==} - dependencies: - '@types/json5': 0.0.29 - json5: 1.0.2 - minimist: 1.2.8 - strip-bom: 3.0.0 - dev: true - /tslib@2.4.0: resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==} @@ -8204,13 +7469,6 @@ packages: dependencies: safe-buffer: 5.2.1 - /type-check@0.4.0: - resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} - engines: {node: '>= 0.8.0'} - dependencies: - prelude-ls: 1.2.1 - dev: true - /type-detect@4.0.8: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} @@ -8219,11 +7477,6 @@ packages: resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} engines: {node: '>=10'} - /type-fest@0.20.2: - resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} - engines: {node: '>=10'} - dev: true - /type-fest@0.21.3: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} engines: {node: '>=10'} @@ -8342,7 +7595,7 @@ packages: cli-highlight: 2.1.11 dayjs: 1.11.10 debug: 4.3.4(supports-color@8.1.1) - dotenv: 16.3.2 + dotenv: 16.4.1 glob: 10.3.10 mkdirp: 2.1.6 reflect-metadata: 0.1.14 @@ -8353,17 +7606,96 @@ packages: yargs: 17.7.2 transitivePeerDependencies: - supports-color + dev: true + + /typeorm@0.3.20(sqlite3@5.1.7): + resolution: {integrity: sha512-sJ0T08dV5eoZroaq9uPKBoNcGslHBR4E4y+EBHs//SiGbblGe7IeduP/IH4ddCcj0qp3PHwDwGnuvqEAnKlq/Q==} + engines: {node: '>=16.13.0'} + hasBin: true + peerDependencies: + '@google-cloud/spanner': ^5.18.0 + '@sap/hana-client': ^2.12.25 + better-sqlite3: ^7.1.2 || ^8.0.0 || ^9.0.0 + hdb-pool: ^0.1.6 + ioredis: ^5.0.4 + mongodb: ^5.8.0 + mssql: ^9.1.1 || ^10.0.1 + mysql2: ^2.2.5 || ^3.0.1 + oracledb: ^6.3.0 + pg: ^8.5.1 + pg-native: ^3.0.0 + pg-query-stream: ^4.0.0 + redis: ^3.1.1 || ^4.0.0 + sql.js: ^1.4.0 + sqlite3: ^5.0.3 + ts-node: ^10.7.0 + typeorm-aurora-data-api-driver: ^2.0.0 + peerDependenciesMeta: + '@google-cloud/spanner': + optional: true + '@sap/hana-client': + optional: true + better-sqlite3: + optional: true + hdb-pool: + optional: true + ioredis: + optional: true + mongodb: + optional: true + mssql: + optional: true + mysql2: + optional: true + oracledb: + optional: true + pg: + optional: true + pg-native: + optional: true + pg-query-stream: + optional: true + redis: + optional: true + sql.js: + optional: true + sqlite3: + optional: true + ts-node: + optional: true + typeorm-aurora-data-api-driver: + optional: true + dependencies: + '@sqltools/formatter': 1.2.5 + app-root-path: 3.1.0 + buffer: 6.0.3 + chalk: 4.1.2 + cli-highlight: 2.1.11 + dayjs: 1.11.10 + debug: 4.3.4(supports-color@8.1.1) + dotenv: 16.4.1 + glob: 10.3.10 + mkdirp: 2.1.6 + reflect-metadata: 0.2.1 + sha.js: 2.4.11 + sqlite3: 5.1.7 + tslib: 2.6.2 + uuid: 9.0.1 + yargs: 17.7.2 + transitivePeerDependencies: + - supports-color + dev: false /typescript-json-schema@0.62.0: resolution: {integrity: sha512-qRO6pCgyjKJ230QYdOxDRpdQrBeeino4v5p2rYmSD72Jf4rD3O+cJcROv46sQukm46CLWoeusqvBgKpynEv25g==} hasBin: true dependencies: '@types/json-schema': 7.0.15 - '@types/node': 16.18.74 + '@types/node': 16.18.77 glob: 7.2.3 path-equal: 1.2.5 safe-stable-stringify: 2.4.3 - ts-node: 10.9.1(@types/node@16.18.74)(typescript@5.1.6) + ts-node: 10.9.1(@types/node@16.18.77)(typescript@5.1.6) typescript: 5.1.6 yargs: 17.7.2 transitivePeerDependencies: @@ -8377,12 +7709,6 @@ packages: hasBin: true dev: true - /typescript@5.2.2: - resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} - engines: {node: '>=14.17'} - hasBin: true - dev: true - /typescript@5.3.3: resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} engines: {node: '>=14.17'} @@ -8442,12 +7768,6 @@ packages: engines: {node: '>= 10.0.0'} dev: false - /uri-js@4.4.1: - resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} - dependencies: - punycode: 2.3.1 - dev: true - /url-parse@1.5.10: resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==} dependencies: @@ -8502,9 +7822,53 @@ packages: - bufferutil - utf-8-validate - zod + dev: true + + /viem@2.7.1(typescript@5.3.3): + resolution: {integrity: sha512-izAX2KedTFnI2l0ZshtnlK2ZuDvSlKeuaanWyNwC4ffDgrCGtwX1bvVXO3Krh53lZgqvjd8UGpjGaBl3WqJ4yQ==} + peerDependencies: + typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@adraffy/ens-normalize': 1.10.0 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@scure/bip32': 1.3.2 + '@scure/bip39': 1.2.1 + abitype: 1.0.0(typescript@5.3.3) + isows: 1.0.3(ws@8.13.0) + typescript: 5.3.3 + ws: 8.13.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + - zod + dev: false + + /vite-node@1.2.2(@types/node@20.11.13): + resolution: {integrity: sha512-1as4rDTgVWJO3n1uHmUYqq7nsFgINQ9u+mRcXpjeOMJUmviqNKjcZB7UfRZrlM7MjYXMKpuWp5oGkjaFLnjawg==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + dependencies: + cac: 6.7.14 + debug: 4.3.4(supports-color@8.1.1) + pathe: 1.1.2 + picocolors: 1.0.0 + vite: 5.0.12(@types/node@20.11.13) + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser - /vite-node@1.2.1(@types/node@20.11.5): - resolution: {integrity: sha512-fNzHmQUSOY+y30naohBvSW7pPn/xn3Ib/uqm+5wAJQJiqQsU0NBR78XdRJb04l4bOFKjpTWld0XAfkKlrDbySg==} + /vite-node@1.2.2(@types/node@20.11.5): + resolution: {integrity: sha512-1as4rDTgVWJO3n1uHmUYqq7nsFgINQ9u+mRcXpjeOMJUmviqNKjcZB7UfRZrlM7MjYXMKpuWp5oGkjaFLnjawg==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true dependencies: @@ -8522,6 +7886,7 @@ packages: - sugarss - supports-color - terser + dev: true /vite@5.0.11: resolution: {integrity: sha512-XBMnDjZcNAw/G1gEiskiM1v6yzM4GE5aMGvhWTlHAYYhxb7S3/V1s3m2LDHa8Vh6yIWYYB0iJwsEaS523c4oYA==} @@ -8558,6 +7923,41 @@ packages: fsevents: 2.3.3 dev: true + /vite@5.0.12(@types/node@20.11.13): + resolution: {integrity: sha512-4hsnEkG3q0N4Tzf1+t6NdN9dg/L3BM+q8SWgbSPnJvrgH2kgdyzfVJwbR1ic69/4uMJJ/3dqDZZE5/WwqW8U1w==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@types/node': ^18.0.0 || >=20.0.0 + less: '*' + lightningcss: ^1.21.0 + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + '@types/node': 20.11.13 + esbuild: 0.19.11 + postcss: 8.4.33 + rollup: 4.9.6 + optionalDependencies: + fsevents: 2.3.3 + /vite@5.0.12(@types/node@20.11.5): resolution: {integrity: sha512-4hsnEkG3q0N4Tzf1+t6NdN9dg/L3BM+q8SWgbSPnJvrgH2kgdyzfVJwbR1ic69/4uMJJ/3dqDZZE5/WwqW8U1w==} engines: {node: ^18.0.0 || >=20.0.0} @@ -8592,6 +7992,7 @@ packages: rollup: 4.9.6 optionalDependencies: fsevents: 2.3.3 + dev: true /vitepress@1.0.0-rc.36(@algolia/client-search@4.22.1)(search-insights@2.13.0)(typescript@5.3.3): resolution: {integrity: sha512-2z4dpM9PplN/yvTifhavOIAazlCR6OJ5PvLoRbc+7LdcFeIlCsuDGENLX4HjMW18jQZF5/j7++PNqdBfeazxUA==} @@ -8648,8 +8049,65 @@ packages: - universal-cookie dev: true - /vitest@1.2.1(@types/node@20.11.5)(@vitest/ui@1.2.1): - resolution: {integrity: sha512-TRph8N8rnSDa5M2wKWJCMnztCZS9cDcgVTQ6tsTFTG/odHJ4l5yNVqvbeDJYJRZ6is3uxaEpFs8LL6QM+YFSdA==} + /vitest@1.2.2(@types/node@20.11.13)(@vitest/ui@1.2.2): + resolution: {integrity: sha512-d5Ouvrnms3GD9USIK36KG8OZ5bEvKEkITFtnGv56HFaSlbItJuYr7hv2Lkn903+AvRAgSixiamozUVfORUekjw==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@types/node': ^18.0.0 || >=20.0.0 + '@vitest/browser': ^1.0.0 + '@vitest/ui': ^1.0.0 + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@types/node': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + dependencies: + '@types/node': 20.11.13 + '@vitest/expect': 1.2.2 + '@vitest/runner': 1.2.2 + '@vitest/snapshot': 1.2.2 + '@vitest/spy': 1.2.2 + '@vitest/ui': 1.2.2(vitest@1.2.2) + '@vitest/utils': 1.2.2 + acorn-walk: 8.3.2 + cac: 6.7.14 + chai: 4.4.1 + debug: 4.3.4(supports-color@8.1.1) + execa: 8.0.1 + local-pkg: 0.5.0 + magic-string: 0.30.5 + pathe: 1.1.2 + picocolors: 1.0.0 + std-env: 3.7.0 + strip-literal: 1.3.0 + tinybench: 2.6.0 + tinypool: 0.8.2 + vite: 5.0.12(@types/node@20.11.13) + vite-node: 1.2.2(@types/node@20.11.13) + why-is-node-running: 2.2.2 + transitivePeerDependencies: + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + + /vitest@1.2.2(@types/node@20.11.5)(@vitest/ui@1.2.2): + resolution: {integrity: sha512-d5Ouvrnms3GD9USIK36KG8OZ5bEvKEkITFtnGv56HFaSlbItJuYr7hv2Lkn903+AvRAgSixiamozUVfORUekjw==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -8674,12 +8132,12 @@ packages: optional: true dependencies: '@types/node': 20.11.5 - '@vitest/expect': 1.2.1 - '@vitest/runner': 1.2.1 - '@vitest/snapshot': 1.2.1 - '@vitest/spy': 1.2.1 - '@vitest/ui': 1.2.1(vitest@1.2.1) - '@vitest/utils': 1.2.1 + '@vitest/expect': 1.2.2 + '@vitest/runner': 1.2.2 + '@vitest/snapshot': 1.2.2 + '@vitest/spy': 1.2.2 + '@vitest/ui': 1.2.2(vitest@1.2.2) + '@vitest/utils': 1.2.2 acorn-walk: 8.3.2 cac: 6.7.14 chai: 4.4.1 @@ -8694,7 +8152,7 @@ packages: tinybench: 2.6.0 tinypool: 0.8.2 vite: 5.0.12(@types/node@20.11.5) - vite-node: 1.2.1(@types/node@20.11.5) + vite-node: 1.2.2(@types/node@20.11.5) why-is-node-running: 2.2.2 transitivePeerDependencies: - less @@ -8704,6 +8162,7 @@ packages: - sugarss - supports-color - terser + dev: true /vue-demi@0.14.6(vue@3.4.7): resolution: {integrity: sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==} diff --git a/test/biome.json b/test/biome.json new file mode 100644 index 00000000..83fc4f53 --- /dev/null +++ b/test/biome.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.5.3/schema.json", + "extends": ["../../biome.json"], +"files":{ + "ignore": [ "node_modules/", "contracts", "tmp" , "html"] +} + } \ No newline at end of file diff --git a/test/moonwall.config.json b/test/moonwall.config.json index d31bfe7f..fe617a3a 100644 --- a/test/moonwall.config.json +++ b/test/moonwall.config.json @@ -118,7 +118,7 @@ "name": "viem", "type": "viem", "endpoints": [ - "wss://wss.api.moonbeam.network" + "wss://rpc.api.moonbeam.network" ] } ] @@ -261,6 +261,9 @@ }, { "name": "chopsticks", + "envVars": [ + "DEBUG_COLORS=1" + ], "testFileDir": [ "suites/chopsticks/" ], @@ -747,14 +750,14 @@ "name": "w3", "type": "web3", "endpoints": [ - "wss://wss.api.moonbeam.network" + "wss://rpc.api.moonbeam.network" ] }, { "name": "MB", "type": "polkadotJs", "endpoints": [ - "wss://wss.api.moonbeam.network" + "wss://rpc.api.moonbeam.network" ] } ] @@ -782,14 +785,14 @@ "name": "para", "type": "polkadotJs", "endpoints": [ - "wss://wss.api.moonbeam.network" + "wss://moonbeam-rpc.dwellir.com" ] }, { "name": "eth", "type": "ethers", "endpoints": [ - "wss://wss.api.moonbeam.network" + "wss://moonbeam-rpc.dwellir.com" ] } ] @@ -817,14 +820,14 @@ "name": "eth", "type": "ethers", "endpoints": [ - "wss://wss.api.moonbeam.network" + "wss://rpc.api.moonbeam.network" ] }, { "name": "para", "type": "polkadotJs", "endpoints": [ - "wss://wss.api.moonbeam.network" + "wss://rpc.api.moonbeam.network" ] } ] diff --git a/test/package.json b/test/package.json index 5a20820c..7d7801b9 100644 --- a/test/package.json +++ b/test/package.json @@ -9,11 +9,14 @@ "clean": "rm -rf node_modules", "test-dev": "pnpm moonwall test 'dev_test dev_seq dev_mult'", "test": "pnpm moonwall test 'basic chopsticks'", + "fmt": "biome format .", + "fmt:fix": "biome format . --write", "node_test": "node --no-warnings --loader tsx --test suites/node_test/*.ts", "bun_test": "bun test suites/bun_test/*" }, "devDependencies": { "@acala-network/chopsticks": "0.9.7", + "@biomejs/biome": "1.5.3", "@moonbeam-network/api-augment": "0.2700.0", "@moonwall/cli": "workspace:*", "@moonwall/types": "workspace:*", @@ -23,18 +26,17 @@ "@polkadot/api-augment": "10.11.2", "@polkadot/util": "12.6.2", "@types/node": "20.11.5", - "@vitest/ui": "1.2.1", + "@vitest/ui": "1.2.2", "bun-types": "1.0.25", "chai": "5.0.0", "chalk": "5.3.0", "ethers": "6.10.0", "pnpm": "8.14.2", - "prettier": "3.2.4", "solc": "0.8.23-fixed", "tsx": "4.7.0", "typescript": "5.3.3", "viem": "2.4.1", - "vitest": "1.2.1", + "vitest": "1.2.2", "web3": "4.4.0", "yargs": "17.7.2" } diff --git a/test/scripts/compile-contracts.ts b/test/scripts/compile-contracts.ts index bb06b277..0989d343 100644 --- a/test/scripts/compile-contracts.ts +++ b/test/scripts/compile-contracts.ts @@ -95,7 +95,7 @@ async function main(args: any) { } console.log(`📁 Found ${Object.keys(sourceToCompile).length} contracts to compile`); - const contractsToCompile = []; + const contractsToCompile: any[] = []; const tempFileExists = await fs .access(tempFile) .then(() => true) @@ -105,6 +105,10 @@ async function main(args: any) { contractMd5 = JSON.parse((await fs.readFile(tempFile)).toString()); for (const contract of Object.keys(sourceToCompile)) { const path = filePaths.find((path) => path.includes(contract)); + + if (!path) { + throw new Error(`Contract ${contract} not found in ${filePaths}`); + } const contractHash = computeHash((await fs.readFile(path)).toString()); if (contractHash != contractMd5[contract]) { console.log(` - Change in ${chalk.yellow(contract)}, compiling ⚙ī¸`); @@ -127,9 +131,13 @@ async function main(args: any) { } catch (e) { console.log(`Failed to compile: ${ref}`); if (e.errors) { - e.errors.forEach((error) => { + for (const error of e.errors) { console.log(error.formattedMessage); - }); + } + + // e.errors.forEach((error) => { + // console.log(error.formattedMessage); + // }); } else { console.log(e); } @@ -157,7 +165,7 @@ const getImports = (fileRef: string) => (dependency: string) => { return { contents: sourceByReference[localRef] }; } base = path.dirname(base); - if (base == ".") { + if (base === ".") { continue; } } @@ -196,15 +204,18 @@ function compileSolidity( if (!result.contracts) { throw result; } - return Object.keys(result.contracts[filename]).reduce((p, contractName) => { - p[contractName] = { - byteCode: ("0x" + - result.contracts[filename][contractName].evm.bytecode.object) as `0x${string}`, - contract: result.contracts[filename][contractName], - sourceCode: contractContent, - }; - return p; - }, {} as { [name: string]: CompiledContract }); + return Object.keys(result.contracts[filename]).reduce( + (p, contractName) => { + p[contractName] = { + byteCode: ("0x" + + result.contracts[filename][contractName].evm.bytecode.object) as `0x${string}`, + contract: result.contracts[filename][contractName], + sourceCode: contractContent, + }; + return p; + }, + {} as { [name: string]: CompiledContract } + ); } // Shouldn't be run concurrently with the same 'name' diff --git a/test/scripts/fast-execute-chopstick-proposal.ts b/test/scripts/fast-execute-chopstick-proposal.ts index 7a92eb49..1d85389e 100644 --- a/test/scripts/fast-execute-chopstick-proposal.ts +++ b/test/scripts/fast-execute-chopstick-proposal.ts @@ -207,7 +207,7 @@ const main = async () => { } const callData = api.createType("Call", call.asInline.toHex()); return ( - callData.method == "nudgeReferendum" && (callData.args[0] as any).toNumber() == proposalIndex + callData.method === "nudgeReferendum" && (callData.args[0] as any).toNumber() === proposalIndex ); }); @@ -224,7 +224,7 @@ const main = async () => { (await api.rpc.chain.getHeader()).number.toNumber() + 2 )}` ); - await moveScheduledCallTo(api, 1, (call) => call.isLookup && call.asLookup.toHex() == callHash); + await moveScheduledCallTo(api, 1, (call) => call.isLookup && call.asLookup.toHex() === callHash); console.log( `${chalk.yellow("Fast forward")} ${chalk.green(1)} to #${chalk.green(