Skip to content

Commit e2b3211

Browse files
hmalik88FrederikBolding
authored andcommitted
Feat: Integrate snap background events (#29641)
## **Description** Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? New background events feature. 2. What is the improvement/solution? Added code to integrate the new feature. ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** ### **Before** ### **After** ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
1 parent 7f01b9d commit e2b3211

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

app/scripts/metamask-controller.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6357,11 +6357,26 @@ export default class MetamaskController extends EventEmitter {
63576357
currency: fiatCurrency,
63586358
};
63596359
},
6360-
///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps)
63616360
hasPermission: this.permissionController.hasPermission.bind(
63626361
this.permissionController,
63636362
origin,
63646363
),
6364+
scheduleBackgroundEvent: (event) =>
6365+
this.controllerMessenger.call(
6366+
'CronjobController:scheduleBackgroundEvent',
6367+
{ ...event, snapId: origin },
6368+
),
6369+
cancelBackgroundEvent: this.controllerMessenger.call.bind(
6370+
this.controllerMessenger,
6371+
'CronjobController:cancelBackgroundEvent',
6372+
origin,
6373+
),
6374+
getBackgroundEvents: this.controllerMessenger.call.bind(
6375+
this.controllerMessenger,
6376+
'CronjobController:getBackgroundEvents',
6377+
origin,
6378+
),
6379+
///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps)
63656380
handleSnapRpcRequest: (args) =>
63666381
this.handleSnapRequest({ ...args, origin }),
63676382
getAllowedKeyringMethods: keyringSnapPermissionsBuilder(

0 commit comments

Comments
 (0)