diff --git a/packages/marshal/src/encodePassable.js b/packages/marshal/src/encodePassable.js index 40369cb1ff..c24dc48be9 100644 --- a/packages/marshal/src/encodePassable.js +++ b/packages/marshal/src/encodePassable.js @@ -530,8 +530,8 @@ export const makeEncodePassable = (encodeOptions = {}) => { } }; const encodePassable = xxx - ? // A leading "#" indicates the v2 encoding (with escaping in strings rather than arrays). - passable => `#${innerEncode(passable)}` + ? // A leading "~" indicates the v2 encoding (with escaping in strings rather than arrays). + passable => `~${innerEncode(passable)}` : innerEncode; return harden(encodePassable); }; @@ -618,8 +618,8 @@ export const makeDecodePassable = (decodeOptions = {}) => { return innerDecode; }; const decodePassable = encoded => { - // A leading "#" indicates the v2 encoding (with escaping in strings rather than arrays). - if (encoded.startsWith('#')) { + // A leading "~" indicates the v2 encoding (with escaping in strings rather than arrays). + if (encoded.startsWith('~')) { const innerDecode = makeInnerDecode( decodeStringWithEscapes, decodeArrayWithoutEscapes, diff --git a/packages/marshal/test/test-encodePassable.js b/packages/marshal/test/test-encodePassable.js index 031cda5842..ee464131e3 100644 --- a/packages/marshal/test/test-encodePassable.js +++ b/packages/marshal/test/test-encodePassable.js @@ -133,10 +133,10 @@ const goldenPairs = harden([ test('golden round trips', t => { for (const [k, e] of goldenPairs) { t.is(encodePassable(k), e, 'does k encode as expected'); - t.is(encodePassable2(k), `#${e}`, 'does k small-encode as expected'); + t.is(encodePassable2(k), `~${e}`, 'does k small-encode as expected'); t.is(decodePassable(e), k, 'does the key round trip through the encoding'); t.is( - decodePassable(`#${e}`), + decodePassable(`~${e}`), k, 'does the small-encoded key round trip through the encoding', );