]> zoso.dev Git - libnemo.git/commitdiff
Move test files around. Fix test runners for async functions.
authorChris Duncan <chris@zoso.dev>
Fri, 6 Dec 2024 05:33:09 +0000 (21:33 -0800)
committerChris Duncan <chris@zoso.dev>
Fri, 6 Dec 2024 05:33:09 +0000 (21:33 -0800)
16 files changed:
GLOBALS.mjs [new file with mode: 0644]
package.json
perf/account.perf.js [moved from test/perf/account.perf.js with 91% similarity]
perf/main.mjs [new file with mode: 0644]
perf/wallet.perf.js [moved from test/perf/wallet.perf.js with 92% similarity]
test.html
test/GLOBALS.mjs [deleted file]
test/create-wallet.test.mjs
test/derive-accounts.test.mjs
test/import-wallet.test.mjs
test/lock-unlock-wallet.mjs
test/main.mjs
test/manage-rolodex.mjs
test/refresh-accounts.test.mjs
test/sign-blocks.test.mjs
test/tools.test.mjs

diff --git a/GLOBALS.mjs b/GLOBALS.mjs
new file mode 100644 (file)
index 0000000..f5649ee
--- /dev/null
@@ -0,0 +1,128 @@
+// SPDX-FileCopyrightText: 2024 Chris Duncan <chris@zoso.dev>
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+if (globalThis.sessionStorage == null) {
+       let _sessionStorage = {}
+       Object.defineProperty(globalThis, 'sessionStorage', {
+               value: {
+                       length: Object.entries(_sessionStorage).length,
+                       setItem: (key, value) => _sessionStorage[key] = value,
+                       getItem: (key) => _sessionStorage[key],
+                       removeItem: (key) => delete _sessionStorage[key],
+                       clear: () => _sessionStorage = {}
+               },
+               configurable: true,
+               enumerable: true
+       })
+}
+
+export function skip (name, ...args) {
+       console.log(`SKIP: ${name}`)
+}
+
+export function test (name, fn) {
+       if (fn instanceof Promise) {
+               try {
+                       fn.then(() => console.log(`PASS: ${name}`))
+                               .catch((err) => console.error(`FAIL: ${name}`))
+               } catch (err) {
+                       console.error(`FAIL: ${name}`)
+                       console.error(err)
+               }
+       } else if (fn.constructor.name === 'AsyncFunction') {
+               try {
+                       fn().then(() => console.log(`PASS: ${name}`))
+                               .catch((err) => console.error(`FAIL: ${name}`))
+               } catch (err) {
+                       console.error(`FAIL: ${name}`)
+                       console.error(err)
+               }
+       } else {
+               try {
+                       fn()
+                       console.log(`PASS: ${name}`)
+               } catch (err) {
+                       console.error(`FAIL: ${name}`)
+                       console.error(err)
+               }
+       }
+}
+
+export const assert = {
+       ok: (bool) => {
+               if (typeof bool !== 'boolean') {
+                       throw new Error('Invalid assertion')
+               }
+               if (!bool) {
+                       throw new Error(`test result falsy`)
+               }
+               return true
+       },
+       exists: (a) => {
+               let b = a || null
+               if (b == null) {
+                       throw new Error(`argument is ${typeof a}`)
+               }
+               return b != null
+       },
+       equals: (a, b) => {
+               return a === b
+       },
+       notEqual: (a, b) => {
+               return a !== b
+       },
+       rejects: async (fn, msg) => {
+               if (fn instanceof Promise) {
+                       try {
+                               fn.then(() => { throw new Error(msg ?? 'expected async function to reject') })
+                                       .catch((err) => { return true })
+                       } catch (err) {
+                               return true
+                       }
+               } else if (fn.constructor.name === 'AsyncFunction') {
+                       try {
+                               fn.then(() => { throw new Error(msg ?? 'expected async function to reject') })
+                                       .catch((err) => { return true })
+                       } catch (err) {
+                               return true
+                       }
+               } else {
+                       throw new Error(msg ?? 'expected async function')
+               }
+       },
+       resolves: async (fn, msg) => {
+               if (fn instanceof Promise) {
+                       try {
+                               fn.then(() => { return true })
+                                       .catch((err) => { throw new Error(msg ?? 'expected async function to resolve') })
+                               return true
+                       } catch (err) {
+                               throw new Error(msg ?? 'expected async function to resolve')
+                       }
+               } else if (fn.constructor.name === 'AsyncFunction') {
+                       try {
+                               fn().then(() => { return true })
+                                       .catch((err) => { throw new Error(msg ?? 'expected async function to resolve') })
+                               return true
+                       } catch (err) {
+                               throw new Error(msg ?? 'expected async function to resolve')
+                       }
+               } else {
+                       throw new Error('expected async function')
+               }
+       },
+       throws: (fn, msg) => {
+               if (typeof fn !== 'function') {
+                       throw new Error('expected function')
+               }
+               if (fn instanceof Promise || fn.constructor.name === 'AsyncFunction') {
+                       throw new Error('expected synchronous function')
+               }
+               try {
+                       fn()
+                       throw new Error(msg ?? `expected function to throw an exception`)
+               } catch (err) {
+                       return true
+               }
+       }
+}
index feee1b0065cc49c2ae6fce23e8a7544897b318e1..2edcd3701d479dc95299e859ff4c0c78b37d82fd 100644 (file)
@@ -47,7 +47,7 @@
                "test:node": "npm run build -- --platform=node && node --test --test-force-exit --env-file .env",
                "test:coverage": "npm run test:node -- --experimental-test-coverage",
                "test:coverage:report": "npm run test:coverage -- --test-reporter=lcov --test-reporter-destination=coverage.info && genhtml coverage.info --output-directory test/coverage && rm coverage.info && xdg-open test/coverage/index.html",
