Skip to content

Commit f5ae1ef

Browse files
FrederikBoldingPatrykLucka
authored andcommitted
fix: Make jobs property fully optional in the cronjob endowment (#3005)
Make the `jobs` property fully optional in the cronjob endowment since it is also allowed to be empty. We accounted for and discussed this in #2941, but must have forgotten to allow `endowment:cronjob: {}`.
1 parent 77bfdd9 commit f5ae1ef

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/snaps-sdk/src/types/permissions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export type RequestedSnap = {
3939

4040
export type InitialPermissions = Partial<{
4141
'endowment:cronjob': {
42-
jobs: Cronjob[];
42+
jobs?: Cronjob[];
4343
maxRequestTime?: number;
4444
};
4545
'endowment:ethereum-provider': EmptyObject;

packages/snaps-utils/src/manifest/validation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export const PermissionsStruct: Describe<InitialPermissions> = type({
191191
'endowment:cronjob': optional(
192192
mergeStructs(
193193
HandlerCaveatsStruct,
194-
object({ jobs: CronjobSpecificationArrayStruct }),
194+
object({ jobs: optional(CronjobSpecificationArrayStruct) }),
195195
),
196196
),
197197
'endowment:ethereum-provider': optional(EmptyObjectStruct),

0 commit comments

Comments
 (0)