Skip to content

Commit b0c8af0

Browse files
fix: bad dealId naming (#531)
1 parent 543a548 commit b0c8af0

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

packages/sdk/src/lib/dataProtectorCore/processProtectedData.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -373,26 +373,26 @@ export const processProtectedData = async <
373373
...(vVoucherOwner ? { voucherAddress: userVoucher?.address } : {}),
374374
};
375375

376-
const { dealid, txHash } = await iexec.order.matchOrders(
376+
const { dealid: dealId, txHash } = await iexec.order.matchOrders(
377377
orders,
378378
matchOptions
379379
);
380-
const taskId = await iexec.deal.computeTaskId(dealid, 0);
380+
const taskId = await iexec.deal.computeTaskId(dealId, 0);
381381

382382
vOnStatusUpdate({
383383
title: 'REQUEST_TO_PROCESS_PROTECTED_DATA',
384384
isDone: true,
385385
payload: {
386-
txHash: txHash,
387-
dealId: dealid,
388-
taskId: taskId,
386+
txHash,
387+
dealId,
388+
taskId,
389389
},
390390
});
391391

392392
if (vWaitForResult === false) {
393393
return {
394-
txHash: txHash,
395-
dealId: dealid,
394+
txHash,
395+
dealId,
396396
taskId,
397397
...(privateKey ? { pemPrivateKey: privateKey } : {}),
398398
} as ProcessProtectedDataResponse<Params>;
@@ -408,15 +408,15 @@ export const processProtectedData = async <
408408

409409
await waitForTaskCompletion({
410410
iexec,
411-
dealid,
411+
dealId,
412412
taskId,
413413
});
414414

415415
vOnStatusUpdate({
416416
title: 'CONSUME_TASK',
417417
isDone: true,
418418
payload: {
419-
taskId: taskId,
419+
taskId,
420420
},
421421
});
422422

@@ -429,8 +429,8 @@ export const processProtectedData = async <
429429
});
430430

431431
return {
432-
txHash: txHash,
433-
dealId: dealid,
432+
txHash,
433+
dealId,
434434
taskId,
435435
result,
436436
...(privateKey ? { pemPrivateKey: privateKey } : {}),

packages/sdk/src/lib/dataProtectorCore/waitForTaskCompletion.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { IExecConsumer } from '../types/internalTypes.js';
1414

1515
export const waitForTaskCompletion = async ({
1616
iexec = throwIfMissing(),
17-
dealid,
17+
dealId,
1818
taskId,
1919
onStatusUpdate = () => {},
2020
}: IExecConsumer &
@@ -26,7 +26,7 @@ export const waitForTaskCompletion = async ({
2626
const vDealId = taskIdSchema()
2727
.required()
2828
.label('dealId')
29-
.validateSync(dealid);
29+
.validateSync(dealId);
3030
const vOnStatusUpdate =
3131
validateOnStatusUpdateCallback<
3232
OnStatusUpdateFn<WaitForTaskCompletionStatuses>

packages/sdk/src/lib/types/coreTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ export type WaitForTaskCompletionStatuses = 'TASK_UPDATED';
214214

215215
export type WaitForTaskCompletionParams = {
216216
taskId: string;
217-
dealid: string;
217+
dealId: string;
218218
onStatusUpdate?: OnStatusUpdateFn<WaitForTaskCompletionStatuses>;
219219
};
220220

packages/sdk/tests/e2e/dataProtectorCore/waitForTaskCompletion.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('dataProtectorCore.waitForTaskCompletion()', () => {
2020
const COMPLETED_DEALID =
2121
'0xb5091be0385c80545cdd12e7c678b96dbb6338cf699324f8f2aa94d3f33f6eda';
2222
const res = await dataProtectorCore.waitForTaskCompletion({
23-
dealid: COMPLETED_DEALID,
23+
dealId: COMPLETED_DEALID,
2424
taskId: COMPLETED_TASKID,
2525
onStatusUpdate,
2626
});
@@ -43,7 +43,7 @@ describe('dataProtectorCore.waitForTaskCompletion()', () => {
4343
'0xd613b7c6c4a022efe129fd93ce547eba71fc1055e0b42d20b11ad1f3505ad0a5';
4444
const onStatusUpdate = jest.fn();
4545
const res = await dataProtectorCore.waitForTaskCompletion({
46-
dealid: FAILED_DEALID,
46+
dealId: FAILED_DEALID,
4747
taskId: FAILED_TASKID,
4848
onStatusUpdate,
4949
});
@@ -66,7 +66,7 @@ describe('dataProtectorCore.waitForTaskCompletion()', () => {
6666
'0xab15a51de7a3829fca1d3666b81b53e9e9ced0aa71bf20e7ebee1be1bdb3ee33';
6767
const onStatusUpdate = jest.fn();
6868
const res = await dataProtectorCore.waitForTaskCompletion({
69-
dealid: TIMEOUT_DEALID,
69+
dealId: TIMEOUT_DEALID,
7070
taskId: TIMEOUT_TASKID,
7171
onStatusUpdate,
7272
});

0 commit comments

Comments
 (0)