You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fixup! feat(marshal,pass-style): admit immutable ArrayBuffer through codecs
Apply the relevant feedback from #2871 to subsume that PR:
- @gibson042#2871:byteArray.js:127 — `uint8ArrayToByteArray` now
honors the source `Uint8Array`'s `byteOffset` and `length`, so a
view over a slice of a larger buffer round-trips correctly:
`uint8ArrayToByteArray(new Uint8Array(buf, byteOffset, length))`
represents exactly the bytes in `[byteOffset, byteOffset + length)`.
Documented the zero-copy / copy tradeoff with `sliceToImmutable`.
- @gibson042#2871:byteArray.js:130 — comment on `byteArrayToHex` /
`hexToByteArray` is now phrased as "Like `encodeHex` but…" /
"Like `decodeHex` but…", matching gibson's suggested wording for
the byteArray-flavored wrappers.
- @erights#2871:encodeToCapData.js:453 / encodeToSmallcaps.js — the
factory functions `makeDecodeFromCapData` and
`makeDecodeFromSmallcaps` are now `harden`-ed at module scope,
matching the existing harden of their encoder counterparts
(`makeEncodeToCapData`, `makeEncodeToSmallcaps`).
- @erights#2871:marshal-test-data.js — propagate Mark's full
byteArray fixture set: `roundTripPairs`, `jsonJustinPairs`,
`unsortedSample`, and `sortedSample`. The Justin test compartment
exposes `hexToByteArray` so the rendered Justin expression
evaluates.
Not propagated, deliberately:
- `packages/marshal/src/rankOrder.js` — Mark's
`compareRankRemotablesTied` refactor is orthogonal to codec
admission and lands as its own PR (bots #73 today, awaiting an
upstream PR).
- `packages/pass-style/src/hex.js` — Mark vendored a private hex
implementation in pass-style; we route through the merged
`@endo/hex` package (#3208) instead. As a result,
`packages/pass-style/index.js` exports `byteArrayToHex` /
`hexToByteArray` but not `uint8ArrayToHex` / `hexToUint8Array`;
consumers needing raw hex helpers should
`import { encodeHex, decodeHex } from '@endo/hex'`.
Tests: `@endo/marshal` 79 + 1 skip, `@endo/pass-style` 29. Lint clean.
0 commit comments