]> zoso.dev Git - libnemo.git/commitdiff
Additional tests for wallet properties.
authorChris Duncan <chris@zoso.dev>
Wed, 20 Nov 2024 01:07:16 +0000 (17:07 -0800)
committerChris Duncan <chris@zoso.dev>
Wed, 20 Nov 2024 01:07:16 +0000 (17:07 -0800)
test/create-wallet.test.mjs

index 946ef0f737c19356afed65b594e3ebebef7d3fc2..f07dbf22a8f4cde6e08f09dc3a9bacda54594456 100644 (file)
@@ -15,8 +15,11 @@ describe('creating a new wallet', async () => {
                await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
 \r
                assert.ok('id' in wallet)\r
+               assert.ok(/[A-Fa-f0-9]{32,64}/.test(wallet.id))\r
                assert.ok('mnemonic' in wallet)\r
+               assert.ok(/^(?:[a-z]{3,} ){11,23}[a-z]{3,}$/.test(wallet.mnemonic))\r
                assert.ok('seed' in wallet)\r
+               assert.ok(/[A-Fa-f0-9]{32,64}/.test(wallet.seed))\r
        })\r
 \r
        it('BLAKE2b wallet with random entropy', async () => {\r
@@ -24,8 +27,11 @@ describe('creating a new wallet', async () => {
                await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
 \r
                assert.ok('id' in wallet)\r
+               assert.ok(/[A-Fa-f0-9]{32,64}/.test(wallet.id))\r
                assert.ok('mnemonic' in wallet)\r
+               assert.ok(/^(?:[a-z]{3,} ){11,23}[a-z]{3,}$/.test(wallet.mnemonic))\r
                assert.ok('seed' in wallet)\r
+               assert.ok(/[A-Fa-f0-9]{32,64}/.test(wallet.seed))\r
        })\r
 \r
        it('BIP-44 replace invalid salt with empty string', async () => {\r