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 {}
|
||||
|
||||
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(
|
||||
|
@ -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>
|
||||
}
|
||||
|
@ -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
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user