@bsv/wallet-toolbox
Version:
BRC100 conforming wallet, wallet storage and wallet signer components
30 lines • 1.33 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const TestUtilsWalletStorage_1 = require("../../utils/TestUtilsWalletStorage");
require("fake-indexeddb/auto");
describe('idbSpeed tests', () => {
jest.setTimeout(99999999);
const testName = () => expect.getState().currentTestName || 'test';
/**
* Starting speed 2025-04-18 07:58 was 66+ seconds
*/
test('0 copy legacy wallet', async () => {
const databaseName = testName();
const setup = await TestUtilsWalletStorage_1._tu.createIdbLegacyWalletCopy(databaseName);
expect(setup.activeStorage).toBeTruthy();
const stats = TestUtilsWalletStorage_1._tu.wrapProfiling(setup.activeStorage, 'StorageIdb');
const args = {
includeLabels: true,
labels: ['babbage_protocol_perm']
};
const r = await setup.wallet.listActions(args);
expect(r.actions.length).toBe(args.limit || 10);
let log = 'function,count,totalMsecs,avgMsecs\n';
for (const [key, value] of Object.entries(stats)) {
log += `${key},${value.count},${value.totalMsecs},${value.totalMsecs / value.count}\n`;
}
(0, TestUtilsWalletStorage_1.logger)(log);
await setup.wallet.destroy();
});
});
//# sourceMappingURL=idbSpeed.test.js.map