1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00

fixed lint errors

This commit is contained in:
Bogdan Fazakas 2021-06-08 14:06:23 +03:00
parent 200e0d8832
commit 0786c32a7b
5 changed files with 22 additions and 48 deletions

View File

@ -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
} {

View File

@ -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
}
}

View File

@ -150,14 +150,8 @@ export class ConfigHelper {
// use the defaults first
let configAddresses: Partial<ConfigHelperConfig>
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,

View File

@ -17,9 +17,7 @@ export class SubscribablePromise<T extends any, P extends any> {
setTimeout(() => this.init(executor), 1)
}
public subscribe(
onNext: (next: T) => void
): {
public subscribe(onNext: (next: T) => void): {
unsubscribe: () => boolean
} {
return this.observer.subscribe(onNext)

View File

@ -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)