-               "test:performance": "npm run build && npm run jest -- ./perf/*"
+               "test:performance": "npm run build && esbuild perf.min=perf/main.mjs --outdir=dist --target=esnext --format=esm --platform=browser --bundle --sourcemap"
        },
        "imports": {
                "#*": "./*"
similarity index 91%
rename from test/perf/account.perf.js
rename to perf/account.perf.js
index e4d796a2e1d904e2fb6811caee0de4f9776d8000..59b6e44337a619453a557b50b1dc7dcb312d63e7 100644 (file)
@@ -3,7 +3,7 @@
 
 'use strict'
 
-import { assert, skip, test } from '#test/GLOBALS.mjs'
+import { assert, skip, test } from '#GLOBALS.mjs'
 import { NANO_TEST_VECTORS } from '#test/TEST_VECTORS.js'
 import { Bip44Wallet, Blake2bWallet } from '#dist/main.js'
 
@@ -11,9 +11,9 @@ test('BIP-44 ckd performance test', async () => {
        const wallet = await Bip44Wallet.create(NANO_TEST_VECTORS.PASSWORD)
        await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)
 
-       console.log(`HERE`)
        const accounts = await wallet.accounts(0, 0x7fff)
 
+       console.log(`HERE`)
        assert.equals(accounts.length, 0x8000)
 })
 
@@ -23,5 +23,6 @@ test('BLAKE2b ckd performance test', async () => {
 
        const accounts = await wallet.accounts(0, 0x7fff)
 
+       console.log(`HERE 2`)
        assert.equals(accounts.length, 0x8000)
 })
diff --git a/perf/main.mjs b/perf/main.mjs
new file mode 100644 (file)
index 0000000..eb99a2e
--- /dev/null
@@ -0,0 +1,7 @@
+// SPDX-FileCopyrightText: 2024 Chris Duncan <chris@zoso.dev>
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+import './account.perf.js'
+import './wallet.perf.js'
+
+console.log('> TESTING COMPLETE <')
similarity index 92%
rename from test/perf/wallet.perf.js
rename to perf/wallet.perf.js
index 7c65a683dddf748f6b44fd0e392c90c3de97638e..5024366cfd88e0897a6e71f6f48326ee8a383f97 100644 (file)
@@ -3,7 +3,7 @@
 
 'use strict'
 
-import { assert, skip, test } from '#test/GLOBALS.mjs'
+import { assert, skip, test } from '#GLOBALS.mjs'
 import { NANO_TEST_VECTORS } from '#test/TEST_VECTORS.js'
 import { Bip44Wallet, Blake2bWallet } from '#dist/main.js'
 
index f3aa38b5a04435063c821ab07e6eae389bb63a89..7347f65c1e7241eb31f33ae20557e01db2915df7 100644 (file)
--- a/test.html
+++ b/test.html
@@ -4,6 +4,7 @@
        <link rel="icon" href="./favicon.ico">
        <script type="module" src="./dist/global.min.js"></script>
        <script type="module" src="./dist/test.min.js"></script>
+       <script type="module" src="./dist/perf.min.js"></script>
        <!-- <script type="module">
                console.log(`bip44`)
                const bipWallet = await libnemo.Bip44Wallet.create('test')
diff --git a/test/GLOBALS.mjs b/test/GLOBALS.mjs
deleted file mode 100644 (file)
index 73872f3..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-// SPDX-FileCopyrightText: 2024 Chris Duncan <chris@zoso.dev>
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-if (globalThis.sessionStorage == null) {
-       let _sessionStorage = {}
-       Object.defineProperty(globalThis, 'sessionStorage', {
-               value: {
-                       length: Object.entries(_sessionStorage).length,
-                       setItem: (key, value) => _sessionStorage[key] = value,
-                       getItem: (key) => _sessionStorage[key],
-                       removeItem: (key) => delete _sessionStorage[key],
-                       clear: () => _sessionStorage = {}
-               },
-               configurable: true,
-               enumerable: true
-       })
-}
-
-export function skip (name, ...args) {
-       console.log(`SKIP: ${name}`)
-}
-
-export function test (name, fn) {
-       if (fn instanceof Promise) {
-               try {
-                       fn.then(() => console.log(`PASS: ${name}`))
-                               .catch((err) => console.error(`FAIL: ${name}`))
-               } catch (err) {
-                       console.error(`FAIL: ${name}`)
-                       console.error(err)
-               }
-       } else {
-               try {
-                       fn()
-                       console.log(`PASS: ${name}`)
-               } catch (err) {
-                       console.error(`FAIL: ${name}`)
-                       console.error(err)
-               }
-       }
-}
-
-export const assert = {
-       ok: (bool) => {
-               if (typeof bool !== 'boolean') throw new Error('Invalid assertion')
-               if (!bool) throw new Error(`test result falsy`)
-               return true
-       },
-       exists: (a) => {
-               let b = a || null
-               if (b == null) throw new Error(`argument is ${typeof a}`)
-               return b != null
-       },
-       equals: (a, b) => {
-               return a === b
-       },
-       notEqual: (a, b) => {
-               return a !== b
-       },
-       rejects: async (fn, msg) => {
-               try {
-                       if (!(fn instanceof Promise)) throw new Error(msg ?? 'expected async function')
-                       fn.then(() => { throw new Error(msg ?? 'expected async function to reject') })
-                               .catch((err) => { return true })
-               } catch (err) {
-                       return true
-               }
-       },
-       resolves: async (fn, msg) => {
-               try {
-                       if (!(fn instanceof Promise)) throw new Error('expected async function')
-                       fn.then(() => { return true })
-                               .catch((err) => { throw new Error(msg ?? 'expected async function to resolve') })
-                       return true
-               } catch (err) {
-                       throw new Error(msg ?? 'expected async function to resolve')
-               }
-       },
-       throws: (fn, msg) => {
-               try {
-                       if (fn instanceof Promise) throw new Error('expected synchronous function')
-                       fn()
-                       throw new Error(msg ?? `expected function to throw an exception`)
-               } catch (err) {
-                       return true
-               }
-       }
-}
index 494556c4bfee210ee894d0f96972c5712e1aebf8..5a6bfe5f0de60835793cf8d6aa2842a42378667c 100644 (file)
@@ -3,7 +3,7 @@
 \r
 'use strict'\r
 \r
