@@ -488,8 +488,8 @@ describe('GatorPermissionsController', () => {
488
488
} ) ;
489
489
} ) ;
490
490
491
- it ( 'throws if contracts are not found' , async ( ) => {
492
- await expect (
491
+ it ( 'throws if contracts are not found' , ( ) => {
492
+ expect ( ( ) =>
493
493
controller . decodePermissionFromPermissionContextForOrigin ( {
494
494
origin : controller . permissionsProviderSnapId ,
495
495
chainId : 999999 ,
@@ -501,10 +501,10 @@ describe('GatorPermissionsController', () => {
501
501
} ,
502
502
metadata : buildMetadata ( '' ) ,
503
503
} ) ,
504
- ) . rejects . toThrow ( 'Contracts not found for chainId: 999999' ) ;
504
+ ) . toThrow ( 'Contracts not found for chainId: 999999' ) ;
505
505
} ) ;
506
506
507
- it ( 'decodes a native-token-stream permission successfully' , async ( ) => {
507
+ it ( 'decodes a native-token-stream permission successfully' , ( ) => {
508
508
const {
509
509
TimestampEnforcer,
510
510
NativeTokenStreamingEnforcer,
@@ -552,13 +552,12 @@ describe('GatorPermissionsController', () => {
552
552
caveats,
553
553
} ;
554
554
555
- const result =
556
- await controller . decodePermissionFromPermissionContextForOrigin ( {
557
- origin : controller . permissionsProviderSnapId ,
558
- chainId,
559
- delegation,
560
- metadata : buildMetadata ( 'Test justification' ) ,
561
- } ) ;
555
+ const result = controller . decodePermissionFromPermissionContextForOrigin ( {
556
+ origin : controller . permissionsProviderSnapId ,
557
+ chainId,
558
+ delegation,
559
+ metadata : buildMetadata ( 'Test justification' ) ,
560
+ } ) ;
562
561
563
562
expect ( result . chainId ) . toBe ( numberToHex ( chainId ) ) ;
564
563
expect ( result . address ) . toBe ( delegator ) ;
@@ -581,8 +580,8 @@ describe('GatorPermissionsController', () => {
581
580
expect ( result . permission . justification ) . toBe ( 'Test justification' ) ;
582
581
} ) ;
583
582
584
- it ( 'throws when origin does not match permissions provider' , async ( ) => {
585
- await expect (
583
+ it ( 'throws when origin does not match permissions provider' , ( ) => {
584
+ expect ( ( ) =>
586
585
controller . decodePermissionFromPermissionContextForOrigin ( {
587
586
origin : 'not-the-provider' ,
588
587
chainId : 1 ,
@@ -594,10 +593,10 @@ describe('GatorPermissionsController', () => {
594
593
} ,
595
594
metadata : buildMetadata ( '' ) ,
596
595
} ) ,
597
- ) . rejects . toThrow ( 'Origin not-the-provider not allowed' ) ;
596
+ ) . toThrow ( 'Origin not-the-provider not allowed' ) ;
598
597
} ) ;
599
598
600
- it ( 'throws when enforcers do not identify a supported permission' , async ( ) => {
599
+ it ( 'throws when enforcers do not identify a supported permission' , ( ) => {
601
600
const { TimestampEnforcer, ValueLteEnforcer } = contracts ;
602
601
603
602
const expiryTerms = createTimestampTerms (
@@ -615,7 +614,7 @@ describe('GatorPermissionsController', () => {
615
614
{ enforcer : ValueLteEnforcer , terms : '0x' , args : '0x' } as const ,
616
615
] ;
617
616
618
- await expect (
617
+ expect ( ( ) =>
619
618
controller . decodePermissionFromPermissionContextForOrigin ( {
620
619
origin : controller . permissionsProviderSnapId ,
621
620
chainId,
@@ -627,10 +626,10 @@ describe('GatorPermissionsController', () => {
627
626
} ,
628
627
metadata : buildMetadata ( '' ) ,
629
628
} ) ,
630
- ) . rejects . toThrow ( 'Failed to decode permission' ) ;
629
+ ) . toThrow ( 'Failed to decode permission' ) ;
631
630
} ) ;
632
631
633
- it ( 'throws when authority is not ROOT_AUTHORITY' , async ( ) => {
632
+ it ( 'throws when authority is not ROOT_AUTHORITY' , ( ) => {
634
633
const {
635
634
TimestampEnforcer,
636
635
NativeTokenStreamingEnforcer,
@@ -674,7 +673,7 @@ describe('GatorPermissionsController', () => {
674
673
const invalidAuthority =
675
674
'0x0000000000000000000000000000000000000000' as Hex ;
676
675
677
- await expect (
676
+ expect ( ( ) =>
678
677
controller . decodePermissionFromPermissionContextForOrigin ( {
679
678
origin : controller . permissionsProviderSnapId ,
680
679
chainId,
@@ -686,7 +685,7 @@ describe('GatorPermissionsController', () => {
686
685
} ,
687
686
metadata : buildMetadata ( '' ) ,
688
687
} ) ,
689
- ) . rejects . toThrow ( 'Failed to decode permission' ) ;
688
+ ) . toThrow ( 'Failed to decode permission' ) ;
690
689
} ) ;
691
690
} ) ;
692
691
} ) ;
0 commit comments