aboutsummaryrefslogtreecommitdiffstats
path: root/test/preload.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-02-09 01:19:33 -0800
committerAdam Soltys <[email protected]>2026-02-09 01:19:33 -0800
commit6f933c6e989f934364a276815826364fec5a85b4 (patch)
tree54e5b7818250a8cadcbb20111f24c9a5ee4bc674 /test/preload.ts
parent3cde20ead47bf2fc895ea37789b824098b984f7a (diff)
downloadcoinos-server-6f933c6e989f934364a276815826364fec5a85b4.tar.gz
coinos-server-6f933c6e989f934364a276815826364fec5a85b4.zip
ark fixes
Diffstat (limited to 'test/preload.ts')
-rw-r--r--test/preload.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/preload.ts b/test/preload.ts
index 0704561a..151c3c64 100644
--- a/test/preload.ts
+++ b/test/preload.ts
@@ -71,7 +71,11 @@ mock.module("$lib/db", () => {
return {
db: {
get: async (k: string) => kv()[k] ?? null,
- set: async (k: string, v: string) => { kv()[k] = v; return "OK"; },
+ set: async (k: string, v: string, opts?: any) => {
+ if (opts?.NX && kv()[k] !== undefined) return null;
+ kv()[k] = v;
+ return "OK";
+ },
del: async (k: string) => { delete kv()[k]; return 1; },
exists: async (k: string) => (kv()[k] !== undefined ? 1 : 0),
lPush: async (k: string, v: string) => {
@@ -185,7 +189,7 @@ mock.module("$lib/nostr", () => ({
}));
mock.module("$lib/mqtt", () => ({ default: { publish: () => {} } }));
mock.module("$lib/ark", () => ({
- getArkAddress: async () => "ark-addr", sendArk: async () => "ark-txid", getArkBalance: async () => 0,
+ getArkAddress: async () => "ark-addr", sendArk: async () => "ark-txid", getArkBalance: async () => 0, verifyArkVtxo: async () => true,
}));
mock.module("$lib/ecash", () => ({ request: async () => ({}) }));
mock.module("$lib/lightning", () => ({