mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
fix auth & tests
This commit is contained in:
parent
130c9d7938
commit
7de1b110b0
@ -121,10 +121,13 @@ export class Brizo extends Instantiable {
|
||||
): Promise<ComputeJob | ComputeJob[]> {
|
||||
const signature = await this.createSignature(consumerAccount, serviceAgreementId)
|
||||
const address = consumerAccount.getId()
|
||||
const serviceEndpoint = await this.getEndpointFromAgreement(
|
||||
'compute',
|
||||
serviceAgreementId
|
||||
)
|
||||
let serviceEndpoint
|
||||
if (serviceAgreementId)
|
||||
serviceEndpoint = await this.getEndpointFromAgreement(
|
||||
'compute',
|
||||
serviceAgreementId
|
||||
)
|
||||
else serviceEndpoint = await this.getComputeEndpoint()
|
||||
|
||||
if (!serviceEndpoint) {
|
||||
throw new Error(
|
||||
|
@ -33,6 +33,7 @@ describe('Compute', () => {
|
||||
let dataset: DDO
|
||||
let algorithm: DDO
|
||||
let computeService: ServiceCompute
|
||||
let jobId: string
|
||||
|
||||
before(async () => {
|
||||
ocean = await Ocean.getInstance(customConfig)
|
||||
@ -117,5 +118,18 @@ describe('Compute', () => {
|
||||
)
|
||||
|
||||
assert.equal(response.status, ComputeJobStatus.Started)
|
||||
jobId = response.jobId
|
||||
})
|
||||
|
||||
it('should get status of a compute job', async () => {
|
||||
const response = await ocean.compute.status(account, agreementId, jobId)
|
||||
|
||||
assert.equal(response[0].jobId, jobId)
|
||||
})
|
||||
|
||||
it('should get status of all compute jobs for an address', async () => {
|
||||
const response = await ocean.compute.status(account, undefined, undefined)
|
||||
|
||||
assert.isAbove(response.length, 0)
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user