Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ src/
│ ├── dapi.ts # JSON-RPC client (mainnet InstantSend locks, best chain lock)
│ ├── dapi-subscription.ts # DAPI bloom-filter stream (testnet/devnet InstantSend locks)
│ ├── islock.ts # IslockService: picks the InstantSend lock source per network
│ └── evonodes.ts # Live testnet evonode list (static list in config.ts is the fallback)
│ ├── evonode-discovery.ts # Testnet evonodes from the masternode list the seeds serve
│ └── evonodes.ts # Quorum-service evonode list (discovery fallback)
├── platform/ # Dash Platform operations
│ ├── identity.ts # Identity registration and top-up
│ └── login.ts # Sign in with Dash: key checks and signing
Expand Down Expand Up @@ -87,7 +88,7 @@ Network is determined by URL parameter: `?network=mainnet` (defaults to testnet)
InstantSend lock source and Platform status per network:

- **mainnet**: JSON-RPC at `rpc.digitalcash.dev` (`rpcUrl` in `config.ts`).
- **testnet**: no JSON-RPC service (trpc.digitalcash.dev never upgraded to Core V24). The lock comes from the DAPI bloom-filter stream on evonodes, discovered from the quorum service at init with the static `dapiAddresses` as fallback. Platform status is read through the EvoSDK (`platform/status.ts`) because dapi-client's `platform.getStatus()` throws on testnet nodes.
- **testnet**: no JSON-RPC service (trpc.digitalcash.dev never upgraded to Core V24). The lock comes from the DAPI bloom-filter stream on 3 evonodes at once. They are discovered when a funding flow starts, from the masternode list served by `@dashevo/dapi-client`'s testnet seeds, with the quorum service list as fallback; the subscription rejects before broadcast if both fail. There is no built-in node list. Platform status is read through the EvoSDK (`platform/status.ts`) because dapi-client's `platform.getStatus()` throws on testnet nodes.
- **devnets**: their configured `rpcUrl` if any, otherwise the DAPI stream over their `dapiAddresses`; Platform status through dapi-client.

## Dependencies
Expand Down
32 changes: 12 additions & 20 deletions e2e/deterministic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,42 +28,34 @@ async function advanceMockDeposit(page: Page) {
}

test.describe('Deterministic UI E2E (mock mode)', () => {
test('testnet discovers evonodes from the quorum service, never calls digitalcash.dev and does not load the SDK for the health poll', async ({ page }) => {
test('an idle testnet page never calls digitalcash.dev, starts no evonode discovery and does not load the SDK for the health poll', async ({ page }) => {
const digitalcashRequests: string[] = [];
const sdkRequests: string[] = [];
const discoveryRequests: string[] = [];
page.on('request', (request) => {
const url = new URL(request.url());
if (/(^|\.)digitalcash\.dev$/.test(url.hostname)) digitalcashRequests.push(request.url());
// The EvoSDK bundle/wasm must not be fetched just to draw the health indicator.
if (/evo-sdk|wasm[-_]sdk/i.test(url.pathname)) sdkRequests.push(request.url());
// Evonode discovery (masternode list from the seeds, quorum-service
// fallback) starts with a funding flow, not on page load.
if (/^seed-\d+\./.test(url.hostname) || url.pathname === '/masternodes') {
discoveryRequests.push(request.url());
}
});
await page.route('https://quorums.testnet.networks.dash.org/masternodes', (route) =>
route.fulfill({
status: 200,
contentType: 'application/json',
headers: { 'access-control-allow-origin': '*' },
body: JSON.stringify({
success: true,
data: [1, 2, 3].map((n) => ({
address: `203.0.113.${n}:19999`,
status: 'ENABLED',
versionCheck: 'success',
})),
}),
})
);

// Client init (warmup) fetches the evonode list and starts network-status polling.
const evonodeRequest = page.waitForRequest('https://quorums.testnet.networks.dash.org/masternodes', {

// Client init (warmup) loads the IS lock chunk and starts network-status polling.
const islockChunk = page.waitForRequest((request) => /\/islock(-[^/]*\.js|\.ts)$/.test(new URL(request.url()).pathname), {
timeout: 15000,
});
await page.goto(MOCK_QUERY);
await evonodeRequest;
await islockChunk;
// Let the first network-status poll (Insight + Platform status) go out.
await page.waitForTimeout(2000);

expect(digitalcashRequests).toEqual([]);
expect(sdkRequests).toEqual([]);
expect(discoveryRequests).toEqual([]);
});

test('create identity flow transitions to completion and DPNS registration', async ({ page }) => {
Expand Down
Loading
Loading