wallet-storage
Version:
BRC100 conforming wallet, wallet storage and wallet signer components
43 lines • 1.68 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint-disable @typescript-eslint/no-unused-vars */
const index_all_1 = require("../../../src/index.all");
const TestUtilsWalletStorage_1 = require("../../utils/TestUtilsWalletStorage");
const noLog = false;
describe('walletStorageClient test', () => {
jest.setTimeout(99999999);
const env = TestUtilsWalletStorage_1._tu.getEnv('test');
const testName = () => expect.getState().currentTestName || 'test';
const ctxs = [];
beforeAll(async () => {
//_tu.mockPostServicesAsSuccess(ctxs)
});
afterAll(async () => {
for (const ctx of ctxs) {
await ctx.storage.destroy();
}
});
test('1 backup to client', async () => {
const ctx = await TestUtilsWalletStorage_1._tu.createLegacyWalletSQLiteCopy('walletStorageClient1');
ctxs.push(ctx);
const { wallet, storage } = ctx;
{
const client = new index_all_1.StorageClient(wallet, 'https://staging-dojo.babbage.systems');
await storage.addWalletStorageProvider(client);
await storage.updateBackups();
}
});
test('2 create storage client wallet', async () => {
const ctx = await TestUtilsWalletStorage_1._tu.createTestWalletWithStorageClient({
rootKeyHex: '1'.repeat(64),
endpointUrl: 'https://staging-dojo.babbage.systems'
});
ctxs.push(ctx);
const { wallet, storage } = ctx;
{
const auth = await storage.getAuth();
expect(auth.userId).toBeTruthy();
}
});
});
//# sourceMappingURL=storageClient.test.js.map