|
1 | 1 | import { utils } from 'iexec'; |
| 2 | +import { NULL_ADDRESS } from 'iexec/utils'; |
2 | 3 | import { |
3 | 4 | MAX_DESIRED_APP_ORDER_PRICE, |
4 | 5 | MAX_DESIRED_WORKERPOOL_ORDER_PRICE, |
@@ -315,7 +316,7 @@ export const processBulkRequest = async ({ |
315 | 316 | .fetchWorkerpoolOrderbook({ |
316 | 317 | workerpool: vWorkerpool, |
317 | 318 | app: vApp, |
318 | | - dataset: 'any', // For bulk requests, we don't specify a specific dataset |
| 319 | + dataset: NULL_ADDRESS, // For bulk requests, we don't specify a specific dataset |
319 | 320 | requester: requester, |
320 | 321 | isRequesterStrict: useVoucher, |
321 | 322 | minTag: ['tee', 'scone'], |
@@ -372,25 +373,26 @@ export const processBulkRequest = async ({ |
372 | 373 | ...(vVoucherOwner ? { voucherAddress: userVoucher?.address } : {}), |
373 | 374 | }; |
374 | 375 |
|
375 | | - const { dealid, txHash } = await iexec.order.matchOrders( |
376 | | - orders, |
377 | | - matchOptions |
378 | | - ); |
| 376 | + const { |
| 377 | + dealid, |
| 378 | + txHash, |
| 379 | + volume: matchedVolume, |
| 380 | + } = await iexec.order.matchOrders(orders, matchOptions); |
379 | 381 |
|
380 | 382 | // Store the match results |
381 | 383 | allDealIds.push(dealid); |
382 | 384 | allTxHashes.push(txHash); |
383 | 385 |
|
384 | 386 | // Update remaining volume |
385 | | - remainingVolume -= matchVolume; |
| 387 | + remainingVolume -= matchedVolume.toNumber(); |
386 | 388 |
|
387 | 389 | vOnStatusUpdate({ |
388 | 390 | title: 'REQUEST_TO_PROCESS_BULK_DATA', |
389 | 391 | isDone: true, |
390 | 392 | payload: { |
391 | 393 | txHash: txHash, |
392 | 394 | dealId: dealid, |
393 | | - matchVolume, |
| 395 | + matchVolume: matchedVolume.toNumber(), |
394 | 396 | remainingVolume, |
395 | 397 | totalVolume: volume, |
396 | 398 | }, |
|
0 commit comments