1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00
This commit is contained in:
alexcos20 2020-05-09 22:20:40 +03:00
parent 59e2accf68
commit c4921d129b
4 changed files with 8 additions and 10 deletions

View File

@ -261,8 +261,8 @@ export class Aquarius {
return result return result
} }
/** /**
* Update Compute Privacy * Update Compute Privacy
* @param {DID | string} did DID of the asset to update. * @param {DID | string} did DID of the asset to update.
* @param {number } serviceIndex Service index * @param {number } serviceIndex Service index
* @param {boolean} allowRawAlgorithm Allow Raw Algorithms * @param {boolean} allowRawAlgorithm Allow Raw Algorithms

View File

@ -25,13 +25,12 @@ export interface ServiceAccessAttributes extends ServiceCommonAttributes {
timeout: number timeout: number
} }
} }
export interface ServiceComputePrivacy{ export interface ServiceComputePrivacy {
allowRawAlgorithm: boolean, allowRawAlgorithm: boolean
allowNetworkAccess: boolean, allowNetworkAccess: boolean
trustedAlgorithms: string[] trustedAlgorithms: string[]
} }
export interface ServiceComputeAttributes extends ServiceCommonAttributes { export interface ServiceComputeAttributes extends ServiceCommonAttributes {
main: { main: {
creator: string creator: string

View File

@ -272,7 +272,7 @@ export class OceanCompute extends Instantiable {
const { templates } = this.ocean.keeper const { templates } = this.ocean.keeper
const serviceAgreementTemplate = await templates.escrowComputeExecutionTemplate.getServiceAgreementTemplate() const serviceAgreementTemplate = await templates.escrowComputeExecutionTemplate.getServiceAgreementTemplate()
const name = 'dataAssetComputingServiceAgreement' const name = 'dataAssetComputingServiceAgreement'
let service={ const service = {
type: 'compute', type: 'compute',
index: 3, index: 3,
serviceEndpoint: this.ocean.brizo.getComputeEndpoint(), serviceEndpoint: this.ocean.brizo.getComputeEndpoint(),
@ -288,8 +288,7 @@ export class OceanCompute extends Instantiable {
serviceAgreementTemplate serviceAgreementTemplate
} }
} }
if (computePrivacy) if (computePrivacy) service.attributes.main.privacy = computePrivacy
service['attributes']['main']['privacy'] = computePrivacy
return service as ServiceCompute return service as ServiceCompute
} }
} }

View File

@ -230,7 +230,7 @@ describe('Asset Owners', () => {
let serviceIndex = null let serviceIndex = null
for (let index = 0; index < oldDDO.service.length; index++) { 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( await ocean.assets.updateComputePrivacy(