test(utxo): add delete-account playwright step + DB helpers#110
Merged
Conversation
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
force-pushed
the
feat/utxo-key-delegation
branch
from
June 2, 2026 20:21
7b009ab to
4ff34c3
Compare
…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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extend the full-flow playwright spec with a Step 13b that exercises
DELETE /api/v1/account/mefrom the UI and asserts thepay_accountsrow is hard-deleted via a direct DB query (not API).What changed in this repo
DB helpers —
playwright/helpers/db.tspayAccountExists(walletPublicKey)—EXISTS (SELECT 1 ...).fetchEncryptedDelegationKey(walletPublicKey)— returns the stored ciphertext,nullif the column isn't set,undefinedif the row is gone. Used to assert the encrypted root was persisted at signup.Spec —
playwright/tests/full-flow.spec.ts/loginredirect, then assert thepay_accountsrow is gone.Companion PRs
Test plan
./test.sh playwright— 16/16 green in 6.5 min on this branch (when run withPAY_PLATFORM_PATH/MOONLIGHT_PAY_PATHpointing at the companion-PR branches).