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:
parent
e253e4c0bb
commit
36a77c0d0b
@ -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(
|
||||||
|
@ -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>
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user