@human-protocol/sdk 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +1 -1
  2. package/dist/constants.d.ts +46 -0
  3. package/dist/constants.d.ts.map +1 -0
  4. package/dist/constants.js +203 -0
  5. package/dist/decorators.d.ts +2 -0
  6. package/dist/decorators.d.ts.map +1 -0
  7. package/dist/decorators.js +17 -0
  8. package/dist/enums.d.ts +17 -0
  9. package/dist/enums.d.ts.map +1 -0
  10. package/dist/enums.js +20 -0
  11. package/dist/error.d.ts +196 -0
  12. package/dist/error.d.ts.map +1 -0
  13. package/dist/error.js +229 -0
  14. package/dist/escrow.d.ts +176 -0
  15. package/dist/escrow.d.ts.map +1 -0
  16. package/dist/escrow.js +590 -0
  17. package/dist/index.d.ts +10 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +33 -0
  20. package/dist/init.d.ts +13 -0
  21. package/dist/init.d.ts.map +1 -0
  22. package/dist/init.js +35 -0
  23. package/dist/interfaces.d.ts +44 -0
  24. package/dist/interfaces.d.ts.map +1 -0
  25. package/dist/interfaces.js +2 -0
  26. package/dist/kvstore.d.ts +40 -0
  27. package/dist/kvstore.d.ts.map +1 -0
  28. package/dist/kvstore.js +106 -0
  29. package/dist/queries.d.ts +4 -0
  30. package/dist/queries.d.ts.map +1 -0
  31. package/dist/queries.js +22 -0
  32. package/dist/staking.d.ts +121 -0
  33. package/dist/staking.d.ts.map +1 -0
  34. package/dist/staking.js +381 -0
  35. package/dist/storage.d.ts +48 -0
  36. package/dist/storage.d.ts.map +1 -0
  37. package/dist/storage.js +164 -0
  38. package/dist/types.d.ts +123 -0
  39. package/dist/types.d.ts.map +1 -0
  40. package/dist/types.js +35 -0
  41. package/dist/utils.d.ts +32 -0
  42. package/dist/utils.d.ts.map +1 -0
  43. package/dist/utils.js +99 -0
  44. package/package.json +4 -7
  45. package/src/constants.ts +221 -4
  46. package/src/decorators.ts +21 -0
  47. package/src/enums.ts +16 -0
  48. package/src/error.ts +298 -16
  49. package/src/escrow.ts +754 -0
  50. package/src/index.ts +14 -1
  51. package/src/init.ts +45 -0
  52. package/src/interfaces.ts +50 -0
  53. package/src/kvstore.ts +93 -0
  54. package/src/queries.ts +18 -0
  55. package/src/staking.ts +421 -0
  56. package/src/storage.ts +159 -130
  57. package/src/types.ts +37 -574
  58. package/src/utils.ts +80 -76
  59. package/test/escrow.test.ts +1339 -0
  60. package/test/init.test.ts +88 -0
  61. package/test/kvstore.test.ts +208 -0
  62. package/test/staking.test.ts +640 -0
  63. package/test/storage.test.ts +422 -0
  64. package/test/utils/constants.ts +40 -0
  65. package/example/simple-existing-job.ts +0 -86
  66. package/example/simple-new-job-public.ts +0 -74
  67. package/example/simple-new-job.ts +0 -72
  68. package/src/job.ts +0 -821
  69. package/src/logger.ts +0 -29
  70. package/test/job.test.ts +0 -753
  71. package/test/utils/manifest.ts +0 -33
