From f8ef12f8dcd3ce6580160a7c7af0347d32cd022f Mon Sep 17 00:00:00 2001 From: alexcos20 Date: Mon, 13 Jul 2020 02:51:17 -0700 Subject: [PATCH] add compute stop and fix job with algodid --- src/ocean/Compute.ts | 1 - src/provider/Provider.ts | 1 - test/integration/ComputeFlow.test.ts | 15 +++++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/ocean/Compute.ts b/src/ocean/Compute.ts index 173e71adc..0db5caf1f 100644 --- a/src/ocean/Compute.ts +++ b/src/ocean/Compute.ts @@ -64,7 +64,6 @@ export class Compute extends Instantiable { tokenAddress: string, consumerAccount: Account, algorithmDid?: string, - algorithmTokenAddress?: string, algorithmMeta?: MetadataAlgorithm, output?: Output, serviceIndex?: string, diff --git a/src/provider/Provider.ts b/src/provider/Provider.ts index 957d9c8f4..ddbec9034 100644 --- a/src/provider/Provider.ts +++ b/src/provider/Provider.ts @@ -192,7 +192,6 @@ export class Provider extends Instantiable { // 'algorithmDataToken': alg_data_token // switch fetch method - let fetch switch (method) { diff --git a/test/integration/ComputeFlow.test.ts b/test/integration/ComputeFlow.test.ts index 36cc4ec24..f48b57072 100644 --- a/test/integration/ComputeFlow.test.ts +++ b/test/integration/ComputeFlow.test.ts @@ -293,7 +293,6 @@ describe('Marketplace flow', () => { tokenAddress, bob, undefined, - undefined, algorithmMeta, output, computeService.index, @@ -312,7 +311,11 @@ describe('Marketplace flow', () => { const response = await ocean.compute.status(bob, undefined, undefined) assert(response.length > 0) }) - + it('Bob should stop compute job', async () => { + await ocean.compute.stop(bob, ddo.id, jobId) + const response = await ocean.compute.status(bob, ddo.id, jobId) + assert(response[0].stopreq === 1) + }) it('should not allow order the compute service with raw algo for dataset that does not allow raw algo', async () => { const service1 = datasetNoRawAlgo.findServiceByType('compute') assert(service1 !== null) @@ -372,18 +375,18 @@ describe('Marketplace flow', () => { tx.transactionHash, tokenAddress, bob, + algorithmAsset.id, undefined, - undefined, - algorithmMeta, output, computeService.index, computeService.type, - algoTx, - algorithmAsset.datatoken + algoTx.transactionHash, + algorithmAsset.dataToken ) jobId = response.jobId assert(response.status >= 10) }) + // it('Bob restarts compute job', async () => {}) // it('Bob gets outputs', async () => {}) })