1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00

Fix lint errors.

This commit is contained in:
Jorge Shirai 2020-01-15 15:58:44 +01:00
parent e0f533b469
commit df1c4fafd7
No known key found for this signature in database
GPG Key ID: CC28B81AAFF7CD83
6 changed files with 28 additions and 10 deletions

View File

@ -41,7 +41,10 @@ export class Ocean extends Instantiable {
instance.keeper = await Keeper.getInstance(instanceConfig) instance.keeper = await Keeper.getInstance(instanceConfig)
instance.brizo = new Brizo(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.accounts = await OceanAccounts.getInstance(instanceConfig)
instance.auth = await OceanAuth.getInstance(instanceConfig) instance.auth = await OceanAuth.getInstance(instanceConfig)

View File

@ -16,7 +16,11 @@ export class OceanUtils extends Instantiable {
const instance = new OceanUtils() const instance = new OceanUtils()
instance.setInstanceConfig(config) 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.signature = new SignatureUtils(config.web3, config.logger)
instance.fetch = new WebServiceConnector(config.logger) instance.fetch = new WebServiceConnector(config.logger)

View File

@ -3,11 +3,11 @@ import { Logger } from '../../utils'
export class SignatureUtils { export class SignatureUtils {
private web3: Web3 private web3: Web3
private logger: Logger; private logger: Logger
constructor(web3: Web3, logger: Logger) { constructor(web3: Web3, logger: Logger) {
this.web3 = web3 this.web3 = web3
this.logger = logger; this.logger = logger
} }
public async signText( public async signText(

View File

@ -1,17 +1,17 @@
import { BodyInit, RequestInit, Response } from 'node-fetch' import { BodyInit, RequestInit, Response } from 'node-fetch'
import fs from 'fs' import fs from 'fs'
import { Logger } from '../../utils'
const fetch = require('node-fetch') const fetch = require('node-fetch')
import save = require('save-file') import save = require('save-file')
import { Logger } from '../../utils'
/** /**
* Provides a common interface to web services. * Provides a common interface to web services.
*/ */
export class WebServiceConnector { export class WebServiceConnector {
public logger: Logger; public logger: Logger
constructor(logger: Logger) { constructor(logger: Logger) {
this.logger = logger; this.logger = logger
} }
public post(url: string, payload: BodyInit): Promise<Response> { public post(url: string, payload: BodyInit): Promise<Response> {

View File

@ -25,4 +25,15 @@ export {
export { AgreementTemplate } from './keeper/contracts/templates' export { AgreementTemplate } from './keeper/contracts/templates'
export { Condition, ConditionState } from './keeper/contracts/conditions' 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
}

View File

@ -101,7 +101,7 @@ describe('Aquarius', () => {
it('should query metadata by text with a new instance', async () => { it('should query metadata by text with a new instance', async () => {
const aquariusNew = new Aquarius(config.aquariusUri, new Logger()) const aquariusNew = new Aquarius(config.aquariusUri, new Logger())
spy.on(aquariusNew.fetch, 'get', () => reponsify(getResults([new DDO()]))) spy.on(aquariusNew.fetch, 'get', () => reponsify(getResults([new DDO()])))
const result = await aquariusNew.queryMetadataByText(query) const result = await aquariusNew.queryMetadataByText(query)
assert.typeOf(result.results, 'array') assert.typeOf(result.results, 'array')
assert.lengthOf(result.results, 1) assert.lengthOf(result.results, 1)