-import { assert, skip, test } from '#test/GLOBALS.mjs'\r
+import { assert, skip, test } from '#GLOBALS.mjs'\r
 import { NANO_TEST_VECTORS } from '#test/TEST_VECTORS.js'\r
 import { Bip44Wallet, Blake2bWallet, LedgerWallet } from '#dist/main.js'\r
 \r
index 44ecd266f9e52746c1e51e145cc7d7688c3120d8..50f93d72ccd97667ff30d7489c1a1b095d11a163 100644 (file)
@@ -3,7 +3,7 @@
 \r
 'use strict'\r
 \r
-import { assert, skip, test } from '#test/GLOBALS.mjs'\r
+import { assert, skip, test } from '#GLOBALS.mjs'\r
 import { NANO_TEST_VECTORS } from '#test/TEST_VECTORS.js'\r
 import { Bip44Wallet, Blake2bWallet, LedgerWallet } from '#dist/main.js'\r
 \r
index 707e2e6825884e577f1aece1ff20a7274c544a79..1c9f1e8bfee050a47a74e8331ee53e8eccdafd7c 100644 (file)
 \r
 'use strict'\r
 \r
-import { assert, test } from '#test/GLOBALS.mjs'\r
+import { assert, test } from '#GLOBALS.mjs'\r
 import { BIP32_TEST_VECTORS, CUSTOM_TEST_VECTORS, NANO_TEST_VECTORS, TREZOR_TEST_VECTORS } from '#test/TEST_VECTORS.js'\r
 import { Account, Bip44Wallet, Blake2bWallet } from '#dist/main.js'\r
 \r
-test('import wallet with test vectors test', () => {\r
-       test('should successfully import a wallet with the official Nano test vectors mnemonic', async () => {\r
-               const wallet = await Bip44Wallet.fromMnemonic(NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.MNEMONIC, NANO_TEST_VECTORS.PASSWORD)\r
-               await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
-               const accounts = await wallet.accounts()\r
-\r
-               assert.ok('mnemonic' in wallet)\r
-               assert.ok('seed' in wallet)\r
-               assert.ok(accounts[0] instanceof Account)\r
-               assert.equals(wallet.mnemonic, NANO_TEST_VECTORS.MNEMONIC)\r
-               assert.equals(wallet.seed, NANO_TEST_VECTORS.BIP39_SEED)\r
-               assert.equals(accounts[0].privateKey, NANO_TEST_VECTORS.PRIVATE_0)\r
-               assert.equals(accounts[0].publicKey, NANO_TEST_VECTORS.PUBLIC_0)\r
-               assert.equals(accounts[0].address, NANO_TEST_VECTORS.ADDRESS_0)\r
-       })\r
-\r
-       test('should successfully import a wallet with the checksum starting with a zero', async () => {\r
-               const wallet = await Bip44Wallet.fromMnemonic(NANO_TEST_VECTORS.PASSWORD, 'food define cancel major spoon trash cigar basic aim bless wolf win ability seek paddle bench seed century group they mercy address monkey cake')\r
-               await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
-               assert.equals(wallet.seed, 'F665F804E5907985455D1E5A7AD344843A2ED4179A7E06EEF263DE925FF6F4C0991B0A9344FCEE939FE0F1B1841B8C9B20FEACF6B954B74B2D26A01906B758E2')\r
-       })\r
-\r
-       test('should successfully import a wallet with a 12-word phrase', async () => {\r
-               const wallet = await Bip44Wallet.fromEntropy(NANO_TEST_VECTORS.PASSWORD, CUSTOM_TEST_VECTORS.ENTROPY_0)\r
-               await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
-               const accounts = await wallet.accounts()\r
-               const account = accounts[0]\r
-\r
-               assert.equals(wallet.mnemonic, CUSTOM_TEST_VECTORS.MNEMONIC_0)\r
-               assert.equals(wallet.seed, CUSTOM_TEST_VECTORS.SEED_0)\r
-               assert.equals(account.privateKey, CUSTOM_TEST_VECTORS.PRIVATE_0)\r
-               assert.equals(account.publicKey, CUSTOM_TEST_VECTORS.PUBLIC_0)\r
-               assert.equals(account.address, CUSTOM_TEST_VECTORS.ADDRESS_0)\r
-       })\r
-\r
-       test('should successfully import a wallet with a 15-word phrase', async () => {\r
-               const wallet = await Bip44Wallet.fromEntropy(NANO_TEST_VECTORS.PASSWORD, CUSTOM_TEST_VECTORS.ENTROPY_1)\r
-               await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
-               const accounts = await wallet.accounts()\r
-               const account = accounts[0]\r
-\r
-               assert.equals(wallet.mnemonic, CUSTOM_TEST_VECTORS.MNEMONIC_1)\r
-               assert.equals(wallet.seed, CUSTOM_TEST_VECTORS.SEED_1)\r
-               assert.equals(account.privateKey, CUSTOM_TEST_VECTORS.PRIVATE_1)\r
-               assert.equals(account.publicKey, CUSTOM_TEST_VECTORS.PUBLIC_1)\r
-               assert.equals(account.address, CUSTOM_TEST_VECTORS.ADDRESS_1)\r
-       })\r
-\r
-       test('should successfully import a wallet with a 18-word phrase', async () => {\r
-               const wallet = await Bip44Wallet.fromEntropy(NANO_TEST_VECTORS.PASSWORD, CUSTOM_TEST_VECTORS.ENTROPY_2)\r
-               await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
-               const accounts = await wallet.accounts()\r
-               const account = accounts[0]\r
-\r
-               assert.equals(wallet.mnemonic, CUSTOM_TEST_VECTORS.MNEMONIC_2)\r
-               assert.equals(wallet.seed, CUSTOM_TEST_VECTORS.SEED_2)\r
-               assert.equals(account.privateKey, CUSTOM_TEST_VECTORS.PRIVATE_2)\r
-               assert.equals(account.publicKey, CUSTOM_TEST_VECTORS.PUBLIC_2)\r
-               assert.equals(account.address, CUSTOM_TEST_VECTORS.ADDRESS_2)\r
-       })\r
-\r
-       test('should successfully import a wallet with a 21-word phrase', async () => {\r
-               const wallet = await Bip44Wallet.fromEntropy(NANO_TEST_VECTORS.PASSWORD, CUSTOM_TEST_VECTORS.ENTROPY_3)\r
-               await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
-               const accounts = await wallet.accounts()\r
-               const account = accounts[0]\r
-\r
-               assert.equals(wallet.mnemonic, CUSTOM_TEST_VECTORS.MNEMONIC_3)\r
-               assert.equals(wallet.seed, CUSTOM_TEST_VECTORS.SEED_3)\r
-               assert.equals(account.privateKey, CUSTOM_TEST_VECTORS.PRIVATE_3)\r
-               assert.equals(account.publicKey, CUSTOM_TEST_VECTORS.PUBLIC_3)\r
-               assert.equals(account.address, CUSTOM_TEST_VECTORS.ADDRESS_3)\r
-       })\r
-\r
-       test('should successfully import a wallet with the official Nano test vectors seed', async () => {\r
-               const wallet = await Bip44Wallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED)\r
-               await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
-               const accounts = await wallet.accounts()\r
-\r
-               assert.ok('mnemonic' in wallet)\r
-               assert.ok('seed' in wallet)\r
-               assert.ok(accounts[0] instanceof Account)\r
-               assert.equals(wallet.mnemonic, '')\r
-               assert.equals(wallet.seed, NANO_TEST_VECTORS.BIP39_SEED)\r
-               assert.equals(accounts[0].privateKey, NANO_TEST_VECTORS.PRIVATE_0)\r
-               assert.equals(accounts[0].publicKey, NANO_TEST_VECTORS.PUBLIC_0)\r
-               assert.equals(accounts[0].address, NANO_TEST_VECTORS.ADDRESS_0)\r
-       })\r
-\r
-       test('should successfully import a BIP-44 wallet with the zero seed', async () => {\r
-               const wallet = await Bip44Wallet.fromEntropy(NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_0, TREZOR_TEST_VECTORS.PASSWORD)\r
-               await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
-               const accounts = await wallet.accounts(0, 3)\r
-\r
-               assert.ok('mnemonic' in wallet)\r
-               assert.ok('seed' in wallet)\r
-               assert.equals(wallet.mnemonic, TREZOR_TEST_VECTORS.MNEMONIC_0)\r
-               assert.equals(wallet.seed, TREZOR_TEST_VECTORS.SEED_0.toUpperCase())\r
-               assert.equals(accounts.length, 4)\r
-               for (let i = 0; i < accounts.length; i++) {\r
-                       assert.ok(accounts[i])\r
-                       assert.ok(accounts[i].address)\r
-                       assert.ok(accounts[i].publicKey)\r
-                       assert.ok(accounts[i].privateKey)\r
-                       assert.equals(accounts[i].index, i)\r
-               }\r
-       })\r
-\r
-       test('should successfully import a BLAKE2b wallet with the zero seed', async () => {\r
-               const wallet = await Blake2bWallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_0)\r
-               await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
-               const accounts = await wallet.accounts(0, 3)\r
-\r
-               assert.ok('mnemonic' in wallet)\r
-               assert.ok('seed' in wallet)\r
-               assert.equals(wallet.mnemonic, TREZOR_TEST_VECTORS.MNEMONIC_0)\r
-               assert.equals(wallet.seed, TREZOR_TEST_VECTORS.ENTROPY_0)\r
-               assert.equals(accounts.length, 4)\r
-               for (let i = 0; i < accounts.length; i++) {\r
-                       assert.ok(accounts[i])\r
-                       assert.ok(accounts[i].address)\r
-                       assert.ok(accounts[i].publicKey)\r
-                       assert.ok(accounts[i].privateKey)\r
-                       assert.equals(accounts[i].index, i)\r
-               }\r
-       })\r
-\r
-       test('should successfully import a BLAKE2b wallet with Trezor test vectors', async () => {\r
-               const wallet = await Blake2bWallet.fromMnemonic(NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.MNEMONIC_1)\r
-               await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
-               const accounts = await wallet.accounts(0, 1)\r
-\r
-               assert.ok('mnemonic' in wallet)\r
-               assert.ok('seed' in wallet)\r
-               assert.equals(wallet.mnemonic, TREZOR_TEST_VECTORS.MNEMONIC_1)\r
-               assert.equals(wallet.seed, TREZOR_TEST_VECTORS.ENTROPY_1)\r
-               assert.ok(accounts[0] instanceof Account)\r
-               assert.equals(accounts[0].index, 0)\r
-               assert.equals(accounts[0].privateKey, TREZOR_TEST_VECTORS.BLAKE2B_1_PRIVATE_0)\r
-               assert.equals(accounts[0].publicKey, TREZOR_TEST_VECTORS.BLAKE2B_1_PUBLIC_0)\r
-               assert.equals(accounts[0].address, TREZOR_TEST_VECTORS.BLAKE2B_1_ADDRESS_0)\r
-               assert.ok(accounts[1] instanceof Account)\r
-               assert.equals(accounts[1].index, 1)\r
-               assert.equals(accounts[1].privateKey, TREZOR_TEST_VECTORS.BLAKE2B_1_PRIVATE_1)\r
-               assert.equals(accounts[1].publicKey, TREZOR_TEST_VECTORS.BLAKE2B_1_PUBLIC_1)\r
-               assert.equals(accounts[1].address, TREZOR_TEST_VECTORS.BLAKE2B_1_ADDRESS_1)\r
-       })\r
-\r
-       test('should get identical BLAKE2b wallets when created with a seed versus with its derived mnemonic', async () => {\r
-               const wallet = await Blake2bWallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_2)\r
-               await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
-               const walletAccounts = await wallet.accounts()\r
-               const walletAccount = walletAccounts[0]\r
-\r
-               assert.ok('mnemonic' in wallet)\r
-               assert.ok('seed' in wallet)\r
-               assert.ok(walletAccount)\r
-               assert.equals(wallet.mnemonic, TREZOR_TEST_VECTORS.MNEMONIC_2)\r
-\r
-               const imported = await Blake2bWallet.fromMnemonic(TREZOR_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.MNEMONIC_2)\r
-               await imported.unlock(TREZOR_TEST_VECTORS.PASSWORD)\r
-               const importedAccounts = await imported.accounts()\r
-               const importedAccount = importedAccounts[0]\r
-\r
-               assert.equals(imported.mnemonic, wallet.mnemonic)\r
-               assert.equals(imported.seed, wallet.seed)\r
-               assert.equals(importedAccount.privateKey, walletAccount.privateKey)\r
-               assert.equals(importedAccount.publicKey, walletAccount.publicKey)\r
-       })\r
-\r
-       test('should get identical BLAKE2b wallets when created with max entropy value', async () => {\r
-               const wallet = await Blake2bWallet.fromMnemonic(NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.MNEMONIC_3)\r
-               await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
-               const accounts = await wallet.accounts()\r
-\r
-               assert.ok('mnemonic' in wallet)\r
-               assert.ok('seed' in wallet)\r
-               assert.ok(accounts[0] instanceof Account)\r
-               assert.equals(wallet.mnemonic, TREZOR_TEST_VECTORS.MNEMONIC_3)\r
-               assert.equals(wallet.seed, TREZOR_TEST_VECTORS.ENTROPY_3)\r
-               assert.equals(accounts[0].index, 0)\r
-               assert.equals(accounts[0].privateKey, TREZOR_TEST_VECTORS.BLAKE2B_3_PRIVATE_0)\r
-               assert.equals(accounts[0].publicKey, TREZOR_TEST_VECTORS.BLAKE2B_3_PUBLIC_0)\r
-               assert.equals(accounts[0].address, TREZOR_TEST_VECTORS.BLAKE2B_3_ADDRESS_0)\r
-       })\r
-})\r
-\r
-test('invalid wallet', async () => {\r
-       test('throw when given invalid entropy', async () => {\r
-               await assert.rejects(Bip44Wallet.fromEntropy(NANO_TEST_VECTORS.PASSWORD, '6CAF5A42BB8074314AAE20295975ECE663BE7AAD945A73613D193B0CC41C797'))\r
-               await assert.rejects(Bip44Wallet.fromEntropy(NANO_TEST_VECTORS.PASSWORD, '6CAF5A42BB8074314AAE20295975ECE663BE7AAD945A73613D193B0CC41C79701'))\r
-               await assert.rejects(Bip44Wallet.fromEntropy(NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_0.replaceAll(/./g, 'x')))\r
-       })\r
-\r
-       test('should throw when given a seed with an invalid length', async () => {\r
-               await assert.rejects(Bip44Wallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED + 'f'),\r
-                       `Expected a ${NANO_TEST_VECTORS.BIP39_SEED.length}-character seed, but received ${NANO_TEST_VECTORS.BIP39_SEED.length + 1}-character string.`)\r
-               await assert.rejects(Bip44Wallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED.slice(0, -1)),\r
-                       `Expected a ${NANO_TEST_VECTORS.BIP39_SEED.length}-character seed, but received ${NANO_TEST_VECTORS.BIP39_SEED.length - 1}-character string.`)\r
-       })\r
-\r
-       test('should throw when given a seed containing non-hex characters', async () => {\r
-               await assert.rejects(Bip44Wallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.SEED_0.replace(/./, 'g')),\r
-                       'Seed contains invalid hexadecimal characters.')\r
-               await assert.rejects(Blake2bWallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_1.replace(/./, 'g')),\r
-                       'Seed contains invalid hexadecimal characters.')\r
-       })\r
-})\r
-\r
-test('import from storage', async () => {\r
-       test('should retrieve a Bip44Wallet from storage using an ID', async () => {\r
-               const id = (await Bip44Wallet.fromMnemonic(NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.MNEMONIC, NANO_TEST_VECTORS.PASSWORD)).id\r
-               const wallet = await Bip44Wallet.restore(id)\r
-\r
-               assert.ok('mnemonic' in wallet)\r
-               assert.ok('seed' in wallet)\r
-               assert.equals(wallet.mnemonic, '')\r
-               assert.equals(wallet.seed, '')\r
-\r
-               const unlockResult = await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
-\r
-               assert.equals(unlockResult, true)\r
-               assert.ok('mnemonic' in wallet)\r
-               assert.ok('seed' in wallet)\r
-               assert.equals(wallet.mnemonic, NANO_TEST_VECTORS.MNEMONIC)\r
-               assert.equals(wallet.seed, NANO_TEST_VECTORS.BIP39_SEED)\r
-       })\r
-\r
-       test('should retrieve a Blake2bWallet from storage using an ID', async () => {\r
-               const id = (await Blake2bWallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_0)).id\r
-               const wallet = await Blake2bWallet.restore(id)\r
-\r
-               assert.ok('mnemonic' in wallet)\r
-               assert.ok('seed' in wallet)\r
-               assert.equals(wallet.mnemonic, '')\r
-               assert.equals(wallet.seed, '')\r
-\r
-               const unlockResult = await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
-\r
-               assert.equals(unlockResult, true)\r
-               assert.ok('mnemonic' in wallet)\r
-               assert.ok('seed' in wallet)\r
-               assert.equals(wallet.mnemonic, TREZOR_TEST_VECTORS.MNEMONIC_0)\r
-               assert.equals(wallet.seed, TREZOR_TEST_VECTORS.ENTROPY_0)\r
-       })\r
+test('import a wallet with the official Nano test vectors mnemonic', async () => {\r
+       const wallet = await Bip44Wallet.fromMnemonic(NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.MNEMONIC, NANO_TEST_VECTORS.PASSWORD)\r
+       await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
+       const accounts = await wallet.accounts()\r
+\r
+       assert.ok('mnemonic' in wallet)\r
+       assert.ok('seed' in wallet)\r
+       assert.ok(accounts[0] instanceof Account)\r
+       assert.equals(wallet.mnemonic, NANO_TEST_VECTORS.MNEMONIC)\r
+       assert.equals(wallet.seed, NANO_TEST_VECTORS.BIP39_SEED)\r
+       assert.equals(accounts[0].privateKey, NANO_TEST_VECTORS.PRIVATE_0)\r
+       assert.equals(accounts[0].publicKey, NANO_TEST_VECTORS.PUBLIC_0)\r
+       assert.equals(accounts[0].address, NANO_TEST_VECTORS.ADDRESS_0)\r
+})\r
+\r
+test('import a wallet with the checksum starting with a zero', async () => {\r
+       const wallet = await Bip44Wallet.fromMnemonic(NANO_TEST_VECTORS.PASSWORD, 'food define cancel major spoon trash cigar basic aim bless wolf win ability seek paddle bench seed century group they mercy address monkey cake')\r
+       await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
+       assert.equals(wallet.seed, 'F665F804E5907985455D1E5A7AD344843A2ED4179A7E06EEF263DE925FF6F4C0991B0A9344FCEE939FE0F1B1841B8C9B20FEACF6B954B74B2D26A01906B758E2')\r
+})\r
+\r
+test('import a wallet with a 12-word phrase', async () => {\r
+       const wallet = await Bip44Wallet.fromEntropy(NANO_TEST_VECTORS.PASSWORD, CUSTOM_TEST_VECTORS.ENTROPY_0)\r
+       await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
+       const accounts = await wallet.accounts()\r
+       const account = accounts[0]\r
+\r
+       assert.equals(wallet.mnemonic, CUSTOM_TEST_VECTORS.MNEMONIC_0)\r
+       assert.equals(wallet.seed, CUSTOM_TEST_VECTORS.SEED_0)\r
+       assert.equals(account.privateKey, CUSTOM_TEST_VECTORS.PRIVATE_0)\r
+       assert.equals(account.publicKey, CUSTOM_TEST_VECTORS.PUBLIC_0)\r
+       assert.equals(account.address, CUSTOM_TEST_VECTORS.ADDRESS_0)\r
+})\r
+\r
+test('import a wallet with a 15-word phrase', async () => {\r
+       const wallet = await Bip44Wallet.fromEntropy(NANO_TEST_VECTORS.PASSWORD, CUSTOM_TEST_VECTORS.ENTROPY_1)\r
+       await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
+       const accounts = await wallet.accounts()\r
+       const account = accounts[0]\r
+\r
+       assert.equals(wallet.mnemonic, CUSTOM_TEST_VECTORS.MNEMONIC_1)\r
+       assert.equals(wallet.seed, CUSTOM_TEST_VECTORS.SEED_1)\r
+       assert.equals(account.privateKey, CUSTOM_TEST_VECTORS.PRIVATE_1)\r
+       assert.equals(account.publicKey, CUSTOM_TEST_VECTORS.PUBLIC_1)\r
+       assert.equals(account.address, CUSTOM_TEST_VECTORS.ADDRESS_1)\r
+})\r
+\r
+test('import a wallet with a 18-word phrase', async () => {\r
+       const wallet = await Bip44Wallet.fromEntropy(NANO_TEST_VECTORS.PASSWORD, CUSTOM_TEST_VECTORS.ENTROPY_2)\r
+       await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
+       const accounts = await wallet.accounts()\r
+       const account = accounts[0]\r
+\r
+       assert.equals(wallet.mnemonic, CUSTOM_TEST_VECTORS.MNEMONIC_2)\r
+       assert.equals(wallet.seed, CUSTOM_TEST_VECTORS.SEED_2)\r
+       assert.equals(account.privateKey, CUSTOM_TEST_VECTORS.PRIVATE_2)\r
+       assert.equals(account.publicKey, CUSTOM_TEST_VECTORS.PUBLIC_2)\r
+       assert.equals(account.address, CUSTOM_TEST_VECTORS.ADDRESS_2)\r
+})\r
+\r
+test('import a wallet with a 21-word phrase', async () => {\r
+       const wallet = await Bip44Wallet.fromEntropy(NANO_TEST_VECTORS.PASSWORD, CUSTOM_TEST_VECTORS.ENTROPY_3)\r
+       await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
+       const accounts = await wallet.accounts()\r
+       const account = accounts[0]\r
+\r
+       assert.equals(wallet.mnemonic, CUSTOM_TEST_VECTORS.MNEMONIC_3)\r
+       assert.equals(wallet.seed, CUSTOM_TEST_VECTORS.SEED_3)\r
+       assert.equals(account.privateKey, CUSTOM_TEST_VECTORS.PRIVATE_3)\r
+       assert.equals(account.publicKey, CUSTOM_TEST_VECTORS.PUBLIC_3)\r
+       assert.equals(account.address, CUSTOM_TEST_VECTORS.ADDRESS_3)\r
+})\r
+\r
+test('import a wallet with the official Nano test vectors seed', async () => {\r
+       const wallet = await Bip44Wallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED)\r
+       await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
+       const accounts = await wallet.accounts()\r
+\r
+       assert.ok('mnemonic' in wallet)\r
+       assert.ok('seed' in wallet)\r
+       assert.ok(accounts[0] instanceof Account)\r
+       assert.equals(wallet.mnemonic, '')\r
+       assert.equals(wallet.seed, NANO_TEST_VECTORS.BIP39_SEED)\r
+       assert.equals(accounts[0].privateKey, NANO_TEST_VECTORS.PRIVATE_0)\r
+       assert.equals(accounts[0].publicKey, NANO_TEST_VECTORS.PUBLIC_0)\r
+       assert.equals(accounts[0].address, NANO_TEST_VECTORS.ADDRESS_0)\r
+})\r
+\r
+test('import a BIP-44 wallet with the zero seed', async () => {\r
+       const wallet = await Bip44Wallet.fromEntropy(NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_0, TREZOR_TEST_VECTORS.PASSWORD)\r
+       await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
+       const accounts = await wallet.accounts(0, 3)\r
+\r
+       assert.ok('mnemonic' in wallet)\r
+       assert.ok('seed' in wallet)\r
+       assert.equals(wallet.mnemonic, TREZOR_TEST_VECTORS.MNEMONIC_0)\r
+       assert.equals(wallet.seed, TREZOR_TEST_VECTORS.SEED_0.toUpperCase())\r
+       assert.equals(accounts.length, 4)\r
+       for (let i = 0; i < accounts.length; i++) {\r
+               assert.ok(accounts[i])\r
+               assert.ok(accounts[i].address)\r
+               assert.ok(accounts[i].publicKey)\r
+               assert.ok(accounts[i].privateKey)\r
+               assert.equals(accounts[i].index, i)\r
+       }\r
+})\r
+\r
+test('import a BLAKE2b wallet with the zero seed', async () => {\r
+       const wallet = await Blake2bWallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_0)\r
+       await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
+       const accounts = await wallet.accounts(0, 3)\r
+\r
+       console.log(`\nHERE 1\n`)\r
+       assert.ok('mnemonic' in wallet)\r
+       assert.ok('seed' in wallet)\r
+       assert.equals(wallet.mnemonic, TREZOR_TEST_VECTORS.MNEMONIC_0)\r
+       assert.equals(wallet.seed, TREZOR_TEST_VECTORS.ENTROPY_0)\r
+       assert.equals(accounts.length, 4)\r
+       console.log(`\nHERE 2\n`)\r
+       for (let i = 0; i < accounts.length; i++) {\r
+               assert.ok(accounts[i])\r
+               assert.ok(accounts[i].address)\r
+               assert.ok(accounts[i].publicKey)\r
+               assert.ok(accounts[i].privateKey)\r
+               assert.equals(accounts[i].index, i)\r
+       }\r
+})\r
+\r
+test('import a BLAKE2b wallet with Trezor test vectors', async () => {\r
+       const wallet = await Blake2bWallet.fromMnemonic(NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.MNEMONIC_1)\r
+       await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
+       const accounts = await wallet.accounts(0, 1)\r
+\r
+       assert.ok('mnemonic' in wallet)\r
+       assert.ok('seed' in wallet)\r
+       assert.equals(wallet.mnemonic, TREZOR_TEST_VECTORS.MNEMONIC_1)\r
+       assert.equals(wallet.seed, TREZOR_TEST_VECTORS.ENTROPY_1)\r
+       assert.ok(accounts[0] instanceof Account)\r
+       assert.equals(accounts[0].index, 0)\r
+       assert.equals(accounts[0].privateKey, TREZOR_TEST_VECTORS.BLAKE2B_1_PRIVATE_0)\r
+       assert.equals(accounts[0].publicKey, TREZOR_TEST_VECTORS.BLAKE2B_1_PUBLIC_0)\r
+       assert.equals(accounts[0].address, TREZOR_TEST_VECTORS.BLAKE2B_1_ADDRESS_0)\r
+       assert.ok(accounts[1] instanceof Account)\r
+       assert.equals(accounts[1].index, 1)\r
+       assert.equals(accounts[1].privateKey, TREZOR_TEST_VECTORS.BLAKE2B_1_PRIVATE_1)\r
+       assert.equals(accounts[1].publicKey, TREZOR_TEST_VECTORS.BLAKE2B_1_PUBLIC_1)\r
+       assert.equals(accounts[1].address, TREZOR_TEST_VECTORS.BLAKE2B_1_ADDRESS_1)\r
+})\r
+\r
+test('get identical BLAKE2b wallets when created with a seed versus with its derived mnemonic', async () => {\r
+       const wallet = await Blake2bWallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_2)\r
+       await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
+       const walletAccounts = await wallet.accounts()\r
+       const walletAccount = walletAccounts[0]\r
+\r
+       console.log(`\nHERE 3\n`)\r
+       assert.ok('mnemonic' in wallet)\r
+       assert.ok('seed' in wallet)\r
+       assert.ok(walletAccount)\r
+       assert.equals(wallet.mnemonic, TREZOR_TEST_VECTORS.MNEMONIC_2)\r
+\r
+       console.log(`\nHERE 4\n`)\r
+       const imported = await Blake2bWallet.fromMnemonic(TREZOR_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.MNEMONIC_2)\r
+       await imported.unlock(TREZOR_TEST_VECTORS.PASSWORD)\r
+       const importedAccounts = await imported.accounts()\r
+       const importedAccount = importedAccounts[0]\r
+\r
+       console.log(`\nHERE 5\n`)\r
+       assert.equals(imported.mnemonic, wallet.mnemonic)\r
+       assert.equals(imported.seed, wallet.seed)\r
+       assert.equals(importedAccount.privateKey, walletAccount.privateKey)\r
+       assert.equals(importedAccount.publicKey, walletAccount.publicKey)\r
+})\r
+\r
+test('get identical BLAKE2b wallets when created with max entropy value', async () => {\r
+       const wallet = await Blake2bWallet.fromMnemonic(NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.MNEMONIC_3)\r
+       await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
+       const accounts = await wallet.accounts()\r
+\r
+       assert.ok('mnemonic' in wallet)\r
+       assert.ok('seed' in wallet)\r
+       assert.ok(accounts[0] instanceof Account)\r
+       assert.equals(wallet.mnemonic, TREZOR_TEST_VECTORS.MNEMONIC_3)\r
+       assert.equals(wallet.seed, TREZOR_TEST_VECTORS.ENTROPY_3)\r
+       assert.equals(accounts[0].index, 0)\r
+       assert.equals(accounts[0].privateKey, TREZOR_TEST_VECTORS.BLAKE2B_3_PRIVATE_0)\r
+       assert.equals(accounts[0].publicKey, TREZOR_TEST_VECTORS.BLAKE2B_3_PUBLIC_0)\r
+       assert.equals(accounts[0].address, TREZOR_TEST_VECTORS.BLAKE2B_3_ADDRESS_0)\r
+})\r
+\r
+test('reject when given invalid entropy', async () => {\r
+       await assert.rejects(Bip44Wallet.fromEntropy(NANO_TEST_VECTORS.PASSWORD, '6CAF5A42BB8074314AAE20295975ECE663BE7AAD945A73613D193B0CC41C797'))\r
+       await assert.rejects(Bip44Wallet.fromEntropy(NANO_TEST_VECTORS.PASSWORD, '6CAF5A42BB8074314AAE20295975ECE663BE7AAD945A73613D193B0CC41C79701'))\r
+       await assert.rejects(Bip44Wallet.fromEntropy(NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_0.replaceAll(/./g, 'x')))\r
+})\r
+\r
+test('reject when given a seed with an invalid length', async () => {\r
+       await assert.rejects(Bip44Wallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED + 'f'),\r
+               `Expected a ${NANO_TEST_VECTORS.BIP39_SEED.length}-character seed, but received ${NANO_TEST_VECTORS.BIP39_SEED.length + 1}-character string.`)\r
+       await assert.rejects(Bip44Wallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED.slice(0, -1)),\r
+               `Expected a ${NANO_TEST_VECTORS.BIP39_SEED.length}-character seed, but received ${NANO_TEST_VECTORS.BIP39_SEED.length - 1}-character string.`)\r
+})\r
+\r
+test('reject when given a seed containing non-hex characters', async () => {\r
+       await assert.rejects(Bip44Wallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.SEED_0.replace(/./, 'g')),\r
+               'Seed contains invalid hexadecimal characters.')\r
+       await assert.rejects(Blake2bWallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_1.replace(/./, 'g')),\r
+               'Seed contains invalid hexadecimal characters.')\r
+})\r
+\r
+\r
+test('retrieve a Bip44Wallet from storage using an ID', async () => {\r
+       const id = (await Bip44Wallet.fromMnemonic(NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.MNEMONIC, NANO_TEST_VECTORS.PASSWORD)).id\r
+       const wallet = await Bip44Wallet.restore(id)\r
+\r
+       assert.ok('mnemonic' in wallet)\r
+       assert.ok('seed' in wallet)\r
+       assert.equals(wallet.mnemonic, '')\r
+       assert.equals(wallet.seed, '')\r
+\r
+       const unlockResult = await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
+\r
+       assert.equals(unlockResult, true)\r
+       assert.ok('mnemonic' in wallet)\r
+       assert.ok('seed' in wallet)\r
+       assert.equals(wallet.mnemonic, NANO_TEST_VECTORS.MNEMONIC)\r
+       assert.equals(wallet.seed, NANO_TEST_VECTORS.BIP39_SEED)\r
+})\r
+\r
+test('retrieve a Blake2bWallet from storage using an ID', async () => {\r
+       const id = (await Blake2bWallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_0)).id\r
+       const wallet = await Blake2bWallet.restore(id)\r
+\r
+       assert.ok('mnemonic' in wallet)\r
+       assert.ok('seed' in wallet)\r
+       assert.equals(wallet.mnemonic, '')\r
+       assert.equals(wallet.seed, '')\r
+\r
+       const unlockResult = await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
+\r
+       assert.equals(unlockResult, true)\r
+       assert.ok('mnemonic' in wallet)\r
+       assert.ok('seed' in wallet)\r
+       assert.equals(wallet.mnemonic, TREZOR_TEST_VECTORS.MNEMONIC_0)\r
+       assert.equals(wallet.seed, TREZOR_TEST_VECTORS.ENTROPY_0)\r
 })\r
