From: Chris Duncan Date: Sat, 2 Aug 2025 07:54:40 +0000 (-0700) Subject: Use new wallet verify method instead of comparing secrets directly in tests. X-Git-Tag: v0.10.5~47^2~18 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=eea4cd10aa6c32c34c44d5faafd95d447230f6ef;p=libnemo.git Use new wallet verify method instead of comparing secrets directly in tests. --- diff --git a/test/test.import-wallet.mjs b/test/test.import-wallet.mjs index c03f382..c540446 100644 --- a/test/test.import-wallet.mjs +++ b/test/test.import-wallet.mjs @@ -28,11 +28,10 @@ await Promise.all([ await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const account = await wallet.account() - assert.ok('mnemonic' in wallet) - assert.ok('seed' in wallet) + assert.ok(await wallet.verify(NANO_TEST_VECTORS.MNEMONIC)) + debugger + assert.ok(await wallet.verify(NANO_TEST_VECTORS.BIP39_SEED)) assert.ok(account instanceof Account) - assert.equal(wallet.mnemonic, NANO_TEST_VECTORS.MNEMONIC) - assert.equal(wallet.seed, NANO_TEST_VECTORS.BIP39_SEED) assert.equal(account.publicKey, NANO_TEST_VECTORS.PUBLIC_0) assert.equal(account.address, NANO_TEST_VECTORS.ADDRESS_0) @@ -269,9 +268,9 @@ await Promise.all([ await test('export wallet IDs from storage and reimport them', async () => { const wallet = await Wallet.import('BIP-44', NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.MNEMONIC, NANO_TEST_VECTORS.PASSWORD) - const ids = await Wallet.export() + const backups = await Wallet.export() - assert.ok(ids['BIP-44'].some(id => `BIP-44_${id}` === wallet.id)) + assert.ok(backups.some(id => id === wallet.id)) const restored = await Wallet.restore(wallet.id)