Skip to content

Commit 9799cbc

Browse files
author
Yury Shapkarin
authored
test: salt next to the kdf.params
1 parent d9cc252 commit 9799cbc

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

packages/proto-signing/src/directsecp256k1hdwallet.spec.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -304,21 +304,9 @@ describe("DirectSecp256k1HdWallet", () => {
304304
const original = await DirectSecp256k1HdWallet.fromMnemonic(defaultMnemonic);
305305
const password = "123";
306306
const serialized = await original.serialize(password);
307+
const parsed = JSON.parse(serialized);
307308

308-
expect(Object.keys(serialized)).toContain('salt');
309-
});
310-
311-
it("Generate a random salt for each serialization", async () => {
312-
const original = await DirectSecp256k1HdWallet.fromMnemonic(defaultMnemonic);
313-
const password = "123";
314-
const first = await original.serialize(password);
315-
const second = await original.serialize(password);
316-
const third = await original.serialize(password);
317-
318-
const array = [first, second, third];
319-
const unique = new Map(array.map(item => [item.salt]));
320-
321-
expect(unique.size).toEqual(array.length);
309+
expect(Object.keys(parsed.kdf.params)).toContain('salt');
322310
});
323311
});
324312

0 commit comments

Comments
 (0)