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

linting fixes

This commit is contained in:
Matthias Kretschmann 2019-08-16 17:00:14 +02:00
parent e253e4c0bb
commit 36a77c0d0b
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 6 additions and 13 deletions

View File

@ -77,13 +77,9 @@ describe('Asset Owners', () => {
)
} catch {}
const accessService = ddo.findServiceByType('access')
const { index } = ddo.findServiceByType('access')
await ocean.assets.order(
ddo.id,
accessService.index,
account2
)
await ocean.assets.order(ddo.id, index, account2)
// Access granted
const { length: finalLength2 } = await ocean.assets.consumerAssets(

View File

@ -67,16 +67,12 @@ export class DDO {
* @param {number} Service index.
* @return {Service} Service.
*/
public findServiceById<T extends ServiceType>(
index: number
): Service<T> {
public findServiceById<T extends ServiceType>(index: number): Service<T> {
if (!index) {
throw new Error('index is not set')
}
const service = this.service.find(
s => s.index === index
)
const service = this.service.find(s => s.index === index)
return service as Service<T>
}

View File

@ -265,7 +265,8 @@ export class OceanAssets extends Instantiable {
} else {
const files = await this.ocean.secretStore.decrypt(
did,
ddo.findServiceByType('metadata').attributes.main.encryptedFiles,
ddo.findServiceByType('metadata').attributes.main
.encryptedFiles,
consumerAccount,
ddo.findServiceByType('authorization').serviceEndpoint
)