diff --git a/src/aquarius/Aquarius.ts b/src/aquarius/Aquarius.ts index 3611a53..14d4fa0 100644 --- a/src/aquarius/Aquarius.ts +++ b/src/aquarius/Aquarius.ts @@ -261,8 +261,8 @@ export class Aquarius { return result } -/** - * Update Compute Privacy + /** + * Update Compute Privacy * @param {DID | string} did DID of the asset to update. * @param {number } serviceIndex Service index * @param {boolean} allowRawAlgorithm Allow Raw Algorithms diff --git a/src/ddo/Service.ts b/src/ddo/Service.ts index 64d2fc7..c2a7d78 100644 --- a/src/ddo/Service.ts +++ b/src/ddo/Service.ts @@ -25,13 +25,12 @@ export interface ServiceAccessAttributes extends ServiceCommonAttributes { timeout: number } } -export interface ServiceComputePrivacy{ - allowRawAlgorithm: boolean, - allowNetworkAccess: boolean, +export interface ServiceComputePrivacy { + allowRawAlgorithm: boolean + allowNetworkAccess: boolean trustedAlgorithms: string[] } - export interface ServiceComputeAttributes extends ServiceCommonAttributes { main: { creator: string diff --git a/src/ocean/OceanCompute.ts b/src/ocean/OceanCompute.ts index 48a488e..4299a85 100644 --- a/src/ocean/OceanCompute.ts +++ b/src/ocean/OceanCompute.ts @@ -272,7 +272,7 @@ export class OceanCompute extends Instantiable { const { templates } = this.ocean.keeper const serviceAgreementTemplate = await templates.escrowComputeExecutionTemplate.getServiceAgreementTemplate() const name = 'dataAssetComputingServiceAgreement' - let service={ + const service = { type: 'compute', index: 3, serviceEndpoint: this.ocean.brizo.getComputeEndpoint(), @@ -288,8 +288,7 @@ export class OceanCompute extends Instantiable { serviceAgreementTemplate } } - if (computePrivacy) - service['attributes']['main']['privacy'] = computePrivacy + if (computePrivacy) service.attributes.main.privacy = computePrivacy return service as ServiceCompute } } diff --git a/test/integration/ocean/AssetOwners.test.ts b/test/integration/ocean/AssetOwners.test.ts index a85c000..4074097 100644 --- a/test/integration/ocean/AssetOwners.test.ts +++ b/test/integration/ocean/AssetOwners.test.ts @@ -230,7 +230,7 @@ describe('Asset Owners', () => { let serviceIndex = null for (let index = 0; index < oldDDO.service.length; index++) { - if (oldDDO.service[index].type == 'compute') serviceIndex = index + if (oldDDO.service[index].type === 'compute') serviceIndex = index } await ocean.assets.updateComputePrivacy(