@@ -96,6 +96,7 @@ describe('RpcHandler', () => {
9696 storeGrantedPermission : jest . fn ( ) ,
9797 storeGrantedPermissionBatch : jest . fn ( ) ,
9898 getGrantedPermission : jest . fn ( ) ,
99+ getGrantedPermissionByDelegationHash : jest . fn ( ) ,
99100 getAllGrantedPermissions : jest . fn ( ) ,
100101 getUserProfile : jest . fn ( ) ,
101102 updatePermissionRevocationStatus : jest . fn ( ) ,
@@ -629,7 +630,7 @@ describe('RpcHandler', () => {
629630 isRevoked : false ,
630631 } ;
631632
632- mockProfileSyncManager . getGrantedPermission . mockResolvedValueOnce (
633+ mockProfileSyncManager . getGrantedPermissionByDelegationHash . mockResolvedValueOnce (
633634 mockPermission ,
634635 ) ;
635636 mockProfileSyncManager . checkDelegationDisabledOnChain . mockResolvedValueOnce (
@@ -642,9 +643,9 @@ describe('RpcHandler', () => {
642643 const result = await handler . submitRevocation ( validRevocationParams ) ;
643644
644645 expect ( result ) . toStrictEqual ( { success : true } ) ;
645- expect ( mockProfileSyncManager . getGrantedPermission ) . toHaveBeenCalledWith (
646- validRevocationParams . delegationHash ,
647- ) ;
646+ expect (
647+ mockProfileSyncManager . getGrantedPermissionByDelegationHash ,
648+ ) . toHaveBeenCalledWith ( validRevocationParams . delegationHash ) ;
648649 expect (
649650 mockProfileSyncManager . checkDelegationDisabledOnChain ,
650651 ) . toHaveBeenCalledWith (
@@ -730,7 +731,7 @@ describe('RpcHandler', () => {
730731 } ;
731732
732733 const profileSyncError = new Error ( 'Update failed' ) ;
733- mockProfileSyncManager . getGrantedPermission . mockResolvedValueOnce (
734+ mockProfileSyncManager . getGrantedPermissionByDelegationHash . mockResolvedValueOnce (
734735 mockPermission ,
735736 ) ;
736737 mockProfileSyncManager . checkDelegationDisabledOnChain . mockResolvedValueOnce (
@@ -778,7 +779,7 @@ describe('RpcHandler', () => {
778779 isRevoked : false ,
779780 } ;
780781
781- mockProfileSyncManager . getGrantedPermission . mockResolvedValueOnce (
782+ mockProfileSyncManager . getGrantedPermissionByDelegationHash . mockResolvedValueOnce (
782783 mockPermission ,
783784 ) ;
784785 mockProfileSyncManager . checkDelegationDisabledOnChain . mockResolvedValueOnce (
@@ -791,9 +792,9 @@ describe('RpcHandler', () => {
791792 const result = await handler . submitRevocation ( upperCaseParams ) ;
792793
793794 expect ( result ) . toStrictEqual ( { success : true } ) ;
794- expect ( mockProfileSyncManager . getGrantedPermission ) . toHaveBeenCalledWith (
795- upperCaseParams . delegationHash ,
796- ) ;
795+ expect (
796+ mockProfileSyncManager . getGrantedPermissionByDelegationHash ,
797+ ) . toHaveBeenCalledWith ( upperCaseParams . delegationHash ) ;
797798 } ) ;
798799
799800 it ( 'should handle different chain configurations' , async ( ) => {
@@ -824,7 +825,7 @@ describe('RpcHandler', () => {
824825 isRevoked : false ,
825826 } ;
826827
827- mockProfileSyncManager . getGrantedPermission . mockResolvedValueOnce (
828+ mockProfileSyncManager . getGrantedPermissionByDelegationHash . mockResolvedValueOnce (
828829 mockPermission ,
829830 ) ;
830831 mockProfileSyncManager . checkDelegationDisabledOnChain . mockResolvedValueOnce (
@@ -837,9 +838,9 @@ describe('RpcHandler', () => {
837838 const result = await handler . submitRevocation ( testParams ) ;
838839
839840 expect ( result ) . toStrictEqual ( { success : true } ) ;
840- expect ( mockProfileSyncManager . getGrantedPermission ) . toHaveBeenCalledWith (
841- testParams . delegationHash ,
842- ) ;
841+ expect (
842+ mockProfileSyncManager . getGrantedPermissionByDelegationHash ,
843+ ) . toHaveBeenCalledWith ( testParams . delegationHash ) ;
843844 } ) ;
844845 } ) ;
845846} ) ;
0 commit comments