index b583555ba10a52d8cf245e9b78f88276008b5a17..af9784037ba5333ccd24d3f1d6f97d3ab8bd258e 100644 (file)
@@ -3,7 +3,7 @@
 \r
 'use strict'\r
 \r
-import { assert, test } from '#test/GLOBALS.mjs'\r
+import { assert, test } from '#GLOBALS.mjs'\r
 import { NANO_TEST_VECTORS, TREZOR_TEST_VECTORS } from '#test/TEST_VECTORS.js'\r
 import { Bip44Wallet, Blake2bWallet } from '#dist/main.js'\r
 \r
index f7a990fbb381fef553ab348ea956d57b7f40a25c..14f5bc456b65f6f2c6ae531a31add6168d55fe20 100644 (file)
@@ -10,7 +10,6 @@ import './refresh-accounts.test.mjs'
 import './sign-blocks.test.mjs'
 import './tools.test.mjs'
 
-import './perf/account.perf.js'
-import './perf/wallet.perf.js'
-
-console.log('> TESTING COMPLETE <')
+document.addEventListener('DOMContentLoaded', () => {
+  console.log('> TESTING COMPLETE <')
+})
index 53c0d279f9a1f1ec7f053b358e9f854b8bbd3ed5..aab06905a5380db122c56dbb4719da02dd4d4912 100644 (file)
@@ -3,7 +3,7 @@
 
 'use strict'
 
