Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ The sections do not signal obligations; the prefixes do.

### Changed

- The `places` of a `fixed` or `ufixed` type may now be 0, as Solidity
allows. The minimum was 1 ([#420]).
- Schemas: **ethdebug/format/type/elementary/fixed**,
**ethdebug/format/type/elementary/ufixed**
- Producers: optional: a `fixed` or `ufixed` type may have `places: 0`.
- Consumers: required: the `minimum` of `places` is now 0. A consumer must
accept `places: 0`, which means the raw value is read unscaled.

- The members of a `define` no longer depend on their order, since JSON
objects are unordered. A member may use any other member of the same
`define`. Inside its own expression, its own name means the variable of the
Expand Down Expand Up @@ -763,3 +771,4 @@ First published version of the specification.
[#402]: https://github.com/ethdebug/format/pull/402
[#404]: https://github.com/ethdebug/format/pull/404
[#408]: https://github.com/ethdebug/format/pull/408
[#420]: https://github.com/ethdebug/format/pull/420
3 changes: 3 additions & 0 deletions packages/format/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ tracked in the root [`CHANGELOG.md`](../../CHANGELOG.md).
module load, and the package declares `"sideEffects": false`. A bundle
that imports only the types and guards no longer includes the `yaml`
library or the schema sources. The API is unchanged ([#373]).
- `Type.Elementary.isFixed` and `Type.Elementary.isUfixed` accept
`places: 0`. See the root [`CHANGELOG.md`](../../CHANGELOG.md) ([#420]).

## 0.1.0-draft.2 — 2026-10-07

Expand Down Expand Up @@ -156,6 +158,7 @@ First publication.
[#323]: https://github.com/ethdebug/format/pull/323
[#325]: https://github.com/ethdebug/format/pull/325
[#373]: https://github.com/ethdebug/format/pull/373
[#420]: https://github.com/ethdebug/format/pull/420
[`0ef2f37`]: https://github.com/ethdebug/format/commit/0ef2f37
[`10ab103`]: https://github.com/ethdebug/format/commit/10ab103
[`21e532e`]: https://github.com/ethdebug/format/commit/21e532e
Expand Down
4 changes: 2 additions & 2 deletions packages/format/src/types/type/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export namespace Type {
value.bits % 8 === 0 &&
"places" in value &&
typeof value.places === "number" &&
value.places >= 1 &&
value.places >= 0 &&
value.places <= 80;

export interface Fixed {
Expand All @@ -180,7 +180,7 @@ export namespace Type {
value.bits % 8 === 0 &&
"places" in value &&
typeof value.places === "number" &&
value.places >= 1 &&
value.places >= 0 &&
value.places <= 80;

export interface Bool {
Expand Down
5 changes: 4 additions & 1 deletion schemas/type/elementary/fixed.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ properties:
description:
How many decimal places, implying that a raw value `v` of this type
should be interpreted as `v / (10**places)`
minimum: 1
minimum: 0
maximum: 80
required:
- kind
Expand All @@ -30,3 +30,6 @@ examples:
- kind: fixed
bits: 256
places: 10
- kind: fixed
bits: 64
places: 0
5 changes: 4 additions & 1 deletion schemas/type/elementary/ufixed.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ properties:
description:
How many decimal places, implying that a raw value `v` of this type
should be interpreted as `v / (10**places)`
minimum: 1
minimum: 0
maximum: 80
required:
- kind
Expand All @@ -30,3 +30,6 @@ examples:
- kind: ufixed
bits: 256
places: 10
- kind: ufixed
bits: 64
places: 0
Loading