Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
✅ getPrivateKeyFromPhraseAndPath
Browse files Browse the repository at this point in the history
  • Loading branch information
has5aan committed Oct 17, 2023
1 parent f79aa30 commit f31b506
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions elements/lisk-cryptography/test/ed.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,20 @@ describe('getPrivateKeyFromPhraseAndPath', () => {
);
});

it('should derive distinct keys from same valid phrase but distinct paths', async () => {
const privateKeyFromPassphrase = await getPrivateKeyFromPhraseAndPath(
passphrase,
`m/44'/134'/0'`,
);

const anotherPrivateKeyFromPassphrase = await getPrivateKeyFromPhraseAndPath(
passphrase,
`m/44'/134'/1'`,
);

expect(privateKeyFromPassphrase).not.toEqual(anotherPrivateKeyFromPassphrase);
});

it('should fail for empty string path', async () => {
await expect(getPrivateKeyFromPhraseAndPath(passphrase, '')).rejects.toThrow(
'Invalid path format',
Expand Down

0 comments on commit f31b506

Please sign in to comment.