From 910e6a5cf81c36de23075c1cf05864310e119d05 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Tue, 19 Nov 2024 17:07:16 -0800 Subject: [PATCH] Additional tests for wallet properties. --- test/create-wallet.test.mjs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/create-wallet.test.mjs b/test/create-wallet.test.mjs index 946ef0f..f07dbf2 100644 --- a/test/create-wallet.test.mjs +++ b/test/create-wallet.test.mjs @@ -15,8 +15,11 @@ describe('creating a new wallet', async () => { await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) assert.ok('id' in wallet) + assert.ok(/[A-Fa-f0-9]{32,64}/.test(wallet.id)) assert.ok('mnemonic' in wallet) + assert.ok(/^(?:[a-z]{3,} ){11,23}[a-z]{3,}$/.test(wallet.mnemonic)) assert.ok('seed' in wallet) + assert.ok(/[A-Fa-f0-9]{32,64}/.test(wallet.seed)) }) it('BLAKE2b wallet with random entropy', async () => { @@ -24,8 +27,11 @@ describe('creating a new wallet', async () => { await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) assert.ok('id' in wallet) + assert.ok(/[A-Fa-f0-9]{32,64}/.test(wallet.id)) assert.ok('mnemonic' in wallet) + assert.ok(/^(?:[a-z]{3,} ){11,23}[a-z]{3,}$/.test(wallet.mnemonic)) assert.ok('seed' in wallet) + assert.ok(/[A-Fa-f0-9]{32,64}/.test(wallet.seed)) }) it('BIP-44 replace invalid salt with empty string', async () => { -- 2.34.1