Skip to content

Commit 399dbee

Browse files
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 71ab7c3 commit 399dbee

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
@@ -37,7 +37,7 @@ export type RequestedSnap = {
3737

3838
export type InitialPermissions = Partial<{
3939
'endowment:cronjob': {
40-
jobs: Cronjob[];
40+
jobs?: Cronjob[];
4141
maxRequestTime?: number;
4242
};
4343
'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)