Skip to content

Commit

Permalink
add compute stop and fix job with algodid
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcos20 committed Jul 13, 2020
1 parent 2deca53 commit f8ef12f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/ocean/Compute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ export class Compute extends Instantiable {
tokenAddress: string,
consumerAccount: Account,
algorithmDid?: string,
algorithmTokenAddress?: string,
algorithmMeta?: MetadataAlgorithm,
output?: Output,
serviceIndex?: string,
Expand Down
1 change: 0 additions & 1 deletion src/provider/Provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ export class Provider extends Instantiable {
// 'algorithmDataToken': alg_data_token

// switch fetch method

let fetch

switch (method) {
Expand Down
15 changes: 9 additions & 6 deletions test/integration/ComputeFlow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ describe('Marketplace flow', () => {
tokenAddress,
bob,
undefined,
undefined,
algorithmMeta,
output,
computeService.index,
Expand All @@ -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)
Expand Down Expand Up @@ -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 () => {})
})
Expand Down

0 comments on commit f8ef12f

Please sign in to comment.