From 66199000caf600fdd3c6110b89a42bb68c49cc57 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Mon, 13 Dec 2021 12:11:59 +0000 Subject: [PATCH] Fix lint errors Signed-off-by: James Taylor --- .../rest-api-typescript/src/errors.spec.ts | 31 ++++++++++--------- .../rest-api-typescript/src/index.ts | 4 +-- .../rest-api-typescript/src/jobs.spec.ts | 7 ++++- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/asset-transfer-basic/rest-api-typescript/src/errors.spec.ts b/asset-transfer-basic/rest-api-typescript/src/errors.spec.ts index 90f37a1c..ddf4c9f0 100644 --- a/asset-transfer-basic/rest-api-typescript/src/errors.spec.ts +++ b/asset-transfer-basic/rest-api-typescript/src/errors.spec.ts @@ -204,7 +204,10 @@ describe('Errors', () => { }); it('returns RetryAction.None for a TransactionNotFoundError', () => { - const mockTransactionNotFoundError = new TransactionNotFoundError('Failed to get transaction with id txn, error Entry not found in index', 'txn1'); + const mockTransactionNotFoundError = new TransactionNotFoundError( + 'Failed to get transaction with id txn, error Entry not found in index', + 'txn1' + ); expect(getRetryAction(mockTransactionNotFoundError)).toBe( RetryAction.None @@ -212,19 +215,21 @@ describe('Errors', () => { }); it('returns RetryAction.None for an AssetExistsError', () => { - const mockAssetExistsError = new AssetExistsError('The asset MOCK_ASSET already exists', 'txn1'); - - expect(getRetryAction(mockAssetExistsError)).toBe( - RetryAction.None + const mockAssetExistsError = new AssetExistsError( + 'The asset MOCK_ASSET already exists', + 'txn1' ); + + expect(getRetryAction(mockAssetExistsError)).toBe(RetryAction.None); }); it('returns RetryAction.None for an AssetNotFoundError', () => { - const mockAssetNotFoundError = new AssetNotFoundError('the asset MOCK_ASSET does not exist', 'txn1'); - - expect(getRetryAction(mockAssetNotFoundError)).toBe( - RetryAction.None + const mockAssetNotFoundError = new AssetNotFoundError( + 'the asset MOCK_ASSET does not exist', + 'txn1' ); + + expect(getRetryAction(mockAssetNotFoundError)).toBe(RetryAction.None); }); it('returns RetryAction.WithExistingTransactionId for a TimeoutError', () => { @@ -247,17 +252,13 @@ describe('Errors', () => { it('returns RetryAction.WithNewTransactionId for an Error', () => { const mockError = new Error('MOCK ERROR'); - expect(getRetryAction(mockError)).toBe( - RetryAction.WithNewTransactionId - ); + expect(getRetryAction(mockError)).toBe(RetryAction.WithNewTransactionId); }); it('returns RetryAction.WithNewTransactionId for a string error', () => { const mockError = 'MOCK ERROR'; - expect(getRetryAction(mockError)).toBe( - RetryAction.WithNewTransactionId - ); + expect(getRetryAction(mockError)).toBe(RetryAction.WithNewTransactionId); }); }); diff --git a/asset-transfer-basic/rest-api-typescript/src/index.ts b/asset-transfer-basic/rest-api-typescript/src/index.ts index 1e222713..e033db4c 100644 --- a/asset-transfer-basic/rest-api-typescript/src/index.ts +++ b/asset-transfer-basic/rest-api-typescript/src/index.ts @@ -12,10 +12,10 @@ * Fabric transaction error handling and retry logic * - fabric.ts * all the sample code which interacts with the Fabric SDK - * + * * The remaining files are related to the REST server aspects of the sample, * rather than Fabric itself: - * + * * - *.router.ts * details of the REST endpoints provided by the sample * - auth.ts diff --git a/asset-transfer-basic/rest-api-typescript/src/jobs.spec.ts b/asset-transfer-basic/rest-api-typescript/src/jobs.spec.ts index 43ba4d6d..e0a60fa7 100644 --- a/asset-transfer-basic/rest-api-typescript/src/jobs.spec.ts +++ b/asset-transfer-basic/rest-api-typescript/src/jobs.spec.ts @@ -3,7 +3,12 @@ */ import { Job, Queue } from 'bullmq'; -import { getJobCounts, getJobSummary, processSubmitTransactionJob, JobNotFoundError } from './jobs'; +import { + getJobCounts, + getJobSummary, + processSubmitTransactionJob, + JobNotFoundError, +} from './jobs'; import { Contract, Transaction } from 'fabric-network'; import { mock, MockProxy } from 'jest-mock-extended';