diff options
| author | Adam Soltys <[email protected]> | 2026-07-03 19:27:34 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-07-03 19:27:34 -0700 |
| commit | c8d384ebfe760682fe9ba3bcdcc31276df352929 (patch) | |
| tree | 93033da239e9642978e7bc36b24bd38c719a5780 /tools/ark | |
| parent | fd5306a3091e14904c06c09b03bb59ca7ea597de (diff) | |
| download | coinosv3-c8d384ebfe760682fe9ba3bcdcc31276df352929.tar.gz coinosv3-c8d384ebfe760682fe9ba3bcdcc31276df352929.zip | |
Ark: connect lazily — only dial the server once the wallet uses Ark
Opening a wallet no longer contacts the ASP unless it already holds
vtxos / history / unfinished operations. Fresh wallets connect on first
use instead: selecting Ark on the Receive tab, confirming an Ark send,
or the Connect button on the Settings card. connectArk() is idempotent
and generation-guarded against wallet switches mid-dial.
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QFAcD4V284DvYZZHP7Rxxy
Diffstat (limited to 'tools/ark')
| -rw-r--r-- | tools/ark/ui-test.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/ark/ui-test.js b/tools/ark/ui-test.js index 006c7eb..1d36b06 100644 --- a/tools/ark/ui-test.js +++ b/tools/ark/ui-test.js @@ -104,7 +104,7 @@ try { // --- receive over ark --- console.log('\n[2] receive over Ark'); await page.select('select', 'ark'); - await sleep(300); + check('lazy connect on first use', await waitText('tark1', 15000)); const arkAddr = await page.evaluate(() => document.querySelector('.addr-box')?.textContent.trim() || ''); check('ark address shown', /^tark1[a-z0-9]+$/.test(arkAddr), arkAddr.slice(0, 24) + '…'); sh(`${ALICE} -q send ${arkAddr} "25000 sat"`); @@ -172,7 +172,14 @@ try { return false; })(); check('refresh consolidated to 1 coin', done, String(await labeledNumber('coins (vtxos)'))); - console.log(` final ark balance: ${await labeledNumber('ark balance')} sats`); + const finalBal = await labeledNumber('ark balance'); + console.log(` final ark balance: ${finalBal} sats`); + + // --- reload: a wallet holding vtxos reconnects on its own --- + console.log('\n[6] reload auto-connects (has vtxos)'); + await page.reload({ waitUntil: 'domcontentloaded' }); + check('ark balance back without interaction', await waitLabeledNumber('ark balance', finalBal, 20000), + String(await labeledNumber('ark balance'))); console.log(ok ? '\n✅ SUCCESS: Ark UI — receive, send, board, refresh all work in the browser' : '\n❌ some checks failed'); |
