Skip to content

Commit

Permalink
test: add tests fro new methods
Browse files Browse the repository at this point in the history
  • Loading branch information
emjshrx committed Feb 9, 2024
1 parent abba750 commit a213fc1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/wallet-db.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
1 change: 1 addition & 0 deletions test/wallet.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
);
});

Expand Down

0 comments on commit a213fc1

Please sign in to comment.