@@ -5696,7 +5696,7 @@ describe('SnapController', () => {
56965696 snapController . destroy ( ) ;
56975697 } ) ;
56985698
5699- it ( 'grants the `endowment:caip25` permission to a Snap with `endowment:ethereum-provider` if the `useCaip25Permission` feature flag is enabled ' , async ( ) => {
5699+ it ( 'grants the `endowment:caip25` permission to a Snap with `endowment:ethereum-provider`' , async ( ) => {
57005700 const rootMessenger = getControllerMessenger ( ) ;
57015701 const messenger = getSnapControllerMessenger ( rootMessenger ) ;
57025702
@@ -5732,9 +5732,6 @@ describe('SnapController', () => {
57325732 getSnapControllerOptions ( {
57335733 messenger,
57345734 detectSnapLocation : loopbackDetect ( { manifest } ) ,
5735- featureFlags : {
5736- useCaip25Permission : true ,
5737- } ,
57385735 } ) ,
57395736 ) ;
57405737
@@ -5778,7 +5775,7 @@ describe('SnapController', () => {
57785775 snapController . destroy ( ) ;
57795776 } ) ;
57805777
5781- it ( 'grants the `endowment:caip25` permission when updating a Snap with `endowment:ethereum-provider` if the `useCaip25Permission` feature flag is enabled ' , async ( ) => {
5778+ it ( 'grants the `endowment:caip25` permission when updating a Snap with `endowment:ethereum-provider`' , async ( ) => {
57825779 const newVersion = '1.0.2' ;
57835780 const newVersionRange = '>=1.0.1' ;
57845781
@@ -5838,9 +5835,6 @@ describe('SnapController', () => {
58385835 getSnapControllerOptions ( {
58395836 messenger,
58405837 detectSnapLocation : detectLocationMock ,
5841- featureFlags : {
5842- useCaip25Permission : true ,
5843- } ,
58445838 } ) ,
58455839 ) ;
58465840
@@ -5911,71 +5905,6 @@ describe('SnapController', () => {
59115905 controller . destroy ( ) ;
59125906 } ) ;
59135907
5914- it ( 'does not grant the `endowment:caip25` permission to a Snap with `endowment:ethereum-provider` if the `useCaip25Permission` feature flag is disabled' , async ( ) => {
5915- const rootMessenger = getControllerMessenger ( ) ;
5916- const messenger = getSnapControllerMessenger ( rootMessenger ) ;
5917-
5918- rootMessenger . registerActionHandler (
5919- 'PermissionController:getPermissions' ,
5920- ( ) => ( { } ) ,
5921- ) ;
5922-
5923- rootMessenger . registerActionHandler (
5924- 'SelectedNetworkController:getNetworkClientIdForDomain' ,
5925- ( ) => 'mainnet' ,
5926- ) ;
5927-
5928- rootMessenger . registerActionHandler (
5929- 'NetworkController:getNetworkClientById' ,
5930- ( ) => ( {
5931- configuration : {
5932- chainId : '0x1' ,
5933- } ,
5934- } ) ,
5935- ) ;
5936-
5937- const { manifest } = await getMockSnapFilesWithUpdatedChecksum ( {
5938- manifest : getSnapManifest ( {
5939- initialPermissions : {
5940- 'endowment:page-home' : { } ,
5941- 'endowment:ethereum-provider' : { } ,
5942- } ,
5943- } ) ,
5944- } ) ;
5945-
5946- const snapController = getSnapController (
5947- getSnapControllerOptions ( {
5948- messenger,
5949- detectSnapLocation : loopbackDetect ( { manifest } ) ,
5950- featureFlags : {
5951- useCaip25Permission : false ,
5952- } ,
5953- } ) ,
5954- ) ;
5955-
5956- await snapController . installSnaps ( MOCK_ORIGIN , {
5957- [ MOCK_SNAP_ID ] : { } ,
5958- } ) ;
5959-
5960- const approvedPermissions = {
5961- 'endowment:page-home' : {
5962- caveats : null ,
5963- } ,
5964- 'endowment:ethereum-provider' : { } ,
5965- } ;
5966-
5967- expect ( messenger . call ) . toHaveBeenCalledWith (
5968- 'PermissionController:grantPermissions' ,
5969- {
5970- approvedPermissions,
5971- subject : { origin : MOCK_SNAP_ID } ,
5972- requestData : expect . any ( Object ) ,
5973- } ,
5974- ) ;
5975-
5976- snapController . destroy ( ) ;
5977- } ) ;
5978-
59795908 it ( 'does not grant the `endowment:caip25` permission if the Snap does not have the `endowment:ethereum-provider` permission' , async ( ) => {
59805909 const rootMessenger = getControllerMessenger ( ) ;
59815910 const messenger = getSnapControllerMessenger ( rootMessenger ) ;
@@ -6011,9 +5940,6 @@ describe('SnapController', () => {
60115940 getSnapControllerOptions ( {
60125941 messenger,
60135942 detectSnapLocation : loopbackDetect ( { manifest } ) ,
6014- featureFlags : {
6015- useCaip25Permission : true ,
6016- } ,
60175943 } ) ,
60185944 ) ;
60195945
0 commit comments