@@ -223,7 +223,7 @@ func TestListProject(t *testing.T) {
223
223
_ , _ , _ , err := listProject (nil , addr , addr , addr )
224
224
r .ErrorContains (err , t .Name ())
225
225
})
226
- t .Run ("FailedToPackIsValidProjectCallData " , func (t * testing.T ) {
226
+ t .Run ("FailedToPackProjectCountCallData " , func (t * testing.T ) {
227
227
p := gomonkey .NewPatches ()
228
228
defer p .Reset ()
229
229
@@ -242,7 +242,7 @@ func TestListProject(t *testing.T) {
242
242
_ , _ , _ , err := listProject (nil , addr , addr , addr )
243
243
r .ErrorContains (err , t .Name ())
244
244
})
245
- t .Run ("FailedToPackProjectConfigCallData " , func (t * testing.T ) {
245
+ t .Run ("FailedToPackIsValidProjectCallData " , func (t * testing.T ) {
246
246
p := gomonkey .NewPatches ()
247
247
defer p .Reset ()
248
248
@@ -261,7 +261,7 @@ func TestListProject(t *testing.T) {
261
261
_ , _ , _ , err := listProject (nil , addr , addr , addr )
262
262
r .ErrorContains (err , t .Name ())
263
263
})
264
- t .Run ("FailedToPackProjectIsPausedCallData " , func (t * testing.T ) {
264
+ t .Run ("FailedToPackProjectConfigCallData " , func (t * testing.T ) {
265
265
p := gomonkey .NewPatches ()
266
266
defer p .Reset ()
267
267
@@ -280,7 +280,7 @@ func TestListProject(t *testing.T) {
280
280
_ , _ , _ , err := listProject (nil , addr , addr , addr )
281
281
r .ErrorContains (err , t .Name ())
282
282
})
283
- t .Run ("FailedToPackProjectAttributesProverAmountCallData " , func (t * testing.T ) {
283
+ t .Run ("FailedToPackProjectIsPausedCallData " , func (t * testing.T ) {
284
284
p := gomonkey .NewPatches ()
285
285
defer p .Reset ()
286
286
@@ -299,7 +299,7 @@ func TestListProject(t *testing.T) {
299
299
_ , _ , _ , err := listProject (nil , addr , addr , addr )
300
300
r .ErrorContains (err , t .Name ())
301
301
})
302
- t .Run ("FailedToPackProjectAttributesVmTypeCallData " , func (t * testing.T ) {
302
+ t .Run ("FailedToPackProjectAttributesProverAmountCallData " , func (t * testing.T ) {
303
303
p := gomonkey .NewPatches ()
304
304
defer p .Reset ()
305
305
@@ -318,7 +318,7 @@ func TestListProject(t *testing.T) {
318
318
_ , _ , _ , err := listProject (nil , addr , addr , addr )
319
319
r .ErrorContains (err , t .Name ())
320
320
})
321
- t .Run ("FailedToPackProjectAttributesManagementAddressCallData " , func (t * testing.T ) {
321
+ t .Run ("FailedToPackProjectAttributesVmTypeCallData " , func (t * testing.T ) {
322
322
p := gomonkey .NewPatches ()
323
323
defer p .Reset ()
324
324
@@ -337,6 +337,25 @@ func TestListProject(t *testing.T) {
337
337
_ , _ , _ , err := listProject (nil , addr , addr , addr )
338
338
r .ErrorContains (err , t .Name ())
339
339
})
340
+ t .Run ("FailedToPackProjectAttributesManagementAddressCallData" , func (t * testing.T ) {
341
+ p := gomonkey .NewPatches ()
342
+ defer p .Reset ()
343
+
344
+ p .ApplyFuncReturn (multicall .NewMulticall , nil , nil )
345
+ p .ApplyMethodSeq (abi.ABI {}, "Pack" , []gomonkey.OutputCell {
346
+ {
347
+ Values : gomonkey.Params {[]byte {}, nil },
348
+ Times : 7 ,
349
+ },
350
+ {
351
+ Values : gomonkey.Params {nil , errors .New (t .Name ())},
352
+ Times : 1 ,
353
+ },
354
+ })
355
+ addr := common.Address {}
356
+ _ , _ , _ , err := listProject (nil , addr , addr , addr )
357
+ r .ErrorContains (err , t .Name ())
358
+ })
340
359
t .Run ("FailedToMultiCall" , func (t * testing.T ) {
341
360
p := gomonkey .NewPatches ()
342
361
defer p .Reset ()
@@ -349,7 +368,7 @@ func TestListProject(t *testing.T) {
349
368
_ , _ , _ , err := listProject (nil , addr , addr , addr )
350
369
r .ErrorContains (err , t .Name ())
351
370
})
352
- multiCallRes := [][]byte {{}, {}, {}, {}, {}, {}, {}}
371
+ multiCallRes := [][]byte {{}, {}, {}, {}, {}, {}, {}, {} }
353
372
t .Run ("FailedToUnpackBlockNumberResult" , func (t * testing.T ) {
354
373
p := gomonkey .NewPatches ()
355
374
defer p .Reset ()
@@ -363,7 +382,7 @@ func TestListProject(t *testing.T) {
363
382
_ , _ , _ , err := listProject (nil , addr , addr , addr )
364
383
r .ErrorContains (err , t .Name ())
365
384
})
366
- t .Run ("FailedToUnpackIsValidProjectResult " , func (t * testing.T ) {
385
+ t .Run ("FailedToUnpackProjectCountResult " , func (t * testing.T ) {
367
386
p := gomonkey .NewPatches ()
368
387
defer p .Reset ()
369
388
@@ -391,6 +410,34 @@ func TestListProject(t *testing.T) {
391
410
_ , _ , _ , err := listProject (nil , addr , addr , addr )
392
411
r .ErrorContains (err , t .Name ())
393
412
})
413
+ t .Run ("FailedToUnpackIsValidProjectResult" , func (t * testing.T ) {
414
+ p := gomonkey .NewPatches ()
415
+ defer p .Reset ()
416
+
417
+ p .ApplyFuncReturn (multicall .NewMulticall , & multicall.Multicall {}, nil )
418
+ caller := & multicall.MulticallCaller {}
419
+ p .ApplyMethodReturn (caller , "MultiCall" , multiCallRes , nil )
420
+ n := new (big.Int ).SetUint64 (1 )
421
+ p .ApplyMethodSeq (abi.ABI {}, "Unpack" , []gomonkey.OutputCell {
422
+ {
423
+ Values : gomonkey.Params {[]interface {}{& n }, nil },
424
+ Times : 2 ,
425
+ },
426
+ {
427
+ Values : gomonkey.Params {nil , errors .New (t .Name ())},
428
+ Times : 1 ,
429
+ },
430
+ })
431
+ p .ApplyFuncSeq (abi .ConvertType , []gomonkey.OutputCell {
432
+ {
433
+ Values : gomonkey.Params {& n },
434
+ Times : 2 ,
435
+ },
436
+ })
437
+ addr := common.Address {}
438
+ _ , _ , _ , err := listProject (nil , addr , addr , addr )
439
+ r .ErrorContains (err , t .Name ())
440
+ })
394
441
t .Run ("FailedToUnpackProjectConfigResult" , func (t * testing.T ) {
395
442
p := gomonkey .NewPatches ()
396
443
defer p .Reset ()
@@ -403,7 +450,7 @@ func TestListProject(t *testing.T) {
403
450
p .ApplyMethodSeq (abi.ABI {}, "Unpack" , []gomonkey.OutputCell {
404
451
{
405
452
Values : gomonkey.Params {[]interface {}{& n }, nil },
406
- Times : 1 ,
453
+ Times : 2 ,
407
454
},
408
455
{
409
456
Values : gomonkey.Params {[]interface {}{& isValidProject }, nil },
@@ -417,7 +464,7 @@ func TestListProject(t *testing.T) {
417
464
p .ApplyFuncSeq (abi .ConvertType , []gomonkey.OutputCell {
418
465
{
419
466
Values : gomonkey.Params {& n },
420
- Times : 1 ,
467
+ Times : 2 ,
421
468
},
422
469
{
423
470
Values : gomonkey.Params {& isValidProject },
@@ -442,7 +489,7 @@ func TestListProject(t *testing.T) {
442
489
p .ApplyMethodSeq (abi.ABI {}, "Unpack" , []gomonkey.OutputCell {
443
490
{
444
491
Values : gomonkey.Params {[]interface {}{& n }, nil },
445
- Times : 1 ,
492
+ Times : 2 ,
446
493
},
447
494
{
448
495
Values : gomonkey.Params {[]interface {}{& isValidProject }, nil },
@@ -460,7 +507,7 @@ func TestListProject(t *testing.T) {
460
507
p .ApplyFuncSeq (abi .ConvertType , []gomonkey.OutputCell {
461
508
{
462
509
Values : gomonkey.Params {& n },
463
- Times : 1 ,
510
+ Times : 2 ,
464
511
},
465
512
{
466
513
Values : gomonkey.Params {& isValidProject },
@@ -489,7 +536,7 @@ func TestListProject(t *testing.T) {
489
536
p .ApplyMethodSeq (abi.ABI {}, "Unpack" , []gomonkey.OutputCell {
490
537
{
491
538
Values : gomonkey.Params {[]interface {}{& n }, nil },
492
- Times : 1 ,
539
+ Times : 2 ,
493
540
},
494
541
{
495
542
Values : gomonkey.Params {[]interface {}{& isValidProject }, nil },
@@ -511,7 +558,7 @@ func TestListProject(t *testing.T) {
511
558
p .ApplyFuncSeq (abi .ConvertType , []gomonkey.OutputCell {
512
559
{
513
560
Values : gomonkey.Params {& n },
514
- Times : 1 ,
561
+ Times : 2 ,
515
562
},
516
563
{
517
564
Values : gomonkey.Params {& isValidProject },
@@ -545,7 +592,7 @@ func TestListProject(t *testing.T) {
545
592
p .ApplyMethodSeq (abi.ABI {}, "Unpack" , []gomonkey.OutputCell {
546
593
{
547
594
Values : gomonkey.Params {[]interface {}{& n }, nil },
548
- Times : 1 ,
595
+ Times : 2 ,
549
596
},
550
597
{
551
598
Values : gomonkey.Params {[]interface {}{& isValidProject }, nil },
@@ -571,7 +618,7 @@ func TestListProject(t *testing.T) {
571
618
p .ApplyFuncSeq (abi .ConvertType , []gomonkey.OutputCell {
572
619
{
573
620
Values : gomonkey.Params {& n },
574
- Times : 1 ,
621
+ Times : 2 ,
575
622
},
576
623
{
577
624
Values : gomonkey.Params {& isValidProject },
@@ -609,7 +656,7 @@ func TestListProject(t *testing.T) {
609
656
p .ApplyMethodSeq (abi.ABI {}, "Unpack" , []gomonkey.OutputCell {
610
657
{
611
658
Values : gomonkey.Params {[]interface {}{& n }, nil },
612
- Times : 1 ,
659
+ Times : 2 ,
613
660
},
614
661
{
615
662
Values : gomonkey.Params {[]interface {}{& isValidProject }, nil },
@@ -639,7 +686,7 @@ func TestListProject(t *testing.T) {
639
686
p .ApplyFuncSeq (abi .ConvertType , []gomonkey.OutputCell {
640
687
{
641
688
Values : gomonkey.Params {& n },
642
- Times : 1 ,
689
+ Times : 2 ,
643
690
},
644
691
{
645
692
Values : gomonkey.Params {& isValidProject },
@@ -682,7 +729,7 @@ func TestListProject(t *testing.T) {
682
729
p .ApplyMethodSeq (abi.ABI {}, "Unpack" , []gomonkey.OutputCell {
683
730
{
684
731
Values : gomonkey.Params {[]interface {}{& n }, nil },
685
- Times : 1 ,
732
+ Times : 2 ,
686
733
},
687
734
{
688
735
Values : gomonkey.Params {[]interface {}{& isValidProject }, nil },
@@ -710,7 +757,7 @@ func TestListProject(t *testing.T) {
710
757
},
711
758
{
712
759
Values : gomonkey.Params {[]interface {}{& n }, nil },
713
- Times : 1 ,
760
+ Times : 2 ,
714
761
},
715
762
{
716
763
Values : gomonkey.Params {[]interface {}{& isInValidProject }, nil },
@@ -720,7 +767,7 @@ func TestListProject(t *testing.T) {
720
767
p .ApplyFuncSeq (abi .ConvertType , []gomonkey.OutputCell {
721
768
{
722
769
Values : gomonkey.Params {& n },
723
- Times : 1 ,
770
+ Times : 2 ,
724
771
},
725
772
{
726
773
Values : gomonkey.Params {& isValidProject },
@@ -748,7 +795,7 @@ func TestListProject(t *testing.T) {
748
795
},
749
796
{
750
797
Values : gomonkey.Params {& n },
751
- Times : 1 ,
798
+ Times : 2 ,
752
799
},
753
800
{
754
801
Values : gomonkey.Params {& isInValidProject },
0 commit comments