diff --git a/src/ocean/Ocean.ts b/src/ocean/Ocean.ts index e9a0a46..dd618f2 100644 --- a/src/ocean/Ocean.ts +++ b/src/ocean/Ocean.ts @@ -41,7 +41,10 @@ export class Ocean extends Instantiable { instance.keeper = await Keeper.getInstance(instanceConfig) instance.brizo = new Brizo(instanceConfig) - instance.aquarius = new Aquarius(instanceConfig.config.aquariusUri, instanceConfig.logger) + instance.aquarius = new Aquarius( + instanceConfig.config.aquariusUri, + instanceConfig.logger + ) instance.accounts = await OceanAccounts.getInstance(instanceConfig) instance.auth = await OceanAuth.getInstance(instanceConfig) diff --git a/src/ocean/utils/OceanUtils.ts b/src/ocean/utils/OceanUtils.ts index c285583..581398b 100644 --- a/src/ocean/utils/OceanUtils.ts +++ b/src/ocean/utils/OceanUtils.ts @@ -16,7 +16,11 @@ export class OceanUtils extends Instantiable { const instance = new OceanUtils() instance.setInstanceConfig(config) - instance.agreements = new ServiceAgreement(config.ocean, config.logger, config.web3) + instance.agreements = new ServiceAgreement( + config.ocean, + config.logger, + config.web3 + ) instance.signature = new SignatureUtils(config.web3, config.logger) instance.fetch = new WebServiceConnector(config.logger) diff --git a/src/ocean/utils/SignatureUtils.ts b/src/ocean/utils/SignatureUtils.ts index 3879f72..9da6072 100644 --- a/src/ocean/utils/SignatureUtils.ts +++ b/src/ocean/utils/SignatureUtils.ts @@ -3,11 +3,11 @@ import { Logger } from '../../utils' export class SignatureUtils { private web3: Web3 - private logger: Logger; - + private logger: Logger + constructor(web3: Web3, logger: Logger) { this.web3 = web3 - this.logger = logger; + this.logger = logger } public async signText( diff --git a/src/ocean/utils/WebServiceConnector.ts b/src/ocean/utils/WebServiceConnector.ts index a8a38e4..04c4f8f 100644 --- a/src/ocean/utils/WebServiceConnector.ts +++ b/src/ocean/utils/WebServiceConnector.ts @@ -1,17 +1,17 @@ import { BodyInit, RequestInit, Response } from 'node-fetch' import fs from 'fs' +import { Logger } from '../../utils' const fetch = require('node-fetch') import save = require('save-file') -import { Logger } from '../../utils' /** * Provides a common interface to web services. */ export class WebServiceConnector { - public logger: Logger; + public logger: Logger constructor(logger: Logger) { - this.logger = logger; + this.logger = logger } public post(url: string, payload: BodyInit): Promise { diff --git a/src/squid.ts b/src/squid.ts index 204fa5d..a665558 100644 --- a/src/squid.ts +++ b/src/squid.ts @@ -25,4 +25,15 @@ export { export { AgreementTemplate } from './keeper/contracts/templates' export { Condition, ConditionState } from './keeper/contracts/conditions' -export { Ocean, Account, Config, DID, Logger, Keeper, Aquarius, conditions, templates, utils } +export { + Ocean, + Account, + Config, + DID, + Logger, + Keeper, + Aquarius, + conditions, + templates, + utils +} diff --git a/test/aquarius/Aquarius.test.ts b/test/aquarius/Aquarius.test.ts index 7065de6..9dfd587 100644 --- a/test/aquarius/Aquarius.test.ts +++ b/test/aquarius/Aquarius.test.ts @@ -101,7 +101,7 @@ describe('Aquarius', () => { it('should query metadata by text with a new instance', async () => { const aquariusNew = new Aquarius(config.aquariusUri, new Logger()) spy.on(aquariusNew.fetch, 'get', () => reponsify(getResults([new DDO()]))) - + const result = await aquariusNew.queryMetadataByText(query) assert.typeOf(result.results, 'array') assert.lengthOf(result.results, 1)