aboutsummaryrefslogtreecommitdiffstats
path: root/tools/ark/ln-test.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-07 08:21:47 -0700
committerAdam Soltys <[email protected]>2026-10-07 08:21:47 -0700
commit90d0396819ddfbabb8b7f45e8fc3ac0992a6b014 (patch)
treeadb0aeb5e1919fb93838491168b2647160e88a07 /tools/ark/ln-test.js
parentbba8280a241ce86b0f372818d7aca85073d8e53a (diff)
downloadcoinosv3-90d0396819ddfbabb8b7f45e8fc3ac0992a6b014.tar.gz
coinosv3-90d0396819ddfbabb8b7f45e8fc3ac0992a6b014.zip
ark tests: shared aliceReady() keeps the bark funding wallet usable
scheduled-refresh-test mines a whole vtxo lifetime, which expires alice's coins; every test run after it funded nothing (spendableSat 0) or was handed an expired coin (receive-test). The helper refreshes expired coins and boards more when alice runs low, and the funding tests call it before paying. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'tools/ark/ln-test.js')
-rw-r--r--tools/ark/ln-test.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/ark/ln-test.js b/tools/ark/ln-test.js
index c76d914..87e29d4 100644
--- a/tools/ark/ln-test.js
+++ b/tools/ark/ln-test.js
@@ -19,11 +19,10 @@ import { secp256k1 } from '@noble/curves/secp256k1';
import { ArkManager } from '../../src/ark/manager.js';
import { decodeBolt11 } from '../../src/ark/lightning.js';
+import { ALICE, aliceReady } from './alice.js';
const ARK = process.env.ARK_URL || 'http://127.0.0.1:3535';
const ESPLORA = process.env.ESPLORA_URL || 'http://127.0.0.1:30002';
-const BARK = `${process.env.HOME}/bark/target/debug/bark`;
-const ALICE = `${BARK} --datadir ${process.env.HOME}/ark-regtest/alice`;
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
const sh = (cmd) => execSync(cmd, { shell: '/bin/bash' }).toString().trim();
@@ -89,6 +88,7 @@ const account = HDKey.fromMasterSeed(mnemonicToSeedSync(mnemonic)).derive("m/86'
const mgr = await new ArkManager({ account, storage, arkUrl: ARK, esploraUrl: ESPLORA }).init();
console.log('\n[0] fund manager from alice');
+await aliceReady();
sh(`${ALICE} -q send ${mgr.address()} "25000 sat"`);
for (let i = 0; i < 10 && !mgr.balance().spendableSat; i++) { await mgr.sync(); await sleep(1500); }
check('funded 25000 sat', mgr.balance().spendableSat === 25000, JSON.stringify(mgr.balance()));