Skip to content

Commit

Permalink
Merge branch 'main' into hm/update-notification-example
Browse files Browse the repository at this point in the history
  • Loading branch information
hmalik88 committed Jan 10, 2025
2 parents 4886c48 + f21e859 commit 9ccf7b6
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
re-run:
name: Re-run failed jobs
needs: lint-build-test
if: failure() && fromJSON(github.run_attempt) < 3
if: failure() && fromJSON(github.run_attempt) < 3 && github.event.pull_request.user.login != 'dependabot[bot]'
runs-on: ubuntu-latest
permissions:
actions: write
Expand Down
4 changes: 2 additions & 2 deletions packages/snaps-controllers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@
"@metamask/json-rpc-middleware-stream": "^8.0.5",
"@metamask/key-tree": "^10.0.1",
"@metamask/object-multiplex": "^2.0.0",
"@metamask/permission-controller": "^11.0.3",
"@metamask/permission-controller": "^11.0.4",
"@metamask/phishing-controller": "^12.3.1",
"@metamask/post-message-stream": "^8.1.1",
"@metamask/post-message-stream": "^9.0.0",
"@metamask/rpc-errors": "^7.0.2",
"@metamask/snaps-registry": "^3.2.2",
"@metamask/snaps-rpc-methods": "workspace:^",
Expand Down
9 changes: 3 additions & 6 deletions packages/snaps-controllers/src/cronjob/CronjobController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ export class CronjobController extends BaseController<
CronjobControllerState,
CronjobControllerMessenger
> {
#messenger: CronjobControllerMessenger;

#dailyTimer!: Timer;

#timers: Map<string, Timer>;
Expand All @@ -147,7 +145,6 @@ export class CronjobController extends BaseController<
});
this.#timers = new Map();
this.#snapIds = new Map();
this.#messenger = messenger;

this._handleSnapRegisterEvent = this._handleSnapRegisterEvent.bind(this);
this._handleSnapUnregisterEvent =
Expand Down Expand Up @@ -227,7 +224,7 @@ export class CronjobController extends BaseController<
* @returns Array of Cronjob specifications.
*/
#getSnapJobs(snapId: SnapId): Cronjob[] | undefined {
const permissions = this.#messenger.call(
const permissions = this.messagingSystem.call(
'PermissionController:getPermissions',
snapId,
);
Expand Down Expand Up @@ -303,7 +300,7 @@ export class CronjobController extends BaseController<
*/
async #executeCronjob(job: Cronjob) {
this.#updateJobLastRunState(job.id, Date.now());
await this.#messenger.call('SnapController:handleRequest', {
await this.messagingSystem.call('SnapController:handleRequest', {
snapId: job.snapId,
origin: '',
handler: HandlerType.OnCronjob,
Expand Down Expand Up @@ -387,7 +384,7 @@ export class CronjobController extends BaseController<

const timer = new Timer(ms);
timer.start(() => {
this.#messenger
this.messagingSystem
.call('SnapController:handleRequest', {
snapId: event.snapId,
origin: '',
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-execution-environments/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"dependencies": {
"@metamask/json-rpc-engine": "^10.0.1",
"@metamask/object-multiplex": "^2.0.0",
"@metamask/post-message-stream": "^8.1.1",
"@metamask/post-message-stream": "^9.0.0",
"@metamask/providers": "^18.1.1",
"@metamask/rpc-errors": "^7.0.2",
"@metamask/snaps-sdk": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-rpc-methods/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
},
"dependencies": {
"@metamask/key-tree": "^10.0.1",
"@metamask/permission-controller": "^11.0.3",
"@metamask/permission-controller": "^11.0.4",
"@metamask/rpc-errors": "^7.0.2",
"@metamask/snaps-sdk": "workspace:^",
"@metamask/snaps-utils": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-sdk/src/types/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export type RequestedSnap = {

export type InitialPermissions = Partial<{
'endowment:cronjob': {
jobs: Cronjob[];
jobs?: Cronjob[];
maxRequestTime?: number;
};
'endowment:ethereum-provider': EmptyObject;
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-simulation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@metamask/json-rpc-engine": "^10.0.1",
"@metamask/json-rpc-middleware-stream": "^8.0.5",
"@metamask/key-tree": "^10.0.1",
"@metamask/permission-controller": "^11.0.3",
"@metamask/permission-controller": "^11.0.4",
"@metamask/phishing-controller": "^12.3.1",
"@metamask/snaps-controllers": "workspace:^",
"@metamask/snaps-execution-environments": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-simulator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@metamask/json-rpc-engine": "^10.0.1",
"@metamask/json-rpc-middleware-stream": "^8.0.5",
"@metamask/key-tree": "^10.0.1",
"@metamask/permission-controller": "^11.0.3",
"@metamask/permission-controller": "^11.0.4",
"@metamask/snaps-controllers": "workspace:^",
"@metamask/snaps-execution-environments": "workspace:^",
"@metamask/snaps-rpc-methods": "workspace:^",
Expand Down
4 changes: 2 additions & 2 deletions packages/snaps-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"@babel/types": "^7.23.0",
"@metamask/base-controller": "^7.0.2",
"@metamask/key-tree": "^10.0.1",
"@metamask/permission-controller": "^11.0.3",
"@metamask/permission-controller": "^11.0.4",
"@metamask/rpc-errors": "^7.0.2",
"@metamask/slip44": "^4.1.0",
"@metamask/snaps-registry": "^3.2.2",
Expand Down Expand Up @@ -110,7 +110,7 @@
"@metamask/eslint-config-jest": "^12.1.0",
"@metamask/eslint-config-nodejs": "^12.1.0",
"@metamask/eslint-config-typescript": "^12.1.0",
"@metamask/post-message-stream": "^8.1.1",
"@metamask/post-message-stream": "^9.0.0",
"@swc/core": "1.3.78",
"@swc/jest": "^0.2.26",
"@ts-bridge/cli": "^0.6.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-utils/src/manifest/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export const PermissionsStruct: Describe<InitialPermissions> = type({
'endowment:cronjob': optional(
mergeStructs(
HandlerCaveatsStruct,
object({ jobs: CronjobSpecificationArrayStruct }),
object({ jobs: optional(CronjobSpecificationArrayStruct) }),
),
),
'endowment:ethereum-provider': optional(EmptyObjectStruct),
Expand Down
38 changes: 19 additions & 19 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4162,7 +4162,7 @@ __metadata:
languageName: unknown
linkType: soft

"@metamask/controller-utils@npm:^11.4.1, @metamask/controller-utils@npm:^11.4.4":
"@metamask/controller-utils@npm:^11.4.4":
version: 11.4.4
resolution: "@metamask/controller-utils@npm:11.4.4"
dependencies:
Expand Down Expand Up @@ -5303,12 +5303,12 @@ __metadata:
languageName: node
linkType: hard

"@metamask/permission-controller@npm:^11.0.3":
version: 11.0.3
resolution: "@metamask/permission-controller@npm:11.0.3"
"@metamask/permission-controller@npm:^11.0.4":
version: 11.0.4
resolution: "@metamask/permission-controller@npm:11.0.4"
dependencies:
"@metamask/base-controller": "npm:^7.0.2"
"@metamask/controller-utils": "npm:^11.4.1"
"@metamask/controller-utils": "npm:^11.4.4"
"@metamask/json-rpc-engine": "npm:^10.0.1"
"@metamask/rpc-errors": "npm:^7.0.1"
"@metamask/utils": "npm:^10.0.0"
Expand All @@ -5318,7 +5318,7 @@ __metadata:
nanoid: "npm:^3.1.31"
peerDependencies:
"@metamask/approval-controller": ^7.0.0
checksum: 10/e90411ae34410176945e79c8e863ff2d78a12c01e98837a7298dc94d4815c65fec2cd338d4ae0026f91899acfe21bfe8b857a3b2f12c3d96719e5afb68df0e68
checksum: 10/89bc5c3ffbcddca8cd3a8fa1e73d4196544223b59f69ece549f7459198960e8068fd96412ee3b28353b2a53ea38d8c370bd14df937aebddceed6a87cb5652f8c
languageName: node
linkType: hard

Expand All @@ -5337,13 +5337,13 @@ __metadata:
languageName: node
linkType: hard

"@metamask/post-message-stream@npm:^8.1.1":
version: 8.1.1
resolution: "@metamask/post-message-stream@npm:8.1.1"
"@metamask/post-message-stream@npm:^9.0.0":
version: 9.0.0
resolution: "@metamask/post-message-stream@npm:9.0.0"
dependencies:
"@metamask/utils": "npm:^9.0.0"
"@metamask/utils": "npm:^11.0.1"
readable-stream: "npm:3.6.2"
checksum: 10/8218d321abe734522aefaf6b44e4203966c3feaf83e2de6e68eef9dbe92b7fb47fe7fd82eae362147b1d741cc58d78bcc95d8bf02058e260ad2fb978104c96cf
checksum: 10/5da711d3274e724452322939a5a77c60ed1d7ed73cdaa62e95c16debc443804d5a16de116dce742e05b3fbfa962e009dfeafc3a12a66f20e163617567f2cace5
languageName: node
linkType: hard

Expand Down Expand Up @@ -5720,9 +5720,9 @@ __metadata:
"@metamask/json-rpc-middleware-stream": "npm:^8.0.5"
"@metamask/key-tree": "npm:^10.0.1"
"@metamask/object-multiplex": "npm:^2.0.0"
"@metamask/permission-controller": "npm:^11.0.3"
"@metamask/permission-controller": "npm:^11.0.4"
"@metamask/phishing-controller": "npm:^12.3.1"
"@metamask/post-message-stream": "npm:^8.1.1"
"@metamask/post-message-stream": "npm:^9.0.0"
"@metamask/rpc-errors": "npm:^7.0.2"
"@metamask/snaps-registry": "npm:^3.2.2"
"@metamask/snaps-rpc-methods": "workspace:^"
Expand Down Expand Up @@ -5819,7 +5819,7 @@ __metadata:
"@metamask/eslint-config-typescript": "npm:^12.1.0"
"@metamask/json-rpc-engine": "npm:^10.0.1"
"@metamask/object-multiplex": "npm:^2.0.0"
"@metamask/post-message-stream": "npm:^8.1.1"
"@metamask/post-message-stream": "npm:^9.0.0"
"@metamask/providers": "npm:^18.1.1"
"@metamask/rpc-errors": "npm:^7.0.2"
"@metamask/snaps-sdk": "workspace:^"
Expand Down Expand Up @@ -5996,7 +5996,7 @@ __metadata:
"@metamask/eslint-config-typescript": "npm:^12.1.0"
"@metamask/json-rpc-engine": "npm:^10.0.1"
"@metamask/key-tree": "npm:^10.0.1"
"@metamask/permission-controller": "npm:^11.0.3"
"@metamask/permission-controller": "npm:^11.0.4"
"@metamask/rpc-errors": "npm:^7.0.2"
"@metamask/snaps-sdk": "workspace:^"
"@metamask/snaps-utils": "workspace:^"
Expand Down Expand Up @@ -6086,7 +6086,7 @@ __metadata:
"@metamask/json-rpc-engine": "npm:^10.0.1"
"@metamask/json-rpc-middleware-stream": "npm:^8.0.5"
"@metamask/key-tree": "npm:^10.0.1"
"@metamask/permission-controller": "npm:^11.0.3"
"@metamask/permission-controller": "npm:^11.0.4"
"@metamask/phishing-controller": "npm:^12.3.1"
"@metamask/snaps-controllers": "workspace:^"
"@metamask/snaps-execution-environments": "workspace:^"
Expand Down Expand Up @@ -6148,7 +6148,7 @@ __metadata:
"@metamask/json-rpc-engine": "npm:^10.0.1"
"@metamask/json-rpc-middleware-stream": "npm:^8.0.5"
"@metamask/key-tree": "npm:^10.0.1"
"@metamask/permission-controller": "npm:^11.0.3"
"@metamask/permission-controller": "npm:^11.0.4"
"@metamask/snaps-controllers": "workspace:^"
"@metamask/snaps-execution-environments": "workspace:^"
"@metamask/snaps-rpc-methods": "workspace:^"
Expand Down Expand Up @@ -6254,8 +6254,8 @@ __metadata:
"@metamask/eslint-config-nodejs": "npm:^12.1.0"
"@metamask/eslint-config-typescript": "npm:^12.1.0"
"@metamask/key-tree": "npm:^10.0.1"
"@metamask/permission-controller": "npm:^11.0.3"
"@metamask/post-message-stream": "npm:^8.1.1"
"@metamask/permission-controller": "npm:^11.0.4"
"@metamask/post-message-stream": "npm:^9.0.0"
"@metamask/rpc-errors": "npm:^7.0.2"
"@metamask/slip44": "npm:^4.1.0"
"@metamask/snaps-registry": "npm:^3.2.2"
Expand Down

0 comments on commit 9ccf7b6

Please sign in to comment.