From 0786c32a7b3390f0165666c0fea039cb6652925f Mon Sep 17 00:00:00 2001 From: Bogdan Fazakas Date: Tue, 8 Jun 2021 14:06:23 +0300 Subject: [PATCH] fixed lint errors --- src/datatokens/Datatokens.ts | 5 +---- src/ocean/Compute.ts | 18 ++++++++---------- src/utils/ConfigHelper.ts | 20 ++++---------------- src/utils/SubscribablePromise.ts | 4 +--- test/integration/ComputeFlow.test.ts | 23 ++++++++--------------- 5 files changed, 22 insertions(+), 48 deletions(-) diff --git a/src/datatokens/Datatokens.ts b/src/datatokens/Datatokens.ts index 1fd3ac39..bd625424 100644 --- a/src/datatokens/Datatokens.ts +++ b/src/datatokens/Datatokens.ts @@ -47,10 +47,7 @@ export class DataTokens { * Generate new datatoken name & symbol from a word list * @return {<{ name: String; symbol: String }>} datatoken name & symbol. Produces e.g. "Endemic Jellyfish Token" & "ENDJEL-45" */ - public generateDtName(wordList?: { - nouns: string[] - adjectives: string[] - }): { + public generateDtName(wordList?: { nouns: string[]; adjectives: string[] }): { name: string symbol: string } { diff --git a/src/ocean/Compute.ts b/src/ocean/Compute.ts index d6158d3e..fd5b48d4 100644 --- a/src/ocean/Compute.ts +++ b/src/ocean/Compute.ts @@ -641,9 +641,8 @@ export class Compute extends Instantiable { } if (typeof ddo.service[serviceIndex] === 'undefined') return null if (ddo.service[serviceIndex].type !== 'compute') return null - ddo.service[ - serviceIndex - ].attributes.main.privacy.allowAllPublishedAlgorithms = newState + ddo.service[serviceIndex].attributes.main.privacy.allowAllPublishedAlgorithms = + newState return ddo } @@ -758,13 +757,12 @@ export class Compute extends Instantiable { if (ddo.service[serviceIndex].type !== 'compute') return ddo if (!ddo.service[serviceIndex].attributes.main.privacy.publisherTrustedAlgorithms) return ddo - ddo.service[ - serviceIndex - ].attributes.main.privacy.publisherTrustedAlgorithms = ddo.service[ - serviceIndex - ].attributes.main.privacy.publisherTrustedAlgorithms.filter(function (el) { - return el.did !== algoDid - }) + ddo.service[serviceIndex].attributes.main.privacy.publisherTrustedAlgorithms = + ddo.service[serviceIndex].attributes.main.privacy.publisherTrustedAlgorithms.filter( + function (el) { + return el.did !== algoDid + } + ) return ddo } } diff --git a/src/utils/ConfigHelper.ts b/src/utils/ConfigHelper.ts index 05db7929..c9193c51 100644 --- a/src/utils/ConfigHelper.ts +++ b/src/utils/ConfigHelper.ts @@ -150,14 +150,8 @@ export class ConfigHelper { // use the defaults first let configAddresses: Partial if (DefaultContractsAddresses[network]) { - const { - DTFactory, - BFactory, - FixedRateExchange, - Dispenser, - Metadata, - Ocean - } = DefaultContractsAddresses[network] + const { DTFactory, BFactory, FixedRateExchange, Dispenser, Metadata, Ocean } = + DefaultContractsAddresses[network] configAddresses = { factoryAddress: DTFactory, poolFactoryAddress: BFactory, @@ -178,14 +172,8 @@ export class ConfigHelper { 'utf8' ) ) - const { - DTFactory, - BFactory, - FixedRateExchange, - Dispenser, - Metadata, - Ocean - } = data[network] + const { DTFactory, BFactory, FixedRateExchange, Dispenser, Metadata, Ocean } = + data[network] configAddresses = { factoryAddress: DTFactory, poolFactoryAddress: BFactory, diff --git a/src/utils/SubscribablePromise.ts b/src/utils/SubscribablePromise.ts index 3e0c8fe0..5a72e618 100644 --- a/src/utils/SubscribablePromise.ts +++ b/src/utils/SubscribablePromise.ts @@ -17,9 +17,7 @@ export class SubscribablePromise { setTimeout(() => this.init(executor), 1) } - public subscribe( - onNext: (next: T) => void - ): { + public subscribe(onNext: (next: T) => void): { unsubscribe: () => boolean } { return this.observer.subscribe(onNext) diff --git a/test/integration/ComputeFlow.test.ts b/test/integration/ComputeFlow.test.ts index f58263ef..6535c6d5 100644 --- a/test/integration/ComputeFlow.test.ts +++ b/test/integration/ComputeFlow.test.ts @@ -104,8 +104,7 @@ describe('Compute flow', () => { language: 'js', format: 'docker-image', version: '0.1', - url: - 'https://raw.githubusercontent.com/oceanprotocol/test-algorithm/master/javascript/algo.js', + url: 'https://raw.githubusercontent.com/oceanprotocol/test-algorithm/master/javascript/algo.js', container: { entrypoint: 'node $ALGO', image: 'node', @@ -250,8 +249,7 @@ describe('Compute flow', () => { license: 'CC-BY', files: [ { - url: - 'https://raw.githubusercontent.com/tbertinmahieux/MSongsDB/master/Tasks_Demos/CoverSongs/shs_dataset_test.txt', + url: 'https://raw.githubusercontent.com/tbertinmahieux/MSongsDB/master/Tasks_Demos/CoverSongs/shs_dataset_test.txt', checksum: 'efb2c764274b745f5fc37f97c6b0e764', contentLength: '4535431', contentType: 'text/csv', @@ -487,8 +485,7 @@ describe('Compute flow', () => { license: 'CC-BY', files: [ { - url: - 'https://raw.githubusercontent.com/oceanprotocol/test-algorithm/master/javascript/algo.js', + url: 'https://raw.githubusercontent.com/oceanprotocol/test-algorithm/master/javascript/algo.js', contentType: 'text/js', encoding: 'UTF-8' } @@ -540,8 +537,7 @@ describe('Compute flow', () => { license: 'CC-BY', files: [ { - url: - 'https://raw.githubusercontent.com/oceanprotocol/test-algorithm/master/javascript/algo.js', + url: 'https://raw.githubusercontent.com/oceanprotocol/test-algorithm/master/javascript/algo.js', contentType: 'text/js', encoding: 'UTF-8' } @@ -602,8 +598,7 @@ describe('Compute flow', () => { license: 'CC-BY', files: [ { - url: - 'https://raw.githubusercontent.com/oceanprotocol/test-algorithm/master/javascript/algo.js', + url: 'https://raw.githubusercontent.com/oceanprotocol/test-algorithm/master/javascript/algo.js', contentType: 'text/js', encoding: 'UTF-8' } @@ -667,8 +662,7 @@ describe('Compute flow', () => { license: 'CC-BY', files: [ { - url: - 'https://raw.githubusercontent.com/oceanprotocol/test-algorithm/master/javascript/algo.js', + url: 'https://raw.githubusercontent.com/oceanprotocol/test-algorithm/master/javascript/algo.js', contentType: 'text/js', encoding: 'UTF-8' } @@ -1089,9 +1083,8 @@ describe('Compute flow', () => { algorithmAssetRemoteProviderWithCompute != null, 'algorithmAsset should not be null' ) - const serviceAlgo = algorithmAssetRemoteProviderWithCompute.findServiceByType( - 'compute' - ) + const serviceAlgo = + algorithmAssetRemoteProviderWithCompute.findServiceByType('compute') assert(serviceAlgo != null, 'serviceAlgo should not be null') // get the compute address first computeAddress = await ocean.compute.getComputeAddress(ddo.id, computeService.index)