-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: emit smallcaps-format data in all marshallers
This changes every `makeMarshal()` instance which performs object graph serialization to add the `{serializeBodyFormat: 'smallcaps'}` option. All emitted data will be in the "smallcaps" format, which is more concise (less overhead). For example, `1n` (a BigInt) is encoded as `#"+1"` instead of `{"@qclass":"bigint","digits":"1"}`. The old format was JSON except with those special `@qclass` objects to capture everything that JSON could not, including object references ("slots"). The new format is a leading `#` prefix, plus JSON, except that all the special cases are expressed as strings. Most significantly, this changes the format of the data we publish to `chainStorage`. The old format encoded simple data as mostly JSON, so bespoke parsers mostly worked, but even BigInts required special handling. Off-chain followers who perform RPC queries to the chain are highly encouraged to use the `@endo/marshal` library (or equivalent) to parse the data. This library can understand old-format data too, such as chain data published before this upgrade. Notable changes: * Many ad-hoc serializers were replaced with a real `makeMarshal`, which requires hardened inputs, so some new `harden()` calls were added * Some marshallers which only perform unserialization (`fromCapData`) were not modified * All unit tests which compared serialized data against manually-constructed examples had their examples updated * Previously, the `makeMockChainStorageRoot()` utility parsed Far/Remotable objects into an object with `{ iface }`. Now, it is unserialized into actual Remotables. Both `t.deepEqual` and `t.snapshot` will correctly compare the `iface` values of two Far objects, so tests should simply construct a `Far(iface)` and include it in the specimen data. As a result, many `t.snapshot`-style tests had their snapshot data changed. refs #6822 Co-authored-by: Chip Morningstar <[email protected]>
- Loading branch information
Showing
39 changed files
with
409 additions
and
622 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
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
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
Binary file modified
BIN
-28 Bytes
(97%)
packages/governance/test/unitTests/snapshots/test-committee.js.snap
Binary file not shown.
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
Oops, something went wrong.