-import { assert, test } from '#test/GLOBALS.mjs'
+import { assert, test } from '#GLOBALS.mjs'
 import { NANO_TEST_VECTORS } from '#test/TEST_VECTORS.js'
 import { Rolodex, Tools } from '#dist/main.js'
 
index 00e76faa70780630b36e08dbb46f92773a220df7..7dd2f608a931bf6618edd65f2bda2998ea3c5a67 100644 (file)
@@ -3,7 +3,7 @@
 
 'use strict'
 
-import { assert, skip, test } from '#test/GLOBALS.mjs'
+import { assert, skip, test } from '#GLOBALS.mjs'
 import { NANO_TEST_VECTORS } from '#test/TEST_VECTORS.js'
 import { Account, Bip44Wallet, Rpc } from '#dist/main.js'
 
index 0415a97117cbfc25972105c8929c599cdb9455c0..a0d8a7e90cc489ca974fe35af18f9bcbc6c7f54a 100644 (file)
@@ -3,7 +3,7 @@
 \r
 'use strict'\r
 \r
-import { assert, test } from '#test/GLOBALS.mjs'\r
+import { assert, test } from '#GLOBALS.mjs'\r
 import { NANO_TEST_VECTORS } from '#test/TEST_VECTORS.js'\r
 import { SendBlock, ReceiveBlock, ChangeBlock } from '#dist/main.js'\r
 \r
index 04be748e7b18a2a04deec7963507442709163dc9..14d6ccbcc6b5e3a805b63ac250083b8f29b5a202 100644 (file)
@@ -3,7 +3,7 @@
 \r
 'use strict'\r
 \r
-import { assert, skip, test } from '#test/GLOBALS.mjs'\r
+import { assert, skip, test } from '#GLOBALS.mjs'\r
 import { RAW_MAX, NANO_TEST_VECTORS } from '#test/TEST_VECTORS.js'\r
 import { Bip44Wallet, Account, SendBlock, Rpc, Tools } from '#dist/main.js'\r
 \r