diff --git a/test/wallet-db.spec.ts b/test/wallet-db.spec.ts index 64c098d..d4abcd0 100644 --- a/test/wallet-db.spec.ts +++ b/test/wallet-db.spec.ts @@ -24,6 +24,16 @@ describe('Wallet DB', () => { expect(await walletDB.getVersion()).toBe(1); }); + it('should set and retrieve encryptedPrivateKey and encryptedChaincode', async () => { + const samplePrivateKey = 'samplePrivateKey'; + const sampleChaincode = 'sampleChaincode'; + await walletDB.setMasterKey(samplePrivateKey, sampleChaincode); + const { encryptedPrivateKey, encryptedChaincode } = + await walletDB.getMasterKey(); + expect(encryptedPrivateKey).toStrictEqual(samplePrivateKey); + expect(encryptedChaincode).toStrictEqual(sampleChaincode); + }); + afterAll(async () => { await walletDB.close(); fs.rmSync('./test/wallet-db', { recursive: true, force: true }); diff --git a/test/wallet.spec.ts b/test/wallet.spec.ts index 62f333a..783b8ba 100644 --- a/test/wallet.spec.ts +++ b/test/wallet.spec.ts @@ -34,6 +34,7 @@ describe('Wallet', () => { it('should initialise the wallet', async () => { await wallet.init( 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about', + 'samplePassword', ); });