1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00

fix passing algo metadata to OceanCompute.start()

This commit is contained in:
Klaudiusz Dembler 2020-03-16 12:52:20 +01:00
parent 13c5498c84
commit 418e2fadb2
No known key found for this signature in database
GPG Key ID: 14B9FB649EE34C35
3 changed files with 7 additions and 5 deletions

View File

@ -1,4 +1,4 @@
import { File, MetaData } from '../ddo/MetaData' import { File, MetaDataAlgorithm } from '../ddo/MetaData'
import Account from '../ocean/Account' import Account from '../ocean/Account'
import { noZeroX } from '../utils' import { noZeroX } from '../utils'
import { Instantiable, InstantiableConfig } from '../Instantiable.abstract' import { Instantiable, InstantiableConfig } from '../Instantiable.abstract'
@ -115,7 +115,7 @@ export class Brizo extends Instantiable {
serviceAgreementId: string, serviceAgreementId: string,
consumerAccount: Account, consumerAccount: Account,
algorithmDid?: string, algorithmDid?: string,
algorithmMeta?: MetaData, algorithmMeta?: MetaDataAlgorithm,
jobId?: string, jobId?: string,
output?: Output output?: Output
): Promise<ComputeJob | ComputeJob[]> { ): Promise<ComputeJob | ComputeJob[]> {
@ -138,7 +138,7 @@ export class Brizo extends Instantiable {
url += `&consumerAddress=${address}` url += `&consumerAddress=${address}`
url += `&serviceAgreementId=${noZeroX(serviceAgreementId)}` url += `&serviceAgreementId=${noZeroX(serviceAgreementId)}`
url += (algorithmDid && `&algorithmDid=${algorithmDid}`) || '' url += (algorithmDid && `&algorithmDid=${algorithmDid}`) || ''
url += (algorithmMeta && `&algorithmMeta=${algorithmMeta}`) || '' url += (algorithmMeta && `&algorithmMeta=${JSON.stringify(algorithmMeta)}`) || ''
url += (output && `&output=${JSON.stringify(output)}`) || '' url += (output && `&output=${JSON.stringify(output)}`) || ''
url += (jobId && `&jobId=${jobId}`) || '' url += (jobId && `&jobId=${jobId}`) || ''

View File

@ -64,6 +64,8 @@ export interface File {
} }
export interface MetaDataAlgorithm { export interface MetaDataAlgorithm {
url?: string
rawcode?: string
language?: string language?: string
format?: string format?: string
version?: string version?: string

View File

@ -1,5 +1,5 @@
import { Instantiable, InstantiableConfig } from '../Instantiable.abstract' import { Instantiable, InstantiableConfig } from '../Instantiable.abstract'
import { MetaData } from '../ddo/MetaData' import { MetaData, MetaDataAlgorithm } from '../ddo/MetaData'
import Account from './Account' import Account from './Account'
import { DDO } from '../ddo/DDO' import { DDO } from '../ddo/DDO'
import { SubscribablePromise } from '../utils' import { SubscribablePromise } from '../utils'
@ -132,7 +132,7 @@ export class OceanCompute extends Instantiable {
consumerAccount: Account, consumerAccount: Account,
agreementId: string, agreementId: string,
algorithmDid?: string, algorithmDid?: string,
algorithmMeta?: MetaData, algorithmMeta?: MetaDataAlgorithm,
output?: Output output?: Output
): Promise<ComputeJob> { ): Promise<ComputeJob> {
output = this.checkOutput(consumerAccount, output) output = this.checkOutput(consumerAccount, output)