Skip to content

test(utxo): add delete-account playwright step + DB helpers#110

Merged
AquiGorka merged 5 commits into
mainfrom
feat/utxo-key-delegation
Jun 4, 2026
Merged

test(utxo): add delete-account playwright step + DB helpers#110
AquiGorka merged 5 commits into
mainfrom
feat/utxo-key-delegation

Conversation

@AquiGorka

@AquiGorka AquiGorka commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Extend the full-flow playwright spec with a Step 13b that exercises DELETE /api/v1/account/me from the UI and asserts the pay_accounts row is hard-deleted via a direct DB query (not API).

What changed in this repo

DB helpersplaywright/helpers/db.ts

  • payAccountExists(walletPublicKey)EXISTS (SELECT 1 ...).
  • fetchEncryptedDelegationKey(walletPublicKey) — returns the stored ciphertext, null if the column isn't set, undefined if the row is gone. Used to assert the encrypted root was persisted at signup.

Specplaywright/tests/full-flow.spec.ts

  • New Step 13b after the existing Step 13: assert the row exists + has an encrypted delegation key, click the Delete-account button in moonlight-pay, accept the browser confirm dialog, wait for the /login redirect, then assert the pay_accounts row is gone.

Companion PRs

Test plan

  • ./test.sh playwright — 16/16 green in 6.5 min on this branch (when run with PAY_PLATFORM_PATH / MOONLIGHT_PAY_PATH pointing at the companion-PR branches).

Extends the full-flow spec with Step 13b — after the merchant verifies
the receive (Step 13), the merchant clicks Delete my account, then we
assert directly against pay_platform_db that the row is gone.

- playwright/helpers/db.ts: add payAccountExists +
  fetchEncryptedDelegationKey.
- playwright/tests/full-flow.spec.ts: pre-checks the row + delegation
  key exist, clicks the new UI button, accepts the confirm dialog,
  waits for /login redirect, then asserts the pay_accounts row is gone.
AquiGorka added 4 commits June 2, 2026 20:39
…ation-key

pay-platform's /utxo/receive endpoint was dropped in
Moonlight-Protocol/pay-platform#37; merchants now register a single
32-byte UTXO root and pay-platform derives receive UTXOs on demand
from it. The pos-instant e2e test was still POSTing 5 pre-generated
public keys to the gone endpoint and failing at Step 2.

Replace the 5-key generation + /utxo/receive POST with one random
32-byte root POSTed to /account/delegation-key. Same backend contract
as the production signup flow; the test bypasses the wallet UI, not
the contract.
…alance

pay-platform's instant-execute builds a privacy-hop bundle (deposit +
temp UTXOs + spends + merchant UTXOs) whose fee/balance accounting
requires substantial headroom in the funded wallets. The Friendbot
default grant is too tight and tx attempts fail with insufficient
funds before the bundle settles.

Use the standalone Friendbot `starting_balance` query param to fund
each test account with 1M XLM. POST method per the standalone
quickstart's Friendbot route (GET returns 405). Other Friendbot
deployments (testnet) also accept the param; the cap there is
enforced server-side and the request degrades gracefully.
Merchant-fee concept removed; OpEx registration no longer carries a
feePct field, and the merchant receives the full PAYMENT_STROOPS
(no 1% deduction).
@AquiGorka
AquiGorka merged commit b3bdb79 into main Jun 4, 2026
7 checks passed
@AquiGorka
AquiGorka deleted the feat/utxo-key-delegation branch June 4, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant