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.
This commit is contained in:
Brennan Benson
2026-08-28 02:49:24 -07:00
parent 810b6ba71d
commit b5c3215645
+3 -1
View File
@@ -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 {