From 01cd1f9b01e61425ac714993658ba34269793e90 Mon Sep 17 00:00:00 2001 From: Igor Papandinas Date: Thu, 14 Mar 2024 21:46:38 +0400 Subject: [PATCH] chore: rename check file --- src/commands/clear/index.ts | 2 +- src/commands/contract/compile.ts | 2 +- src/commands/contract/deploy.ts | 2 +- src/commands/contract/explain.ts | 2 +- src/commands/contract/test.ts | 2 +- src/commands/contract/verify.ts | 2 +- src/commands/generate/tests.ts | 2 +- src/commands/generate/types.ts | 2 +- src/lib/{ensureChecks.ts => checks.ts} | 0 src/lib/contractCall.ts | 5 ++--- 10 files changed, 10 insertions(+), 11 deletions(-) rename src/lib/{ensureChecks.ts => checks.ts} (100%) diff --git a/src/commands/clear/index.ts b/src/commands/clear/index.ts index 7f05adee..67b15d2e 100644 --- a/src/commands/clear/index.ts +++ b/src/commands/clear/index.ts @@ -3,7 +3,7 @@ import { FileError } from "../../lib/errors.js"; import fs from "fs-extra"; import path from "node:path"; import { Args, Flags } from "@oclif/core"; -import { ensureContractNameOrAllFlagIsSet } from "../../lib/ensureChecks.js"; +import { ensureContractNameOrAllFlagIsSet } from "../../lib/checks.js"; interface Folder { name: string, diff --git a/src/commands/contract/compile.ts b/src/commands/contract/compile.ts index 8631aa09..b0732c83 100644 --- a/src/commands/contract/compile.ts +++ b/src/commands/contract/compile.ts @@ -12,7 +12,7 @@ import { import { InputError, ProcessError } from "../../lib/errors.js"; import { BuildMode, SwankyConfig } from "../../index.js"; import { ConfigBuilder } from "../../lib/config-builder.js"; -import { ensureContractNameOrAllFlagIsSet, ensureContractPathExists } from "../../lib/ensureChecks.js"; +import { ensureContractNameOrAllFlagIsSet, ensureContractPathExists } from "../../lib/checks.js"; export class CompileContract extends SwankyCommand { static description = "Compile the smart contract(s) in your contracts directory"; diff --git a/src/commands/contract/deploy.ts b/src/commands/contract/deploy.ts index ce19a086..7a2e32df 100644 --- a/src/commands/contract/deploy.ts +++ b/src/commands/contract/deploy.ts @@ -16,7 +16,7 @@ import chalk from "chalk"; import { SwankyCommand } from "../../lib/swankyCommand.js"; import { ApiError, ProcessError } from "../../lib/errors.js"; import { ConfigBuilder } from "../../lib/config-builder.js"; -import { contractFromRecord, ensureArtifactsExist, ensureDevAccountNotInProduction } from "../../lib/ensureChecks.js"; +import { contractFromRecord, ensureArtifactsExist, ensureDevAccountNotInProduction } from "../../lib/checks.js"; export class DeployContract extends SwankyCommand { static description = "Deploy contract to a running node"; diff --git a/src/commands/contract/explain.ts b/src/commands/contract/explain.ts index 2e1c1790..03c6d614 100644 --- a/src/commands/contract/explain.ts +++ b/src/commands/contract/explain.ts @@ -1,7 +1,7 @@ import { SwankyCommand } from "../../lib/swankyCommand.js"; import { Args } from "@oclif/core"; import { findContractRecord } from "../../lib/index.js"; -import { contractFromRecord, ensureArtifactsExist } from "../../lib/ensureChecks.js"; +import { contractFromRecord, ensureArtifactsExist } from "../../lib/checks.js"; export class ExplainContract extends SwankyCommand { static description = "Explain contract messages based on the contracts' metadata"; diff --git a/src/commands/contract/test.ts b/src/commands/contract/test.ts index 9cffb08e..eb61895b 100644 --- a/src/commands/contract/test.ts +++ b/src/commands/contract/test.ts @@ -14,7 +14,7 @@ import { ensureArtifactsExist, ensureContractNameOrAllFlagIsSet, ensureTypedContractExists, -} from "../../lib/ensureChecks.js"; +} from "../../lib/checks.js"; declare global { var contractTypesPath: string; // eslint-disable-line no-var diff --git a/src/commands/contract/verify.ts b/src/commands/contract/verify.ts index b71cdbbb..4bb47047 100644 --- a/src/commands/contract/verify.ts +++ b/src/commands/contract/verify.ts @@ -11,7 +11,7 @@ import { InputError, ProcessError } from "../../lib/errors.js"; import { spawn } from "node:child_process"; import { ConfigBuilder } from "../../lib/config-builder.js"; import { BuildData, SwankyConfig } from "../../index.js"; -import { ensureContractNameOrAllFlagIsSet, ensureContractPathExists } from "../../lib/ensureChecks.js"; +import { ensureContractNameOrAllFlagIsSet, ensureContractPathExists } from "../../lib/checks.js"; export class VerifyContract extends SwankyCommand { static description = "Verify the smart contract(s) in your contracts directory"; diff --git a/src/commands/generate/tests.ts b/src/commands/generate/tests.ts index 1414709e..0c9a7b04 100644 --- a/src/commands/generate/tests.ts +++ b/src/commands/generate/tests.ts @@ -7,7 +7,7 @@ import { existsSync } from "node:fs"; import inquirer from "inquirer"; import { kebabCase, pascalCase } from "change-case"; import { TestType } from "../../index.js"; -import { contractFromRecord, ensureArtifactsExist } from "../../lib/ensureChecks.js"; +import { contractFromRecord, ensureArtifactsExist } from "../../lib/checks.js"; export class GenerateTests extends SwankyCommand { static description = "Generate test files for the specified contract"; diff --git a/src/commands/generate/types.ts b/src/commands/generate/types.ts index 09bec2ea..746eb622 100644 --- a/src/commands/generate/types.ts +++ b/src/commands/generate/types.ts @@ -1,7 +1,7 @@ import { Args } from "@oclif/core"; import { findContractRecord, generateTypes } from "../../lib/index.js"; import { SwankyCommand } from "../../lib/swankyCommand.js"; -import { contractFromRecord, ensureArtifactsExist } from "../../lib/ensureChecks.js"; +import { contractFromRecord, ensureArtifactsExist } from "../../lib/checks.js"; export class GenerateTypes extends SwankyCommand { static description = "Generate types from compiled contract metadata"; diff --git a/src/lib/ensureChecks.ts b/src/lib/checks.ts similarity index 100% rename from src/lib/ensureChecks.ts rename to src/lib/checks.ts diff --git a/src/lib/contractCall.ts b/src/lib/contractCall.ts index 5613a97f..b42c0ae1 100644 --- a/src/lib/contractCall.ts +++ b/src/lib/contractCall.ts @@ -14,9 +14,8 @@ import inquirer from "inquirer"; import chalk from "chalk"; import { SwankyCommand } from "./swankyCommand.js"; import { cryptoWaitReady } from "@polkadot/util-crypto/crypto"; -import { Contract } from "./contract.js"; -import { ConfigError, FileError, NetworkError } from "./errors.js"; -import { contractFromRecord, ensureArtifactsExist, ensureDevAccountNotInProduction } from "./ensureChecks.js"; +import { NetworkError } from "./errors.js"; +import { contractFromRecord, ensureArtifactsExist, ensureDevAccountNotInProduction } from "./checks.js"; export type JoinedFlagsType = Interfaces.InferredFlags< (typeof ContractCall)["baseFlags"] & T["flags"]