You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// but account has no enough funds to process the data (less than workerpoolprice)
441
+
awaitiexec.account.deposit(1*10e9);
442
+
443
+
letcaughtError: Error|undefined;
444
+
try{
445
+
awaitprocessProtectedData({
446
+
iexec,
447
+
protectedData: protectedData.address,
448
+
app: appAddress,
449
+
defaultWorkerpool: payableWorkerpoolAddress,
450
+
workerpool: payableWorkerpoolAddress,
451
+
workerpoolMaxPrice: 100000,
452
+
secrets: {
453
+
1: 'ProcessProtectedData test subject',
454
+
2: 'email content for test processData',
455
+
},
456
+
args: '_args_test_process_data_',
457
+
path: 'computed.json',
458
+
waitForResult: false,
459
+
});
460
+
}catch(firstError){
461
+
try{
462
+
awaitprocessProtectedData({
463
+
iexec,
464
+
protectedData: protectedData.address,
465
+
app: appAddress,
466
+
defaultWorkerpool: payableWorkerpoolAddress,
467
+
workerpool: payableWorkerpoolAddress,
468
+
workerpoolMaxPrice: 100000,
469
+
secrets: {
470
+
1: 'ProcessProtectedData test subject',
471
+
2: 'email content for test processData',
472
+
},
473
+
args: '_args_test_process_data_',
474
+
path: 'computed.json',
475
+
waitForResult: false,
476
+
});
477
+
}catch(secondError){
478
+
caughtError=secondErrorasError;
479
+
}
480
+
}
481
+
482
+
expect(caughtError).toBeDefined();
483
+
expect(caughtError).toBeInstanceOf(Error);
484
+
expect(caughtError?.message).toBe('Failed to process protected data');
485
+
constcauseMsg=
486
+
caughtError?.errorCause?.message||
487
+
caughtError?.cause?.message||
488
+
caughtError?.cause||
489
+
caughtError?.errorCause;
490
+
expect(causeMsg).toBe(
491
+
`Cost per task (${workerpoolprice} nRlc) is greater than requester account stake (0). Orders can't be matched. If you are the requester, you should deposit to top up your account`
0 commit comments