]> git.codecow.com Git - libnemo.git/commitdiff
Move Ledger account derivation test into dedicated suite.
authorChris Duncan <chris@zoso.dev>
Thu, 10 Jul 2025 15:20:39 +0000 (08:20 -0700)
committerChris Duncan <chris@zoso.dev>
Thu, 10 Jul 2025 15:20:39 +0000 (08:20 -0700)
test/test.derive-accounts.mjs
test/test.ledger.mjs

index 72371761c6de9bada180ff5984f828077cb2c605..e9b8661195347045a0c1f8c070819ea26ab0d223 100644 (file)
@@ -89,26 +89,3 @@ await suite('BLAKE2b account derivation', async () => {
                await wallet.destroy()\r
        })\r
 })\r
-\r
-/**\r
-* This suite requires a connected unlocked Ledger device to execute tests.\r
-*/\r
-await suite('Ledger device account derivation', { skip: false || isNode }, async () => {\r
-       const wallet = await LedgerWallet.create()\r
-       await wallet.connect()\r
-\r
-       await test('fetch the first account from a Ledger device', async () => {\r
-               const account = await wallet.account()\r
-\r
-               assert.exists(account.publicKey)\r
-               assert.exists(account.address)\r
-               assert.exists(account.privateKey)\r
-               assert.equals(account.privateKey, '0000000000000000000000000000000000000000000000000000000000000000')\r
-       })\r
-\r
-       await test('fail to return multiple accounts from a Ledger device', async () => {\r
-               assert.rejects(wallet.accounts())\r
-       })\r
-\r
-       await wallet.destroy()\r
-})\r
index fe21fa3da13991bc9f67f982bcb16c84a2e52769..1cf55de82234a3b07fecf44b3c1dbc8553d0f66f 100644 (file)
@@ -56,8 +56,10 @@ await suite('Ledger hardware wallet', { skip: false || isNode }, async () => {
 
                assert.exists(account)
                assert.ok(account instanceof Account)
-               assert.exists(account.publicKey)
                assert.exists(account.address)
+               assert.exists(account.publicKey)
+               assert.exists(account.privateKey)
+               assert.equals(account.privateKey, '0000000000000000000000000000000000000000000000000000000000000000')
        })
 
        await test('sign open block from block', async () => {