package/test/job.test.ts DELETED
@@ -1,753 +0,0 @@
1
- import { getPublicURL } from './../src/storage';
2
- import { EscrowStatus, Job } from '../src';
3
- import { upload } from '../src/storage';
4
- import { toFullDigit } from '../src/utils';
5
- import {
6
- DEFAULT_GAS_PAYER_ADDR,
7
- DEFAULT_GAS_PAYER_PRIVKEY,
8
- DEFAULT_HMTOKEN_ADDR,
9
- NOT_TRUSTED_OPERATOR_PRIVKEY,
10
- REPUTATION_ORACLE_PRIVKEY,
11
- TRUSTED_OPERATOR1_ADDR,
12
- TRUSTED_OPERATOR1_PRIVKEY,
13
- TRUSTED_OPERATOR2_ADDR,
14
- WORKER1_ADDR,
15
- WORKER2_ADDR,
16
- WORKER3_ADDR,
17
- } from './utils/constants';
18
- import { manifest } from './utils/manifest';
19
-
20
- jest.mock('../src/storage', () => ({
21
- ...jest.requireActual('../src/storage'),
22
- upload: jest.fn().mockResolvedValue({
23
- key: 'uploaded-key',
24
- hash: 'uploaded-hash',
25
- }),
26
- download: jest.fn().mockResolvedValue({
27
- results: 0,
28
- }),
29
- getPublicURL: jest.fn().mockResolvedValue('public-url'),
30
- }));
31
-
32
- describe('Test Job', () => {
33
- describe('New job', () => {
34
- let job: Job;
35
-
36
- beforeEach(() => {
37
- job = new Job({
38
- gasPayer: DEFAULT_GAS_PAYER_PRIVKEY,
39
- reputationOracle: REPUTATION_ORACLE_PRIVKEY,
40
- manifest: manifest,
41
- hmTokenAddr: DEFAULT_HMTOKEN_ADDR,
42
- logLevel: 'debug',
43
- });
44
- });
45
-
46
- afterEach(() => {
47
- jest.clearAllMocks();
48
- });
49
-
50
- it('Should be able to initializes the job by deploying escrow factory', async () => {
51
- const initialized = await job.initialize();
52
- expect(initialized).toBe(true);
53
-
54
- expect(await job.contractData?.factory?.address).not.toBeNull();
55
- });
56
-
57
- it('Should be able to launch the job', async () => {
58
- // Fail to launch the job before initialization
59
- expect(await job.launch()).toBe(false);
60
-
61
- await job.initialize();
62
-
63
- expect(await job.launch()).toBe(true);
64
- expect(await job.status()).toBe(EscrowStatus.Launched);
65
- });
66
-
67
- it('Should be able to setup the job', async () => {
68
- // Fail to setup the job before launch
69
- expect(await job.setup()).toBe(false);
70
-
71
- await job.initialize();
72
- await job.launch();
73
-
74
- expect(await job.setup()).toBe(true);
75
- });
76
-
77
- it('Should be able to add trusted handlers', async () => {
78
- await job.initialize();
79
- await job.launch();
80
-
81
- expect(await job.isTrustedHandler(DEFAULT_GAS_PAYER_ADDR)).toBe(true);
82
-
83
- expect(
84
- await job.addTrustedHandlers([
85
- TRUSTED_OPERATOR1_ADDR,
86
- TRUSTED_OPERATOR2_ADDR,
87
- ])
88
- ).toBe(true);
89
-
90
- expect(await job.isTrustedHandler(TRUSTED_OPERATOR1_ADDR)).toBe(true);
91
- expect(await job.isTrustedHandler(TRUSTED_OPERATOR2_ADDR)).toBe(true);
92
- });
93
-
94
- it('Should be able to bulk payout workers', async () => {
95
- await job.initialize();
96
- await job.launch();
97
- await job.setup();
98
-
99
- expect(
100
- await job.bulkPayout(
101
- [
102
- {
103
- address: WORKER1_ADDR,
104
- amount: 20,
105
- },
106
- {
107
- address: WORKER2_ADDR,
108
- amount: 50,
109
- },
110
- ],
111
- {}
112
- )
113
- ).toBe(true);
114
-
115
- // The escrow contract is still in Partial state as there's still balance left.
116
- expect((await job.balance())?.toString()).toBe(
117
- toFullDigit(30).toString()
118
- );
119
- expect(await job.status()).toBe(EscrowStatus.Partial);
120
-
121
- // Trying to pay more than the contract balance results in failure.
122
- expect(
123
- await job.bulkPayout(
124
- [
125
- {
126
- address: WORKER3_ADDR,
127
- amount: 50,
128
- },
129
- ],
130
- {}
131
- )
132
- ).toBe(false);
133
-
134
- // Paying the remaining amount empties the escrow and updates the status correctly.
135
- expect(
136
- await job.bulkPayout(
137
- [
138
- {
139
- address: WORKER3_ADDR,
140
- amount: 30,
141
- },
142
- ],
143
- {}
144
- )
145
- ).toBe(true);
146
- expect((await job.balance())?.toString()).toBe(toFullDigit(0).toString());
147
- expect(await job.status()).toBe(EscrowStatus.Paid);
148
- });
149
-
150
- it('Should encrypt result, when bulk paying out workers', async () => {
151
- await job.initialize();
152
- await job.launch();
153
- await job.setup();
154
-
155
- jest.clearAllMocks();
156
- const finalResults = { results: 0 };
157
- await job.bulkPayout(
158
- [
159
- {
160
- address: WORKER1_ADDR,
161
- amount: 100,
162
- },
163
- ],
164
- finalResults,
165
- true
166
- );
167
-
168
- expect(upload).toHaveBeenCalledWith(
169
- job.storageAccessData,
170
- finalResults,
171
- job.providerData?.reputationOracle?.publicKey,
172
- true,
173
- false
174
- );
175
- expect(upload).toHaveBeenCalledTimes(1);
176
- });
177
-
178
- it('Should not encrypt result, when bulk paying out workers', async () => {
179
- await job.initialize();
180
- await job.launch();
181
- await job.setup();
182
-
183
- jest.clearAllMocks();
184
- const finalResults = { results: 0 };
185
- await job.bulkPayout(
186
- [
187
- {
188
- address: WORKER1_ADDR,
189
- amount: 100,
190
- },
191
- ],
192
- finalResults,
193
- false
194
- );
195
-
196
- expect(upload).toHaveBeenCalledWith(
197
- job.storageAccessData,
198
- finalResults,
199
- job.providerData?.reputationOracle?.publicKey,
200
- false,
201
- false
202
- );
203
- expect(upload).toHaveBeenCalledTimes(1);
204
- });
205
-
206
- it('Should store result in private storage, when bulk paying out workers', async () => {
207
- await job.initialize();
208
- await job.launch();
209
- await job.setup();
210
-
211
- jest.clearAllMocks();
212
- const finalResults = { results: 0 };
213
- await job.bulkPayout(
214
- [
215
- {
216
- address: WORKER1_ADDR,
217
- amount: 100,
218
- },
219
- ],
220
- finalResults,
221
- false,
222
- false
223
- );
224
-
225
- expect(upload).toHaveBeenCalledWith(
226
- job.storageAccessData,
227
- finalResults,
228
- job.providerData?.reputationOracle?.publicKey,
229
- false,
230
- false
231
- );
232
- expect(upload).toHaveBeenCalledTimes(1);
233
- });
234
-
235
- it('Should store result in public storage, when bulk paying out workers', async () => {
236
- await job.initialize();
237
- await job.launch();
238
- await job.setup();
239
-
240
- jest.clearAllMocks();
241
- const finalResults = { results: 0 };
242
- await job.bulkPayout(
243
- [
244
- {
245
- address: WORKER1_ADDR,
246
- amount: 50,
247
- },
248
- ],
249
- finalResults,
250
- false,
251
- true
252
- );
253
-
254
- expect(upload).toHaveBeenCalledWith(
255
- job.storageAccessData,
256
- finalResults,
257
- job.providerData?.reputationOracle?.publicKey,
258
- false,
259
- true
260
- );
261
- expect(upload).toHaveBeenCalledTimes(1);
262
- expect(getPublicURL).toHaveBeenCalledTimes(1);
263
- });
264
-
265
- it('Should return final result', async () => {
266
- await job.initialize();
267
- await job.launch();
268
- await job.setup();
269
-
270
- const finalResults = { results: 0 };
271
- await job.bulkPayout(
272
- [
273
- {
274
- address: WORKER1_ADDR,
275
- amount: 100,
276
- },
277
- ],
278
- finalResults,
279
- true
280
- );
281
-
282
- expect(JSON.stringify(await job.finalResults())).toBe(
283
- JSON.stringify(finalResults)
284
- );
285
- });
286
-
287
- it('Should be able to abort the job', async () => {
288
- await job.initialize();
289
- await job.launch();
290
- await job.setup();
291
-
292
- expect(await job.abort()).toBe(true);
293
- });
294
-
295
- it('Should be able to abort partially paid job', async () => {
296
- await job.initialize();
297
- await job.launch();
298
- await job.setup();
299
-
300
- const finalResults = { results: 0 };
301
- await job.bulkPayout(
302
- [
303
- {
304
- address: WORKER1_ADDR,
305
- amount: 50,
306
- },
307
- ],
308
- finalResults,
309
- true
310
- );
311
-
312
- expect(await job.abort()).toBe(true);
313
- });
314
-
315
- it('Should not be able to abort fully paid job', async () => {
316
- await job.initialize();
317
- await job.launch();
318
- await job.setup();
319
-
320
- const finalResults = { results: 0 };
321
- await job.bulkPayout(
322
- [
323
- {
324
- address: WORKER1_ADDR,
325
- amount: 100,
326
- },
327
- ],
328
- finalResults,
329
- true
330
- );
331
-
332
- expect(await job.abort()).toBe(false);
333
- });
334
-
335
- it('Should be able to cancel the job', async () => {
336
- await job.initialize();
337
- await job.launch();
338
- await job.setup();
339
-
340
- expect(await job.cancel()).toBe(true);
341
- expect((await job.balance())?.toString()).toBe(toFullDigit(0).toString());
342
- });
343
-
344
- it('Should be able to cancel partially paid job', async () => {
345
- await job.initialize();
346
- await job.launch();
347
- await job.setup();
348
-
349
- const finalResults = { results: 0 };
350
- await job.bulkPayout(
351
- [
352
- {
353
- address: WORKER1_ADDR,
354
- amount: 50,
355
- },
356
- ],
357
- finalResults,
358
- true
359
- );
360
-
361
- expect(await job.cancel()).toBe(true);
362
- expect((await job.balance())?.toString()).toBe(toFullDigit(0).toString());
363
- });
364
-
365
- it('Should not be able to cancel paid job', async () => {
366
- await job.initialize();
367
- await job.launch();
368
- await job.setup();
369
-
370
- const finalResults = { results: 0 };
371
- await job.bulkPayout(
372
- [
373
- {
374
- address: WORKER1_ADDR,
375
- amount: 100,
376
- },
377
- ],
378
- finalResults,
379
- true
380
- );
381
-
382
- expect(await job.cancel()).toBe(false);
383
- });
384
- });
385
-
386
- describe('Access existing job from trusted handler', () => {
387
- let job: Job;
388
-
389
- beforeEach(async () => {
390
- const originalJob = new Job({
391
- gasPayer: DEFAULT_GAS_PAYER_PRIVKEY,
392
- reputationOracle: REPUTATION_ORACLE_PRIVKEY,
393
- manifest: manifest,
394
- hmTokenAddr: DEFAULT_HMTOKEN_ADDR,
395
- trustedHandlers: [TRUSTED_OPERATOR1_PRIVKEY],
396
- logLevel: 'error',
397
- });
398
-
399
- await originalJob.initialize();
400
- await originalJob.launch();
401
- await originalJob.setup();
402
-
403
- job = new Job({
404
- gasPayer: NOT_TRUSTED_OPERATOR_PRIVKEY,
405
- hmTokenAddr: DEFAULT_HMTOKEN_ADDR,
406
- reputationOracle: REPUTATION_ORACLE_PRIVKEY,
407
- escrowAddr: originalJob.contractData?.escrowAddr,
408
- factoryAddr: originalJob.contractData?.factoryAddr,
409
- trustedHandlers: [TRUSTED_OPERATOR1_PRIVKEY],
410
- logLevel: 'debug',
411
- });
412
- });
413
-
414
- afterEach(() => {
415
- jest.clearAllMocks();
416
- });
417
-
418
- it('Should be able to initializes the job by accessing existing escrow', async () => {
419
- const initialized = await job.initialize();
420
- expect(initialized).toBe(true);
421
-
422
- expect(await job.manifestData?.manifestlink?.url).toBe('uploaded-key');
423
- expect(await job.manifestData?.manifestlink?.hash).toBe('uploaded-hash');
424
- });
425
-
426
- it('Should not be able to launch the job again', async () => {
427
- await job.initialize();
428
-
429
- expect(await job.launch()).toBe(false);
430
- expect(await job.status()).toBe(EscrowStatus.Pending);
431
- });
432
-
433
- it('Should be able to setup the job again', async () => {
434
- await job.initialize();
435
-
436
- expect(await job.setup()).toBe(false);
437
-
438
- expect((await job.balance())?.toString()).toBe(
439
- toFullDigit(100).toString()
440
- );
441
- expect(await job.manifestData?.manifestlink?.url).toBe('uploaded-key');
442
- expect(await job.manifestData?.manifestlink?.hash).toBe('uploaded-hash');
443
- });
444
-
445
- it('Should be able to add trusted handlers', async () => {
446
- await job.initialize();
447
- await job.launch();
448
-
449
- expect(await job.isTrustedHandler(DEFAULT_GAS_PAYER_ADDR)).toBe(true);
450
-
451
- expect(
452
- await job.addTrustedHandlers([
453
- TRUSTED_OPERATOR1_ADDR,
454
- TRUSTED_OPERATOR2_ADDR,
455
- ])
456
- ).toBe(true);
457
-
458
- expect(await job.isTrustedHandler(TRUSTED_OPERATOR1_ADDR)).toBe(true);
459
- expect(await job.isTrustedHandler(TRUSTED_OPERATOR2_ADDR)).toBe(true);
460
- });
461
-
462
- it('Should be able to bulk payout workers', async () => {
463
- await job.initialize();
464
- await job.launch();
465
- await job.setup();
466
-
467
- expect(
468
- await job.bulkPayout(
469
- [
470
- {
471
- address: WORKER1_ADDR,
472
- amount: 20,
473
- },
474
- {
475
- address: WORKER2_ADDR,
476
- amount: 50,
477
- },
478
- ],
479
- {}
480
- )
481
- ).toBe(true);
482
-
483
- // The escrow contract is still in Partial state as there's still balance left.
484
- expect((await job.balance())?.toString()).toBe(
485
- toFullDigit(30).toString()
486
- );
487
- expect(await job.status()).toBe(EscrowStatus.Partial);
488
-
489
- // Trying to pay more than the contract balance results in failure.
490
- expect(
491
- await job.bulkPayout(
492
- [
493
- {
494
- address: WORKER3_ADDR,
495
- amount: 50,
496
- },
497
- ],
498
- {}
499
- )
500
- ).toBe(false);
501
-
502
- // Paying the remaining amount empties the escrow and updates the status correctly.
503
- expect(
504
- await job.bulkPayout(
505
- [
506
- {
507
- address: WORKER3_ADDR,
508
- amount: 30,
509
- },
510
- ],
511
- {}
512
- )
513
- ).toBe(true);
514
- expect((await job.balance())?.toString()).toBe(toFullDigit(0).toString());
515
- expect(await job.status()).toBe(EscrowStatus.Paid);
516
- });
517
-
518
- it('Should encrypt result, when bulk paying out workers', async () => {
519
- await job.initialize();
520
- await job.launch();
521
- await job.setup();
522
-
523
- jest.clearAllMocks();
524
- const finalResults = { results: 0 };
525
- await job.bulkPayout(
526
- [
527
- {
528
- address: WORKER1_ADDR,
529
- amount: 100,
530
- },
531
- ],
532
- finalResults,
533
- true
534
- );
535
-
536
- expect(upload).toHaveBeenCalledWith(
537
- job.storageAccessData,
538
- finalResults,
539
- job.providerData?.reputationOracle?.publicKey,
540
- true,
541
- false
542
- );
543
- expect(upload).toHaveBeenCalledTimes(1);
544
- });
545
-
546
- it('Should not encrypt result, when bulk paying out workers', async () => {
547
- await job.initialize();
548
- await job.launch();
549
- await job.setup();
550
-
551
- jest.clearAllMocks();
552
- const finalResults = { results: 0 };
553
- await job.bulkPayout(
554
- [
555
- {
556
- address: WORKER1_ADDR,
557
- amount: 100,
558
- },
559
- ],
560
- finalResults,
561
- false
562
- );
563
-
564
- expect(upload).toHaveBeenCalledWith(
565
- job.storageAccessData,
566
- finalResults,
567
- job.providerData?.reputationOracle?.publicKey,
568
- false,
569
- false
570
- );
571
- expect(upload).toHaveBeenCalledTimes(1);
572
- });
573
-
574
- it('Should store result in private storage, when bulk paying out workers', async () => {
575
- await job.initialize();
576
- await job.launch();
577
- await job.setup();
578
-
579
- jest.clearAllMocks();
580
- const finalResults = { results: 0 };
581
- await job.bulkPayout(
582
- [
583
- {
584
- address: WORKER1_ADDR,
585
- amount: 100,
586
- },
587
- ],
588
- finalResults,
589
- false,
590
- false
591
- );
592
-
593
- expect(upload).toHaveBeenCalledWith(
594
- job.storageAccessData,
595
- finalResults,
596
- job.providerData?.reputationOracle?.publicKey,
597
- false,
598
- false
599
- );
600
- expect(upload).toHaveBeenCalledTimes(1);
601
- });
602
-
603
- it('Should store result in public storage, when bulk paying out workers', async () => {
604
- await job.initialize();
605
- await job.launch();
606
- await job.setup();
607
-
608
- jest.clearAllMocks();
609
- const finalResults = { results: 0 };
610
- await job.bulkPayout(
611
- [
612
- {
613
- address: WORKER1_ADDR,
614
- amount: 50,
615
- },
616
- ],
617
- finalResults,
618
- false,
619
- true
620
- );
621
-
622
- expect(upload).toHaveBeenCalledWith(
623
- job.storageAccessData,
624
- finalResults,
625
- job.providerData?.reputationOracle?.publicKey,
626
- false,
627
- true
628
- );
629
- expect(upload).toHaveBeenCalledTimes(1);
630
- expect(getPublicURL).toHaveBeenCalledTimes(1);
631
- });
632
-
633
- it('Should return final result', async () => {
634
- await job.initialize();
635
- await job.launch();
636
- await job.setup();
637
-
638
- const finalResults = { results: 0 };
639
- await job.bulkPayout(
640
- [
641
- {
642
- address: WORKER1_ADDR,
643
- amount: 100,
644
- },
645
- ],
646
- finalResults,
647
- true
648
- );
649
-
650
- expect(JSON.stringify(await job.finalResults())).toBe(
651
- JSON.stringify(finalResults)
652
- );
653
- });
654
-
655
- it('Should be able to abort the job', async () => {
656
- await job.initialize();
657
- await job.launch();
658
- await job.setup();
659
-
660
- expect(await job.abort()).toBe(true);
661
- });
662
-
663
- it('Should be able to abort partially paid job', async () => {
664
- await job.initialize();
665
- await job.launch();
666
- await job.setup();
667
-
668
- const finalResults = { results: 0 };
669
- await job.bulkPayout(
670
- [
671
- {
672
- address: WORKER1_ADDR,
673
- amount: 50,
674
- },
675
- ],
676
- finalResults,
677
- true
678
- );
679
-
680
- expect(await job.abort()).toBe(true);
681
- });
682
-
683
- it('Should not be able to abort fully paid job', async () => {
684
- await job.initialize();
685
- await job.launch();
686
- await job.setup();
687
-
688
- const finalResults = { results: 0 };
689
- await job.bulkPayout(
690
- [
691
- {
692
- address: WORKER1_ADDR,
693
- amount: 100,
694
- },
695
- ],
696
- finalResults,
697
- true
698
- );
699
-
700
- expect(await job.abort()).toBe(false);
701
- });
702
-
703
- it('Should be able to cancel the job', async () => {
704
- await job.initialize();
705
- await job.launch();
706
- await job.setup();
707
-
708
- expect(await job.cancel()).toBe(true);
709
- expect((await job.balance())?.toString()).toBe(toFullDigit(0).toString());
710
- });
711
-
712
- it('Should be able to cancel partially paid job', async () => {
713
- await job.initialize();
714
- await job.launch();
715
- await job.setup();
716
-
717
- const finalResults = { results: 0 };
718
- await job.bulkPayout(
719
- [
720
- {
721
- address: WORKER1_ADDR,
722
- amount: 50,
723
- },
724
- ],
725
- finalResults,
726
- true
727
- );
728
-
729
- expect(await job.cancel()).toBe(true);
730
- expect((await job.balance())?.toString()).toBe(toFullDigit(0).toString());
731
- });
732
-
733
- it('Should not be able to cancel paid job', async () => {
734
- await job.initialize();
735
- await job.launch();
736
- await job.setup();
737
-
738
- const finalResults = { results: 0 };
739
- await job.bulkPayout(
740
- [
741
- {
742
- address: WORKER1_ADDR,
743
- amount: 100,
744
- },
745
- ],
746
- finalResults,
747
- true
748
- );
749
-
750
- expect(await job.cancel()).toBe(false);
751
- });
752
- });
753
- });