]> git.codecow.com Git - libnemo.git/commitdiff
Update Ledger test.
authorChris Duncan <chris@zoso.dev>
Thu, 10 Jul 2025 15:30:33 +0000 (08:30 -0700)
committerChris Duncan <chris@zoso.dev>
Thu, 10 Jul 2025 15:30:33 +0000 (08:30 -0700)
test/test.ledger.mjs

index 1cf55de82234a3b07fecf44b3c1dbc8553d0f66f..a18d7a12850b66e7093598381f1961c1a0825c81 100644 (file)
@@ -144,11 +144,11 @@ await suite('Ledger hardware wallet', { skip: false || isNode }, async () => {
 
        // nonce signing is currently broken: https://github.com/LedgerHQ/app-nano/pull/14
        await test('sign a nonce', { skip: true }, async () => {
-               // const nonce = new TextEncoder().encode('0123456789abcdef')
-               // const {status, signature} = await click('Click to sign nonce', wallet.sign(0, nonce))
+               const nonce = new TextEncoder().encode('0123456789abcdef')
+               const { status, signature } = await click('Click to sign nonce', wallet.sign(0, nonce))
 
-               // assert.equals(resultSignNonce.status, 'OK')
-               // assert.OK(/[A-Fa-f0-9]{128}/.test(resultSignNonce.signature))
+               assert.equals(status, 'OK')
+               assert.OK(/[A-Fa-f0-9]{128}/.test(signature))
        })
 
        await test('fail when using new', async () => {
@@ -164,9 +164,6 @@ await suite('Ledger hardware wallet', { skip: false || isNode }, async () => {
                        NANO_TEST_VECTORS.SEND_BLOCK.representative,
                        receiveBlock.previous
                )
-               await assert.rejects(click(
-                       'Fail to sign',
-                       async () => sendBlock.sign(0)
-               ))
+               await assert.rejects(sendBlock.sign(0))
        })
 })