From a6c125d1df1bbfc7b54bcc33278968d838f93b1b Mon Sep 17 00:00:00 2001 From: Eric Lau Date: Thu, 19 Oct 2023 12:02:47 -0400 Subject: [PATCH] Lint --- packages/core/src/cli/cli.test.ts | 19 ++++++++++--------- .../cli/validate/validate-upgrade-safety.ts | 4 ++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/core/src/cli/cli.test.ts b/packages/core/src/cli/cli.test.ts index e65ca59e8..303bab822 100644 --- a/packages/core/src/cli/cli.test.ts +++ b/packages/core/src/cli/cli.test.ts @@ -185,12 +185,7 @@ test('validate - requireReference - no reference, no upgradesFrom', async t => { await fs.writeFile(path.join(temp, 'validate.json'), JSON.stringify(buildInfo)); const error = await t.throwsAsync(execAsync(`${CLI} validate ${temp} --contract StorageV1 --requireReference`)); - t.true( - error?.message.includes( - 'does not specify what contract it upgrades from', - ), - error?.message, - ); + t.true(error?.message.includes('does not specify what contract it upgrades from'), error?.message); }); test('validate - requireReference - no reference, has upgradesFrom - safe', async t => { @@ -198,7 +193,7 @@ test('validate - requireReference - no reference, has upgradesFrom - safe', asyn const buildInfo = await artifacts.getBuildInfo(`contracts/test/cli/Validate.sol:BecomesSafe`); await fs.writeFile(path.join(temp, 'validate.json'), JSON.stringify(buildInfo)); - const output = (await (execAsync(`${CLI} validate ${temp} --contract BecomesSafe --requireReference`))).stdout; + const output = (await execAsync(`${CLI} validate ${temp} --contract BecomesSafe --requireReference`)).stdout; t.snapshot(output); }); @@ -219,7 +214,9 @@ test('validate - requireReference - has reference - unsafe', async t => { const buildInfo = await artifacts.getBuildInfo(`contracts/test/cli/Validate.sol:StorageV2_Bad_NoAnnotation`); await fs.writeFile(path.join(temp, 'validate.json'), JSON.stringify(buildInfo)); - const error = await t.throwsAsync(execAsync(`${CLI} validate ${temp} --contract StorageV2_Bad_NoAnnotation --reference StorageV1 --requireReference`)); + const error = await t.throwsAsync( + execAsync(`${CLI} validate ${temp} --contract StorageV2_Bad_NoAnnotation --reference StorageV1 --requireReference`), + ); const expectation: string[] = [`Stdout: ${(error as any).stdout}`, `Stderr: ${(error as any).stderr}`]; t.snapshot(expectation.join('\n')); }); @@ -229,7 +226,11 @@ test('validate - requireReference - has reference - safe', async t => { const buildInfo = await artifacts.getBuildInfo(`contracts/test/cli/Validate.sol:StorageV2_Ok_NoAnnotation`); await fs.writeFile(path.join(temp, 'validate.json'), JSON.stringify(buildInfo)); - const output = (await (execAsync(`${CLI} validate ${temp} --contract StorageV2_Ok_NoAnnotation --reference StorageV1 --requireReference`))).stdout; + const output = ( + await execAsync( + `${CLI} validate ${temp} --contract StorageV2_Ok_NoAnnotation --reference StorageV1 --requireReference`, + ) + ).stdout; t.snapshot(output); }); diff --git a/packages/core/src/cli/validate/validate-upgrade-safety.ts b/packages/core/src/cli/validate/validate-upgrade-safety.ts index 6f5a55480..b54b1321f 100644 --- a/packages/core/src/cli/validate/validate-upgrade-safety.ts +++ b/packages/core/src/cli/validate/validate-upgrade-safety.ts @@ -11,7 +11,7 @@ import { SourceContract, validateBuildInfoContracts } from './validations'; */ export type ValidateUpgradeSafetyOptions = Omit & { requireReference?: boolean; -} +}; export type SpecifiedContracts = { contract: SourceContract; @@ -70,4 +70,4 @@ export function withCliDefaults(opts: ValidateUpgradeSafetyOptions): Required