From 90d0396819ddfbabb8b7f45e8fc3ac0992a6b014 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 7 Oct 2026 08:21:47 -0700 Subject: 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 --- tools/ark/manager-test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/ark/manager-test.js') diff --git a/tools/ark/manager-test.js b/tools/ark/manager-test.js index 74a1c5c..6cbc506 100644 --- a/tools/ark/manager-test.js +++ b/tools/ark/manager-test.js @@ -17,11 +17,10 @@ import { hex } from '@scure/base'; import { ArkManager } from '../../src/ark/manager.js'; import { decodeVtxo, vtxoBytesFromStr } from '../../src/ark/proto.js'; import { validateVtxo } from '../../src/ark/validate.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 BCLI = `docker exec bc bitcoin-cli -rpcwallet=coinos`; const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); @@ -52,6 +51,7 @@ let mgr = await newManager(); // --- 1. receive with full validation --- console.log('\n[1] receive'); const addr = mgr.address(); +await aliceReady(); sh(`${ALICE} -q send ${addr} "20000 sat"`); for (let i = 0; i < 10 && !mgr.balance().spendableSat; i++) { await mgr.sync(); await sleep(1500); } check('received 20000 sat', mgr.balance().spendableSat === 20000, JSON.stringify(mgr.balance())); -- cgit v1.2.3