aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/ark/expired-dust-test.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/ark/expired-dust-test.js b/tools/ark/expired-dust-test.js
index 4741fb8..c23bd52 100644
--- a/tools/ark/expired-dust-test.js
+++ b/tools/ark/expired-dust-test.js
@@ -15,7 +15,8 @@ import { generateMnemonic, mnemonicToSeedSync } from '@scure/bip39';
import { wordlist } from '@scure/bip39/wordlists/english';
import { HDKey } from '@scure/bip32';
-import { ArkManager } from '/home/adam/coinosv3/src/ark/manager.js';
+import { ArkManager } from '../../src/ark/manager.js';
+import { getArkInfo } from '../../src/ark/proto.js';
const ARK = 'http://127.0.0.1:3535';
const ESPLORA = 'http://127.0.0.1:30002';
@@ -42,6 +43,14 @@ const waitBalance = async (mgr, want, tries = 15) => {
return mgr.balance().spendableSat;
};
+// Mining past a normal lifetime (4320 blocks) would expire every other coin on
+// the shared regtest chain, so without the short-lifetime captaind this skips.
+const { vtxoExpiryDelta } = await getArkInfo(ARK);
+if (vtxoExpiryDelta > 60) {
+ console.log(`SKIP: needs captaind with a short vtxo_lifetime (<= 60 blocks); this one has ${vtxoExpiryDelta}`);
+ process.exit(0);
+}
+
console.log('[setup] board fresh coins under the short lifetime');
const S = await newWallet();
const G1 = await newWallet(); // 1-sat bearer "gift" key