Skip to content

Commit cb53931

Browse files
authored
Merge pull request #145 from ethdebug/nullable-contexts
Allow empty context objects and treat omitted `"context"` properties as equivalent to empty values
2 parents 985aa7e + 8ee2824 commit cb53931

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

schemas/program.schema.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ properties:
3838
description: |
3939
The context known to exist prior to the execution of the first
4040
instruction in the bytecode.
41+
42+
This field is **optional**. Omitting it is equivalent to specifying the
43+
empty context value (`{}`).
4144
$ref: "schema:ethdebug/format/program/context"
45+
default: {}
4246

4347
instructions:
4448
type: array

schemas/program/context.schema.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ anyOf:
1313
- $ref: "schema:ethdebug/format/program/context/variables"
1414
- $ref: "schema:ethdebug/format/program/context/remark"
1515

16-
minProperties: 1
1716
unevaluatedProperties: false
1817

1918
examples:

schemas/program/instruction.schema.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,14 @@ properties:
4343
context:
4444
description: |
4545
The context known to exist following the execution of this instruction.
46+
47+
This field is **optional**. Omitting it is equivalent to specifying the
48+
empty context value (`{}`).
4649
$ref: "schema:ethdebug/format/program/context"
50+
default: {}
4751

4852
required:
4953
- offset
50-
- context
5154

5255
examples:
5356
- offset: 0

0 commit comments

Comments
 (0)