From 91e69c315b76cbee6034259fb6211d215b08e435 Mon Sep 17 00:00:00 2001 From: Pavel Grigorenko Date: Fri, 4 Sep 2026 16:46:08 +0200 Subject: [PATCH] fix(e2e): import the shared trustbase URL instead of the deleted testnet.json Three suites hardcoded the raw URL of bft-trustbase.testnet.json, deleted upstream as obsolete, and throw on a non-200 -- so each fails at setup with "Failed to download trustbase: 404". The deletion only revealed the defect. That file declared networkId 3 (the retired v1 testnet) while all three pass network: 'testnet', which since #765 aliases testnet2, networkId 4. The oracle derives the engine's network id from the file at trustBasePath, so the engine was being built for a network the gateway does not serve. tests/e2e/support/staging.ts already exports the correct, env-overridable TRUSTBASE_URL (testnet2, networkId 4). Import it -- one definition instead of four, and the network mismatch goes with it. Closes #775 --- tests/e2e/dm-manual.test.ts | 4 +++- tests/e2e/dm-nip17.test.ts | 4 +++- tests/e2e/wallet-clear.test.ts | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/e2e/dm-manual.test.ts b/tests/e2e/dm-manual.test.ts index 50c6df54..e8c6677b 100644 --- a/tests/e2e/dm-manual.test.ts +++ b/tests/e2e/dm-manual.test.ts @@ -13,10 +13,12 @@ import { mkdirSync, rmSync, existsSync, writeFileSync } from 'node:fs'; import { join } from 'node:path'; import { tmpdir } from 'node:os'; import type { DirectMessage } from '../../types'; +// One definition (env-overridable): three local copies all named the deleted v1 +// file, whose networkId 3 stopped matching `network: 'testnet'` at the cutover. +import { TRUSTBASE_URL } from './support/staging'; const rand = () => Math.random().toString(36).slice(2, 8); -const TRUSTBASE_URL = 'https://raw.githubusercontent.com/unicitynetwork/unicity-ids/refs/heads/main/bft-trustbase.testnet.json'; const DEFAULT_API_KEY = 'sk_06365a9c44654841a366068bcfc68986'; // Timeout for waiting for DM (60 seconds) diff --git a/tests/e2e/dm-nip17.test.ts b/tests/e2e/dm-nip17.test.ts index 5a3d54a6..074b455c 100644 --- a/tests/e2e/dm-nip17.test.ts +++ b/tests/e2e/dm-nip17.test.ts @@ -16,10 +16,12 @@ import { mkdirSync, rmSync, existsSync, writeFileSync } from 'node:fs'; import { join } from 'node:path'; import { tmpdir } from 'node:os'; import type { DirectMessage } from '../../types'; +// One definition (env-overridable): three local copies all named the deleted v1 +// file, whose networkId 3 stopped matching `network: 'testnet'` at the cutover. +import { TRUSTBASE_URL } from './support/staging'; const rand = () => Math.random().toString(36).slice(2, 8); -const TRUSTBASE_URL = 'https://raw.githubusercontent.com/unicitynetwork/unicity-ids/refs/heads/main/bft-trustbase.testnet.json'; const DEFAULT_API_KEY = 'sk_06365a9c44654841a366068bcfc68986'; function makeTempDirs(label: string) { diff --git a/tests/e2e/wallet-clear.test.ts b/tests/e2e/wallet-clear.test.ts index e0f48cc7..4821d12f 100644 --- a/tests/e2e/wallet-clear.test.ts +++ b/tests/e2e/wallet-clear.test.ts @@ -22,10 +22,12 @@ import { STORAGE_KEYS_GLOBAL } from '../../constants'; import { mkdirSync, rmSync, existsSync, writeFileSync } from 'node:fs'; import { join } from 'node:path'; import { tmpdir } from 'node:os'; +// One definition (env-overridable): three local copies all named the deleted v1 +// file, whose networkId 3 stopped matching `network: 'testnet'` at the cutover. +import { TRUSTBASE_URL } from './support/staging'; const rand = () => Math.random().toString(36).slice(2, 8); -const TRUSTBASE_URL = 'https://raw.githubusercontent.com/unicitynetwork/unicity-ids/refs/heads/main/bft-trustbase.testnet.json'; const DEFAULT_API_KEY = 'sk_06365a9c44654841a366068bcfc68986'; function makeTempDirs(label: string) {