-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from ethdebug/data
Define schemas for data types (hex strings e.g.)
- Loading branch information
Showing
14 changed files
with
107 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"label": "ethdebug/format/data", | ||
"position": 5, | ||
"link": { | ||
"type": "generated-index", | ||
"description": "Work-in-progress formal schema for ethdebug format" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
import SchemaViewer from "@site/src/components/SchemaViewer"; | ||
|
||
# Hexadecimal strings | ||
|
||
<SchemaViewer | ||
schema={{ id: "schema:ethdebug/format/data/hex" }} | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# Overview | ||
|
||
:::tip[Summary] | ||
|
||
**ethdebug/format/data** is a namespace for schemas that define canonical | ||
representations of specific data types, such as hexadecimal strings and | ||
unsigned integers. | ||
|
||
Schemas in this namespace exist so that the rest of **ethdebug/format** has | ||
a consistent way of representing these types. | ||
|
||
::: | ||
|
||
## Reading these schemas | ||
|
||
The **ethdebug/format/data** namespace is not a schema itself, but rather | ||
a collection of closely-related schemas. | ||
|
||
These schemas (like all schemas in this format) are specified as | ||
[JSON Schema](https://json-schema.org), draft 2020-12. | ||
|
||
Please refer to the following resources in this section, or see the navigation | ||
bar for complete contents. | ||
|
||
- [Hexadecimal strings](/spec/data/hex) | ||
- [Unsigned integer](/spec/data/unsigned) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
sidebar_position: 3 | ||
--- | ||
|
||
import SchemaViewer from "@site/src/components/SchemaViewer"; | ||
|
||
# Unsigned integers | ||
|
||
<SchemaViewer | ||
schema={{ id: "schema:ethdebug/format/data/unsigned" }} | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
$schema: "https://json-schema.org/draft/2020-12/schema" | ||
$id: "schema:ethdebug/format/data/hex" | ||
|
||
title: ethdebug/format/data/hex | ||
description: | | ||
A `0x`-prefixed hexadecimal string. This value **must** contain at least one | ||
hexadecimal character (`0x` by itself is not allowed). | ||
type: string | ||
pattern: "^0x[0-9a-fA-F]{1,}$" | ||
|
||
examples: | ||
- "0x0000" | ||
- "0x1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
$schema: "https://json-schema.org/draft/2020-12/schema" | ||
$id: "schema:ethdebug/format/data/unsigned" | ||
|
||
title: ethdebug/format/data/unsigned | ||
description: | | ||
A non-negative integer encoded as a JSON number. | ||
type: integer | ||
minimum: 0 | ||
|
||
examples: | ||
- 0 | ||
- 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ properties: | |
kind: | ||
const: int | ||
bits: | ||
type: number | ||
type: integer | ||
multipleOf: 8 | ||
minimum: 8 | ||
maximum: 256 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters