]> git.codecow.com Git - libnemo.git/commitdiff
Fix test destroying Ledger connection before signature rejection can be checked.
authorChris Duncan <chris@zoso.dev>
Mon, 15 Sep 2025 15:41:02 +0000 (08:41 -0700)
committerChris Duncan <chris@zoso.dev>
Mon, 15 Sep 2025 15:41:02 +0000 (08:41 -0700)
test/test.ledger.mjs

index a2177a10d2eec6f201ebbd17930be1d77ca307ae..81488d832537bbc076e039b7e69b4386783b6dd2 100644 (file)
@@ -204,14 +204,8 @@ await Promise.all([
                        assert.ok(/^[A-F0-9]{128}$/i.test(sendBlock.signature ?? ''))
                })
 
-               await test('destroy wallet', async () => {
-                       await wallet.destroy()
-                       await assert.rejects(wallet.unlock())
-               })
-
                await test('fail when using new', async () => {
-                       //@ts-expect-error
-                       assert.throws(() => new Ledger())
+                       assert.throws(() => new Wallet('Ledger'))
                })
 
                await test('fail to sign a block without caching frontier', async () => {
@@ -219,6 +213,11 @@ await Promise.all([
                                .send(account.address, '0')
                        await assert.rejects(sendBlock.sign(wallet, 0))
                })
+
+               await test('destroy wallet', async () => {
+                       await wallet.destroy()
+                       await assert.rejects(wallet.unlock())
+               })
        })
        /* node:coverage enable */
 ])