@bsv/wallet-toolbox
Version:
BRC100 conforming wallet, wallet storage and wallet signer components
44 lines • 1.91 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const index_client_1 = require("../../../src/index.client");
const TestUtilsWalletStorage_1 = require("../../utils/TestUtilsWalletStorage");
describe('abortAction tests', () => {
jest.setTimeout(99999999);
const env = TestUtilsWalletStorage_1._tu.getEnv('test');
beforeAll(async () => { });
afterAll(async () => { });
test('0 invalid params', async () => {
const ctxs = [];
if (env.runMySQL)
ctxs.push(await TestUtilsWalletStorage_1._tu.createLegacyWalletMySQLCopy('abortActionTests'));
ctxs.push(await TestUtilsWalletStorage_1._tu.createLegacyWalletSQLiteCopy('abortActionTests'));
for (const { wallet } of ctxs) {
const invalidArgs = [
{ reference: '' },
{ reference: '====' },
{ reference: 'a'.repeat(301) },
{ reference: 'a'.repeat(300) }
// Oh so many things to test...
];
for (const args of invalidArgs) {
await (0, TestUtilsWalletStorage_1.expectToThrowWERR)(index_client_1.sdk.WERR_INVALID_PARAMETER, () => wallet.abortAction(args));
}
}
for (const ctx of ctxs) {
await ctx.storage.destroy();
}
});
test('1_abort reference 49f878d8405589', async () => {
const ctxs = [];
if (env.runMySQL)
ctxs.push(await TestUtilsWalletStorage_1._tu.createLegacyWalletMySQLCopy('abortActionTests'));
ctxs.push(await TestUtilsWalletStorage_1._tu.createLegacyWalletSQLiteCopy('abortActionTests'));
for (const { wallet } of ctxs) {
await wallet.abortAction({ reference: 'Sfh42EBViQ==' });
}
for (const ctx of ctxs) {
await ctx.storage.destroy();
}
});
});
//# sourceMappingURL=abortAction.test.js.map