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 {} } catch {}
const accessService = ddo.findServiceByType('access') const { index } = ddo.findServiceByType('access')
await ocean.assets.order( await ocean.assets.order(ddo.id, index, account2)
ddo.id,
accessService.index,
account2
)
// Access granted // Access granted
const { length: finalLength2 } = await ocean.assets.consumerAssets( const { length: finalLength2 } = await ocean.assets.consumerAssets(

View File

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

View File

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