From b5c3215645f2cedd54dab1726da8ef32d0bb8328 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Fri, 28 Aug 2026 02:49:24 -0700 Subject: [PATCH] test(relay): mirror production epoch escaping in testPtyId The harness built the expected id without the encodeURIComponent production applies at the mint site. A test epoch carrying a reserved character would diverge silently across ~40 assertions in 11 files. --- src/relay/pty-handler-test-harness.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/relay/pty-handler-test-harness.ts b/src/relay/pty-handler-test-harness.ts index 4a82aada197..e3d99213ea5 100644 --- a/src/relay/pty-handler-test-harness.ts +++ b/src/relay/pty-handler-test-harness.ts @@ -6,8 +6,10 @@ import type { RelayDispatcher } from './dispatcher' export const TEST_PTY_ID_MINT_EPOCH = 'test-mint-epoch' +// Why encoded: production escapes the epoch at the mint site. A test epoch with a +// reserved character would otherwise diverge silently across ~40 assertions. export function testPtyId(sequence: number): string { - return `pty2:${TEST_PTY_ID_MINT_EPOCH}:${sequence}` + return `pty2:${encodeURIComponent(TEST_PTY_ID_MINT_EPOCH)}:${sequence}` } export function createTestPtyHandler(dispatcher: MockDispatcher): PtyHandler {