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

update compute stop, document id is not needed, neither for operator service, neither used on signature check

This commit is contained in:
paulo-ocean 2024-06-25 16:47:42 +01:00
parent 7448a1246c
commit 5105a4fdad
2 changed files with 7 additions and 4 deletions

View File

@ -154,7 +154,7 @@ ___
### computeStop ### computeStop
**computeStop**(`did`, `consumerAddress`, `jobId`, `providerUri`, `signer`, `signal?`): `Promise`<[`ComputeJob`](../interfaces/ComputeJob.md) \| [`ComputeJob`](../interfaces/ComputeJob.md)[]\> **computeStop**(`did`, `consumerAddress`, `jobId`, `providerUri`, `signer`, `signal?`, `agreementId?`): `Promise`<[`ComputeJob`](../interfaces/ComputeJob.md) \| [`ComputeJob`](../interfaces/ComputeJob.md)[]\>
Instruct the provider to Stop the execution of a to stop a compute job. Instruct the provider to Stop the execution of a to stop a compute job.
@ -168,6 +168,7 @@ Instruct the provider to Stop the execution of a to stop a compute job.
| `providerUri` | `string` | The provider URI. | | `providerUri` | `string` | The provider URI. |
| `signer` | `Signer` | The consumer signer object. | | `signer` | `Signer` | The consumer signer object. |
| `signal?` | `AbortSignal` | abort signal | | `signal?` | `AbortSignal` | abort signal |
| `agreementId?` | `string` | service agreement id |
#### Returns #### Returns

View File

@ -620,6 +620,7 @@ export class Provider {
jobId: string, jobId: string,
providerUri: string, providerUri: string,
signer: Signer, signer: Signer,
agreementId?: string,
signal?: AbortSignal signal?: AbortSignal
): Promise<ComputeJob | ComputeJob[]> { ): Promise<ComputeJob | ComputeJob[]> {
const providerEndpoints = await this.getEndpoints(providerUri) const providerEndpoints = await this.getEndpoints(providerUri)
@ -643,12 +644,13 @@ export class Provider {
let signatureMessage = consumerAddress let signatureMessage = consumerAddress
signatureMessage += jobId || '' signatureMessage += jobId || ''
signatureMessage += (did && `${this.noZeroX(did)}`) || '' // On provider service we just check signature owner + jobId
signatureMessage += nonce // signatureMessage += (agreementId && `${this.noZeroX(agreementId)}`) || ''
// signatureMessage += nonce
const signature = await this.signProviderRequest(signer, signatureMessage) const signature = await this.signProviderRequest(signer, signatureMessage)
const payload = Object() const payload = Object()
payload.signature = signature payload.signature = signature
payload.documentId = this.noZeroX(did) payload.agreementId = this.noZeroX(agreementId)
payload.consumerAddress = consumerAddress payload.consumerAddress = consumerAddress
payload.nonce = nonce payload.nonce = nonce
if (jobId) payload.jobId = jobId if (jobId) payload.jobId = jobId