From: Chris Duncan Date: Wed, 20 Nov 2024 01:07:16 +0000 (-0800) Subject: Additional tests for wallet properties. X-Git-Tag: v0.0.21~4 X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=910e6a5cf81c36de23075c1cf05864310e119d05;p=libnemo.git Additional tests for wallet properties. --- 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 () => {