UNPKG

wallet-storage

Version:

BRC100 conforming wallet, wallet storage and wallet signer components

41 lines 1.65 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const TestUtilsWalletStorage_1 = require("../../utils/TestUtilsWalletStorage"); describe('Wallet constructor tests', () => { jest.setTimeout(99999999); const chain = 'test'; const ctxs = []; const env = TestUtilsWalletStorage_1._tu.getEnv(chain); beforeAll(async () => { if (!env.noMySQL) { ctxs.push(await TestUtilsWalletStorage_1._tu.createMySQLTestSetup1Wallet({ databaseName: 'walletConstruct', chain, rootKeyHex: '1'.repeat(64) })); } ctxs.push(await TestUtilsWalletStorage_1._tu.createSQLiteTestSetup1Wallet({ databaseName: 'walletConstruct', chain, rootKeyHex: '2'.repeat(64) })); }); afterAll(async () => { for (const ctx of ctxs) { await ctx.storage.destroy(); } }); test('0', async () => { for (const { activeStorage: storage, userId, wallet } of ctxs) { { const labels = await storage.findTxLabels({ partial: { userId } }); const label = labels[0].label; const r = await wallet.listActions({ labels: [label] }); expect(r.totalActions).toBe(1); } { const baskets = await storage.findOutputBaskets({ partial: { userId } }); const basket = baskets[0].name; const r = await wallet.listOutputs({ basket }); expect(r.totalOutputs).toBe(1); } } }); }); //# sourceMappingURL=Wallet.constructor.test.js.map