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

fix tests

This commit is contained in:
alexcos20 2020-09-19 15:27:11 -07:00
parent 3f017924f7
commit 62f27b0157
2 changed files with 14 additions and 7 deletions

View File

@ -183,11 +183,16 @@ export class Compute extends Instantiable {
did?: string,
jobId?: string
): Promise<ComputeJob[]> {
let provider
if (did) {
const ddo = await this.ocean.assets.resolve(did)
const service = ddo.findServiceByType('compute')
const { serviceEndpoint } = service
const provider = new Provider(this.instanceConfig)
provider = new Provider(this.instanceConfig)
provider.setBaseUrl(serviceEndpoint)
} else {
provider = this.ocean.provider
}
const computeJobsList = await provider.compute(
'get',
did,

View File

@ -307,8 +307,10 @@ export class Provider extends Instantiable {
await fetch
.then((response: Response) => {
if (response.ok) {
try {
const params = response.json()
if (params) if (params['provider-address']) return true
} catch (e) {}
}
return false
})