1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00

add compute stop and fix job with algodid

This commit is contained in:
alexcos20 2020-07-13 02:51:17 -07:00
parent 2deca53cc7
commit f8ef12f8dc
3 changed files with 9 additions and 8 deletions

View File

@ -64,7 +64,6 @@ export class Compute extends Instantiable {
tokenAddress: string, tokenAddress: string,
consumerAccount: Account, consumerAccount: Account,
algorithmDid?: string, algorithmDid?: string,
algorithmTokenAddress?: string,
algorithmMeta?: MetadataAlgorithm, algorithmMeta?: MetadataAlgorithm,
output?: Output, output?: Output,
serviceIndex?: string, serviceIndex?: string,

View File

@ -192,7 +192,6 @@ export class Provider extends Instantiable {
// 'algorithmDataToken': alg_data_token // 'algorithmDataToken': alg_data_token
// switch fetch method // switch fetch method
let fetch let fetch
switch (method) { switch (method) {

View File

@ -293,7 +293,6 @@ describe('Marketplace flow', () => {
tokenAddress, tokenAddress,
bob, bob,
undefined, undefined,
undefined,
algorithmMeta, algorithmMeta,
output, output,
computeService.index, computeService.index,
@ -312,7 +311,11 @@ describe('Marketplace flow', () => {
const response = await ocean.compute.status(bob, undefined, undefined) const response = await ocean.compute.status(bob, undefined, undefined)
assert(response.length > 0) 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 () => { 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') const service1 = datasetNoRawAlgo.findServiceByType('compute')
assert(service1 !== null) assert(service1 !== null)
@ -372,18 +375,18 @@ describe('Marketplace flow', () => {
tx.transactionHash, tx.transactionHash,
tokenAddress, tokenAddress,
bob, bob,
algorithmAsset.id,
undefined, undefined,
undefined,
algorithmMeta,
output, output,
computeService.index, computeService.index,
computeService.type, computeService.type,
algoTx, algoTx.transactionHash,
algorithmAsset.datatoken algorithmAsset.dataToken
) )
jobId = response.jobId jobId = response.jobId
assert(response.status >= 10) assert(response.status >= 10)
}) })
// it('Bob restarts compute job', async () => {}) // it('Bob restarts compute job', async () => {})
// it('Bob gets outputs', async () => {}) // it('Bob gets outputs', async () => {})
}) })