zap-split.test: use using

This commit is contained in:
Alex Gleason 2024-07-29 16:42:18 -05:00
parent 37f229408c
commit a0952bc4c1
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -6,7 +6,8 @@ import { getZapSplits } from '@/utils/zap-split.ts';
import { getTestDB } from '@/test.ts'; import { getTestDB } from '@/test.ts';
Deno.test('Get zap splits in DittoZapSplits format', async () => { Deno.test('Get zap splits in DittoZapSplits format', async () => {
const { store } = await getTestDB(); await using db = await getTestDB();
const store = db.store;
const sk = generateSecretKey(); const sk = generateSecretKey();
const pubkey = getPublicKey(sk); const pubkey = getPublicKey(sk);
@ -19,6 +20,7 @@ Deno.test('Get zap splits in DittoZapSplits format', async () => {
['p', '0461fcbecc4c3374439932d6b8f11269ccdb7cc973ad7a50ae362db135a474dd', '3', 'Alex creator of Ditto'], ['p', '0461fcbecc4c3374439932d6b8f11269ccdb7cc973ad7a50ae362db135a474dd', '3', 'Alex creator of Ditto'],
], ],
}, sk); }, sk);
await store.event(event); await store.event(event);
const eventFromDb = await store.query([{ kinds: [30078], authors: [pubkey] }]); const eventFromDb = await store.query([{ kinds: [30078], authors: [pubkey] }]);
@ -36,7 +38,8 @@ Deno.test('Get zap splits in DittoZapSplits format', async () => {
}); });
Deno.test('Zap split is empty', async () => { Deno.test('Zap split is empty', async () => {
const { store } = await getTestDB(); await using db = await getTestDB();
const store = db.store;
const sk = generateSecretKey(); const sk = generateSecretKey();
const pubkey = getPublicKey(sk); const pubkey = getPublicKey(sk);