diff --git a/e2e/global-setup.ts b/e2e/global-setup.ts index f1fd4b1..d88f071 100644 --- a/e2e/global-setup.ts +++ b/e2e/global-setup.ts @@ -1,3 +1,4 @@ +/// import { chromium } from '@playwright/test'; import { execSync } from 'child_process'; diff --git a/e2e/helpers/MintMocker.ts b/e2e/helpers/MintMocker.ts index 53888f6..0594393 100644 --- a/e2e/helpers/MintMocker.ts +++ b/e2e/helpers/MintMocker.ts @@ -1,7 +1,7 @@ import type { Page, Route } from '@playwright/test'; import { hashK1, noteSignatureDigestForHash } from 'lnurlcash-kit'; import { secp256k1 } from '@noble/curves/secp256k1.js'; -import { bytesToHex, hexToBytes } from '@noble/hashes/utils.js'; +import { bytesToHex } from '@noble/hashes/utils.js'; import { sha256 } from '@noble/hashes/sha2.js'; import { utf8ToBytes } from '@noble/hashes/utils.js'; @@ -312,11 +312,7 @@ export class MintMocker { // nodeCapacityMsat, which is exactly the 0.1.0 spread bug this exercises. // The payLink points back at the lnurlp route below, as prepareMint treats // it as the authoritative place to read the payRequest from. - private async mockMintAddress( - options: MockTargetMintOptions, - origin: string, - mintPubkey: string, - ): Promise { + private async mockMintAddress(origin: string, mintPubkey: string): Promise { await this.page.route( new RegExp(`^${escapeRegExp(`${origin}/.well-known/lnurlw/`)}`), async (route: Route) => { @@ -344,7 +340,7 @@ export class MintMocker { const mintPubkey = options.mintPubkey ?? this.signingPubkey(origin); let stagedHash: string | null = null; let settled = false; - await this.mockMintAddress(options, origin, mintPubkey); + await this.mockMintAddress(origin, mintPubkey); await this.mockMutationEndpoint(origin); await this.page.route( new RegExp(`^${escapeRegExp(origin + NOTE_PATH)}\\?`), diff --git a/e2e/specs/move-funds.spec.ts b/e2e/specs/move-funds.spec.ts index ebd7530..0adcb52 100644 --- a/e2e/specs/move-funds.spec.ts +++ b/e2e/specs/move-funds.spec.ts @@ -1,7 +1,7 @@ import { test, expect } from '../fixtures'; import type { Page } from '@playwright/test'; import { MINT2_ORIGIN } from '../helpers/MintMocker'; -import { createFreshWallet, fundMockMintWallet } from '../helpers/wallet'; +import { fundMockMintWallet } from '../helpers/wallet'; const AMOUNT_MSAT = 50_000; // 50 sats // 64 hex chars - a valid payment receipt, distinct from the claimed note secret diff --git a/e2e/specs/nwc.spec.ts b/e2e/specs/nwc.spec.ts index f958d29..789c2ca 100644 --- a/e2e/specs/nwc.spec.ts +++ b/e2e/specs/nwc.spec.ts @@ -212,7 +212,7 @@ test.describe('NWC settings page', () => { // NIP-47 client sends: kind 23194, NIP-04 encrypted to the service, // schnorr-signed by the connection's client secret const invoice = 'lnbc210n1pjqrstuvwxyz'; - const content = await nip04Encrypt( + const content = nip04Encrypt( clientSecret, walletServicePubkey, JSON.stringify({ method: 'pay_invoice', params: { invoice } }), @@ -254,7 +254,7 @@ test.describe('NWC settings page', () => { ); if (!responseEvent) throw new Error('the service published no response'); const response: unknown = JSON.parse( - await nip04Decrypt(clientSecret, walletServicePubkey, responseEvent.content), + nip04Decrypt(clientSecret, walletServicePubkey, responseEvent.content), ); if (typeof response !== 'object' || response === null) { throw new Error('the service response is not an object'); diff --git a/e2e/specs/send.spec.ts b/e2e/specs/send.spec.ts index 4710dbd..4f28698 100644 --- a/e2e/specs/send.spec.ts +++ b/e2e/specs/send.spec.ts @@ -7,7 +7,6 @@ import { noteSignature, verifyNoteSignature, } from 'lnurlcash-kit'; -import { MINT_ORIGIN } from '../helpers/MintMocker'; import { fundMockMintWallet } from '../helpers/wallet'; const FUNDING_MSAT = 50_000; // 50 sats diff --git a/e2e/specs/trusted-mint-tabs.spec.ts b/e2e/specs/trusted-mint-tabs.spec.ts index d9a60de..444cabd 100644 --- a/e2e/specs/trusted-mint-tabs.spec.ts +++ b/e2e/specs/trusted-mint-tabs.spec.ts @@ -3,6 +3,14 @@ import type { Page, TestInfo } from '@playwright/test'; import { test, expect } from '../fixtures'; import { createFreshWallet } from '../helpers/wallet'; +// the dev-only lifecycle hook (boot/wallet.ts) used to drive the forget +// transition, which has no UI surface +declare global { + interface Window { + __sattleWalletTest: { state: () => string; forget: () => Promise }; + } +} + const MINT_KEY_A = `02${'aa'.repeat(32)}`; const MINT_KEY_B = `03${'bb'.repeat(32)}`; const MINT_KEY_C = `02${'cc'.repeat(32)}`;