"build:prod": "npm run clean && node esbuild-prod.mjs",
"publish": "npm run build:prod",
"test": "npm run build",
- "test:node": "npm run build:node && node --test --test-force-exit --env-file .env",
+ "test:node": "npm run build:node && node --test --test-force-exit --no-experimental-strip-types --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"
},
await test(`Time to create ${COUNT} BIP-44 accounts`, async () => {
const wallet = await Bip44Wallet.create(NANO_TEST_VECTORS.PASSWORD)
await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)
+
const start = performance.now()
const accounts = await wallet.accounts(0, COUNT - 1)
const end = performance.now()
console.log(`Total: ${end - start} ms`)
console.log(`Average: ${(end - start) / COUNT} ms`)
assert.equal(accounts.length, COUNT)
+
await wallet.destroy()
})
await test(`Time to create ${COUNT} BLAKE2b accounts`, async () => {
const wallet = await Blake2bWallet.create(NANO_TEST_VECTORS.PASSWORD)
await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)
+
const start = performance.now()
const accounts = await wallet.accounts(0, COUNT - 1)
const end = performance.now()
console.log(`Total: ${end - start} ms`)
console.log(`Average: ${(end - start) / COUNT} ms`)
assert.equal(accounts.length, COUNT)
+
await wallet.destroy()
})
await test(`Time to create 1 BIP-44 account ${COUNT} times`, async () => {
- const times = []
const wallet = await Bip44Wallet.create(NANO_TEST_VECTORS.PASSWORD)
await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)
+
+ const times = []
for (let i = 0; i < COUNT; i++) {
const start = performance.now()
- await wallet.accounts(i)
+ await wallet.account(i)
const end = performance.now()
times.push(end - start)
}
- await wallet.destroy()
console.log(stats(times))
+
+ await wallet.destroy()
})
- await test(`Average time to create 1 BLAKE2b account ${COUNT} times`, async () => {
- const times = []
+ await test(`Time to create 1 BLAKE2b account ${COUNT} times`, async () => {
const wallet = await Blake2bWallet.create(NANO_TEST_VECTORS.PASSWORD)
await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)
+
+ const times = []
for (let i = 0; i < COUNT; i++) {
const start = performance.now()
- await wallet.accounts(i)
+ await wallet.account(i)
const end = performance.now()
times.push(end - start)
}
- await wallet.destroy()
console.log(stats(times))
+
+ await wallet.destroy()
})
})
])